polotno-node 2.12.16 → 2.12.18
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.
- package/README.md +126 -21
- package/dist/assets/{html2canvas.esm-CBrSDip1.js → html2canvas.esm-BfxBtG_O.js} +1 -1
- package/dist/assets/index-Cn3AfcuE.js +627 -0
- package/dist/assets/index.es-DBuDDb35.js +18 -0
- package/dist/index.html +1 -1
- package/index.js +1 -1
- package/package.json +8 -8
- package/dist/assets/index-CuX31qNv.js +0 -620
- package/dist/assets/index.es-Uuln-F6j.js +0 -18
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zc(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var t=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var B0={exports:{}},zr={};/**
|
|
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 gy;function o7(){if(gy)return zr;gy=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.iterator;function g(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function w(j,z,F){this.props=j,this.context=z,this.refs=S,this.updater=F||f}w.prototype.isReactComponent={},w.prototype.setState=function(j,z){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,z,"setState")},w.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function _(){}_.prototype=w.prototype;function y(j,z,F){this.props=j,this.context=z,this.refs=S,this.updater=F||f}var p=y.prototype=new _;p.constructor=y,E(p,w.prototype),p.isPureReactComponent=!0;var m=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function L(j,z,F){var Y,J={},X=null,Q=null;if(z!=null)for(Y in z.ref!==void 0&&(Q=z.ref),z.key!==void 0&&(X=""+z.key),z)P.call(z,Y)&&!k.hasOwnProperty(Y)&&(J[Y]=z[Y]);var ae=arguments.length-2;if(ae===1)J.children=F;else if(1<ae){for(var se=Array(ae),fe=0;fe<ae;fe++)se[fe]=arguments[fe+2];J.children=se}if(j&&j.defaultProps)for(Y in ae=j.defaultProps,ae)J[Y]===void 0&&(J[Y]=ae[Y]);return{$$typeof:e,type:j,key:X,ref:Q,props:J,_owner:T.current}}function I(j,z){return{$$typeof:e,type:j.type,key:z,ref:j.ref,props:j.props,_owner:j._owner}}function R(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function A(j){var z={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(F){return z[F]})}var O=/\/+/g;function M(j,z){return typeof j=="object"&&j!==null&&j.key!=null?A(""+j.key):z.toString(36)}function q(j,z,F,Y,J){var X=typeof j;(X==="undefined"||X==="boolean")&&(j=null);var Q=!1;if(j===null)Q=!0;else switch(X){case"string":case"number":Q=!0;break;case"object":switch(j.$$typeof){case e:case r:Q=!0}}if(Q)return Q=j,J=J(Q),j=Y===""?"."+M(Q,0):Y,m(J)?(F="",j!=null&&(F=j.replace(O,"$&/")+"/"),q(J,z,F,"",function(fe){return fe})):J!=null&&(R(J)&&(J=I(J,F+(!J.key||Q&&Q.key===J.key?"":(""+J.key).replace(O,"$&/")+"/")+j)),z.push(J)),1;if(Q=0,Y=Y===""?".":Y+":",m(j))for(var ae=0;ae<j.length;ae++){X=j[ae];var se=Y+M(X,ae);Q+=q(X,z,F,se,J)}else if(se=g(j),typeof se=="function")for(j=se.call(j),ae=0;!(X=j.next()).done;)X=X.value,se=Y+M(X,ae++),Q+=q(X,z,F,se,J);else if(X==="object")throw z=String(j),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return Q}function D(j,z,F){if(j==null)return j;var Y=[],J=0;return q(j,Y,"","",function(X){return z.call(F,X,J++)}),Y}function te(j){if(j._status===-1){var z=j._result;z=z(),z.then(function(F){(j._status===0||j._status===-1)&&(j._status=1,j._result=F)},function(F){(j._status===0||j._status===-1)&&(j._status=2,j._result=F)}),j._status===-1&&(j._status=0,j._result=z)}if(j._status===1)return j._result.default;throw j._result}var H={current:null},B={transition:null},$={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:B,ReactCurrentOwner:T};function V(){throw Error("act(...) is not supported in production builds of React.")}return zr.Children={map:D,forEach:function(j,z,F){D(j,function(){z.apply(this,arguments)},F)},count:function(j){var z=0;return D(j,function(){z++}),z},toArray:function(j){return D(j,function(z){return z})||[]},only:function(j){if(!R(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},zr.Component=w,zr.Fragment=t,zr.Profiler=a,zr.PureComponent=y,zr.StrictMode=n,zr.Suspense=u,zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,zr.act=V,zr.cloneElement=function(j,z,F){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var Y=E({},j.props),J=j.key,X=j.ref,Q=j._owner;if(z!=null){if(z.ref!==void 0&&(X=z.ref,Q=T.current),z.key!==void 0&&(J=""+z.key),j.type&&j.type.defaultProps)var ae=j.type.defaultProps;for(se in z)P.call(z,se)&&!k.hasOwnProperty(se)&&(Y[se]=z[se]===void 0&&ae!==void 0?ae[se]:z[se])}var se=arguments.length-2;if(se===1)Y.children=F;else if(1<se){ae=Array(se);for(var fe=0;fe<se;fe++)ae[fe]=arguments[fe+2];Y.children=ae}return{$$typeof:e,type:j.type,key:J,ref:X,props:Y,_owner:Q}},zr.createContext=function(j){return j={$$typeof:o,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},zr.createElement=L,zr.createFactory=function(j){var z=L.bind(null,j);return z.type=j,z},zr.createRef=function(){return{current:null}},zr.forwardRef=function(j){return{$$typeof:s,render:j}},zr.isValidElement=R,zr.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:te}},zr.memo=function(j,z){return{$$typeof:c,type:j,compare:z===void 0?null:z}},zr.startTransition=function(j){var z=B.transition;B.transition={};try{j()}finally{B.transition=z}},zr.unstable_act=V,zr.useCallback=function(j,z){return H.current.useCallback(j,z)},zr.useContext=function(j){return H.current.useContext(j)},zr.useDebugValue=function(){},zr.useDeferredValue=function(j){return H.current.useDeferredValue(j)},zr.useEffect=function(j,z){return H.current.useEffect(j,z)},zr.useId=function(){return H.current.useId()},zr.useImperativeHandle=function(j,z,F){return H.current.useImperativeHandle(j,z,F)},zr.useInsertionEffect=function(j,z){return H.current.useInsertionEffect(j,z)},zr.useLayoutEffect=function(j,z){return H.current.useLayoutEffect(j,z)},zr.useMemo=function(j,z){return H.current.useMemo(j,z)},zr.useReducer=function(j,z,F){return H.current.useReducer(j,z,F)},zr.useRef=function(j){return H.current.useRef(j)},zr.useState=function(j){return H.current.useState(j)},zr.useSyncExternalStore=function(j,z,F){return H.current.useSyncExternalStore(j,z,F)},zr.useTransition=function(){return H.current.useTransition()},zr.version="18.3.1",zr}var vy;function ai(){return vy||(vy=1,B0.exports=o7()),B0.exports}var ii=ai();const $r=yp(ii);var r1={},q0={exports:{}},hs={},z0={exports:{}},U0={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var my;function s7(){return my||(my=1,function(e){function r(B,$){var V=B.length;B.push($);e:for(;0<V;){var j=V-1>>>1,z=B[j];if(0<a(z,$))B[j]=$,B[V]=z,V=j;else break e}}function t(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var $=B[0],V=B.pop();if(V!==$){B[0]=V;e:for(var j=0,z=B.length,F=z>>>1;j<F;){var Y=2*(j+1)-1,J=B[Y],X=Y+1,Q=B[X];if(0>a(J,V))X<z&&0>a(Q,J)?(B[j]=Q,B[X]=V,j=X):(B[j]=J,B[Y]=V,j=Y);else if(X<z&&0>a(Q,V))B[j]=Q,B[X]=V,j=X;else break e}}return $}function a(B,$){var V=B.sortIndex-$.sortIndex;return V!==0?V:B.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],c=[],h=1,v=null,g=3,f=!1,E=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(B){for(var $=t(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=B)n(c),$.sortIndex=$.expirationTime,r(u,$);else break;$=t(c)}}function m(B){if(S=!1,p(B),!E)if(t(u)!==null)E=!0,te(P);else{var $=t(c);$!==null&&H(m,$.startTime-B)}}function P(B,$){E=!1,S&&(S=!1,_(L),L=-1),f=!0;var V=g;try{for(p($),v=t(u);v!==null&&(!(v.expirationTime>$)||B&&!A());){var j=v.callback;if(typeof j=="function"){v.callback=null,g=v.priorityLevel;var z=j(v.expirationTime<=$);$=e.unstable_now(),typeof z=="function"?v.callback=z:v===t(u)&&n(u),p($)}else n(u);v=t(u)}if(v!==null)var F=!0;else{var Y=t(c);Y!==null&&H(m,Y.startTime-$),F=!1}return F}finally{v=null,g=V,f=!1}}var T=!1,k=null,L=-1,I=5,R=-1;function A(){return!(e.unstable_now()-R<I)}function O(){if(k!==null){var B=e.unstable_now();R=B;var $=!0;try{$=k(!0,B)}finally{$?M():(T=!1,k=null)}}else T=!1}var M;if(typeof y=="function")M=function(){y(O)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,D=q.port2;q.port1.onmessage=O,M=function(){D.postMessage(null)}}else M=function(){w(O,0)};function te(B){k=B,T||(T=!0,M())}function H(B,$){L=w(function(){B(e.unstable_now())},$)}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(B){B.callback=null},e.unstable_continueExecution=function(){E||f||(E=!0,te(P))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return t(u)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var $=3;break;default:$=g}var V=g;g=$;try{return B()}finally{g=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,$){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var V=g;g=B;try{return $()}finally{g=V}},e.unstable_scheduleCallback=function(B,$,V){var j=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?j+V:j):V=j,B){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=V+z,B={id:h++,callback:$,priorityLevel:B,startTime:V,expirationTime:z,sortIndex:-1},V>j?(B.sortIndex=V,r(c,B),t(u)===null&&B===t(c)&&(S?(_(L),L=-1):S=!0,H(m,V-j))):(B.sortIndex=z,r(u,B),E||f||(E=!0,te(P))),B},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(B){var $=g;return function(){var V=g;g=$;try{return B.apply(this,arguments)}finally{g=V}}}}(U0)),U0}var yy;function q2(){return yy||(yy=1,z0.exports=s7()),z0.exports}/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var by;function l7(){if(by)return hs;by=1;var e=ai(),r=q2();function t(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,C=1;C<arguments.length;C++)d+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,a={};function i(l,d){o(l,d),o(l+"Capture",d)}function o(l,d){for(a[l]=d,l=0;l<d.length;l++)n.add(d[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},v={};function g(l){return u.call(v,l)?!0:u.call(h,l)?!1:c.test(l)?v[l]=!0:(h[l]=!0,!1)}function f(l,d,C,G){if(C!==null&&C.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return G?!1:C!==null?!C.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function E(l,d,C,G){if(d===null||typeof d>"u"||f(l,d,C,G))return!0;if(G)return!1;if(C!==null)switch(C.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function S(l,d,C,G,ee,ie,pe){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=G,this.attributeNamespace=ee,this.mustUseProperty=C,this.propertyName=l,this.type=d,this.sanitizeURL=ie,this.removeEmptyString=pe}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new S(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];w[d]=new S(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new S(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new S(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){w[l]=new S(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new S(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new S(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new S(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new S(l,5,!1,l.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function y(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(_,y);w[d]=new S(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(_,y);w[d]=new S(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(_,y);w[d]=new S(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new S(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new S(l,1,!1,l.toLowerCase(),null,!0,!0)});function p(l,d,C,G){var ee=w.hasOwnProperty(d)?w[d]:null;(ee!==null?ee.type!==0:G||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(E(d,C,ee,G)&&(C=null),G||ee===null?g(d)&&(C===null?l.removeAttribute(d):l.setAttribute(d,""+C)):ee.mustUseProperty?l[ee.propertyName]=C===null?ee.type===3?!1:"":C:(d=ee.attributeName,G=ee.attributeNamespace,C===null?l.removeAttribute(d):(ee=ee.type,C=ee===3||ee===4&&C===!0?"":""+C,G?l.setAttributeNS(G,d,C):l.setAttribute(d,C))))}var m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),A=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),B=Symbol.iterator;function $(l){return l===null||typeof l!="object"?null:(l=B&&l[B]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,j;function z(l){if(j===void 0)try{throw Error()}catch(C){var d=C.stack.trim().match(/\n( *(at )?)/);j=d&&d[1]||""}return`
|
|
26
|
+
`+j+l}var F=!1;function Y(l,d){if(!l||F)return"";F=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(at){var G=at}Reflect.construct(l,[],d)}else{try{d.call()}catch(at){G=at}l.call(d.prototype)}else{try{throw Error()}catch(at){G=at}l()}}catch(at){if(at&&G&&typeof at.stack=="string"){for(var ee=at.stack.split(`
|
|
27
|
+
`),ie=G.stack.split(`
|
|
28
|
+
`),pe=ee.length-1,Ne=ie.length-1;1<=pe&&0<=Ne&&ee[pe]!==ie[Ne];)Ne--;for(;1<=pe&&0<=Ne;pe--,Ne--)if(ee[pe]!==ie[Ne]){if(pe!==1||Ne!==1)do if(pe--,Ne--,0>Ne||ee[pe]!==ie[Ne]){var Be=`
|
|
29
|
+
`+ee[pe].replace(" at new "," at ");return l.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",l.displayName)),Be}while(1<=pe&&0<=Ne);break}}}finally{F=!1,Error.prepareStackTrace=C}return(l=l?l.displayName||l.name:"")?z(l):""}function J(l){switch(l.tag){case 5:return z(l.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return l=Y(l.type,!1),l;case 11:return l=Y(l.type.render,!1),l;case 1:return l=Y(l.type,!0),l;default:return""}}function X(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case k:return"Fragment";case T:return"Portal";case I:return"Profiler";case L:return"StrictMode";case M:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case A:return(l.displayName||"Context")+".Consumer";case R:return(l._context.displayName||"Context")+".Provider";case O:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case D:return d=l.displayName||null,d!==null?d:X(l.type)||"Memo";case te:d=l._payload,l=l._init;try{return X(l(d))}catch{}}return null}function Q(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(d);case 8:return d===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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function ae(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function se(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function fe(l){var d=se(l)?"checked":"value",C=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),G=""+l[d];if(!l.hasOwnProperty(d)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var ee=C.get,ie=C.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return ee.call(this)},set:function(pe){G=""+pe,ie.call(this,pe)}}),Object.defineProperty(l,d,{enumerable:C.enumerable}),{getValue:function(){return G},setValue:function(pe){G=""+pe},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function be(l){l._valueTracker||(l._valueTracker=fe(l))}function _e(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var C=d.getValue(),G="";return l&&(G=se(l)?l.checked?"true":"false":l.value),l=G,l!==C?(d.setValue(l),!0):!1}function Ae(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Re(l,d){var C=d.checked;return V({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??l._wrapperState.initialChecked})}function Pe(l,d){var C=d.defaultValue==null?"":d.defaultValue,G=d.checked!=null?d.checked:d.defaultChecked;C=ae(d.value!=null?d.value:C),l._wrapperState={initialChecked:G,initialValue:C,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ye(l,d){d=d.checked,d!=null&&p(l,"checked",d,!1)}function nt(l,d){ye(l,d);var C=ae(d.value),G=d.type;if(C!=null)G==="number"?(C===0&&l.value===""||l.value!=C)&&(l.value=""+C):l.value!==""+C&&(l.value=""+C);else if(G==="submit"||G==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?he(l,d.type,C):d.hasOwnProperty("defaultValue")&&he(l,d.type,ae(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Ce(l,d,C){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var G=d.type;if(!(G!=="submit"&&G!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,C||d===l.value||(l.value=d),l.defaultValue=d}C=l.name,C!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,C!==""&&(l.name=C)}function he(l,d,C){(d!=="number"||Ae(l.ownerDocument)!==l)&&(C==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+C&&(l.defaultValue=""+C))}var ke=Array.isArray;function Te(l,d,C,G){if(l=l.options,d){d={};for(var ee=0;ee<C.length;ee++)d["$"+C[ee]]=!0;for(C=0;C<l.length;C++)ee=d.hasOwnProperty("$"+l[C].value),l[C].selected!==ee&&(l[C].selected=ee),ee&&G&&(l[C].defaultSelected=!0)}else{for(C=""+ae(C),d=null,ee=0;ee<l.length;ee++){if(l[ee].value===C){l[ee].selected=!0,G&&(l[ee].defaultSelected=!0);return}d!==null||l[ee].disabled||(d=l[ee])}d!==null&&(d.selected=!0)}}function ve(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(t(91));return V({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Se(l,d){var C=d.value;if(C==null){if(C=d.children,d=d.defaultValue,C!=null){if(d!=null)throw Error(t(92));if(ke(C)){if(1<C.length)throw Error(t(93));C=C[0]}d=C}d==null&&(d=""),C=d}l._wrapperState={initialValue:ae(C)}}function je(l,d){var C=ae(d.value),G=ae(d.defaultValue);C!=null&&(C=""+C,C!==l.value&&(l.value=C),d.defaultValue==null&&l.defaultValue!==C&&(l.defaultValue=C)),G!=null&&(l.defaultValue=""+G)}function Ue(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function ct(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?ct(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var yt,Je=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,C,G,ee){MSApp.execUnsafeLocalFunction(function(){return l(d,C,G,ee)})}:l}(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(yt=yt||document.createElement("div"),yt.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=yt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function lt(l,d){if(d){var C=l.firstChild;if(C&&C===l.lastChild&&C.nodeType===3){C.nodeValue=d;return}}l.textContent=d}var ze={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},kt=["Webkit","ms","Moz","O"];Object.keys(ze).forEach(function(l){kt.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),ze[d]=ze[l]})});function pt(l,d,C){return d==null||typeof d=="boolean"||d===""?"":C||typeof d!="number"||d===0||ze.hasOwnProperty(l)&&ze[l]?(""+d).trim():d+"px"}function Ut(l,d){l=l.style;for(var C in d)if(d.hasOwnProperty(C)){var G=C.indexOf("--")===0,ee=pt(C,d[C],G);C==="float"&&(C="cssFloat"),G?l.setProperty(C,ee):l[C]=ee}}var Ht=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Me(l,d){if(d){if(Ht[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(t(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(t(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(t(61))}if(d.style!=null&&typeof d.style!="object")throw Error(t(62))}}function Oe(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var it=null;function Lt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var At=null,xt=null,Jt=null;function nr(l){if(l=vu(l)){if(typeof At!="function")throw Error(t(280));var d=l.stateNode;d&&(d=_i(d),At(l.stateNode,l.type,d))}}function Rt(l){xt?Jt?Jt.push(l):Jt=[l]:xt=l}function Xt(){if(xt){var l=xt,d=Jt;if(Jt=xt=null,nr(l),d)for(l=0;l<d.length;l++)nr(d[l])}}function Rr(l,d){return l(d)}function Ze(){}var bt=!1;function Vt(l,d,C){if(bt)return l(d,C);bt=!0;try{return Rr(l,d,C)}finally{bt=!1,(xt!==null||Jt!==null)&&(Ze(),Xt())}}function wt(l,d){var C=l.stateNode;if(C===null)return null;var G=_i(C);if(G===null)return null;C=G[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(G=!G.disabled)||(l=l.type,G=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!G;break e;default:l=!1}if(l)return null;if(C&&typeof C!="function")throw Error(t(231,d,typeof C));return C}var Kt=!1;if(s)try{var Yt={};Object.defineProperty(Yt,"passive",{get:function(){Kt=!0}}),window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{Kt=!1}function ut(l,d,C,G,ee,ie,pe,Ne,Be){var at=Array.prototype.slice.call(arguments,3);try{d.apply(C,at)}catch(Ct){this.onError(Ct)}}var St=!1,Et=null,et=!1,qt=null,gt={onError:function(l){St=!0,Et=l}};function Ft(l,d,C,G,ee,ie,pe,Ne,Be){St=!1,Et=null,ut.apply(gt,arguments)}function br(l,d,C,G,ee,ie,pe,Ne,Be){if(Ft.apply(this,arguments),St){if(St){var at=Et;St=!1,Et=null}else throw Error(t(198));et||(et=!0,qt=at)}}function hr(l){var d=l,C=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,(d.flags&4098)!==0&&(C=d.return),l=d.return;while(l)}return d.tag===3?C:null}function Qr(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function Sn(l){if(hr(l)!==l)throw Error(t(188))}function Ni(l){var d=l.alternate;if(!d){if(d=hr(l),d===null)throw Error(t(188));return d!==l?null:l}for(var C=l,G=d;;){var ee=C.return;if(ee===null)break;var ie=ee.alternate;if(ie===null){if(G=ee.return,G!==null){C=G;continue}break}if(ee.child===ie.child){for(ie=ee.child;ie;){if(ie===C)return Sn(ee),l;if(ie===G)return Sn(ee),d;ie=ie.sibling}throw Error(t(188))}if(C.return!==G.return)C=ee,G=ie;else{for(var pe=!1,Ne=ee.child;Ne;){if(Ne===C){pe=!0,C=ee,G=ie;break}if(Ne===G){pe=!0,G=ee,C=ie;break}Ne=Ne.sibling}if(!pe){for(Ne=ie.child;Ne;){if(Ne===C){pe=!0,C=ie,G=ee;break}if(Ne===G){pe=!0,G=ie,C=ee;break}Ne=Ne.sibling}if(!pe)throw Error(t(189))}}if(C.alternate!==G)throw Error(t(190))}if(C.tag!==3)throw Error(t(188));return C.stateNode.current===C?l:d}function Si(l){return l=Ni(l),l!==null?fa(l):null}function fa(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=fa(l);if(d!==null)return d;l=l.sibling}return null}var _s=r.unstable_scheduleCallback,Go=r.unstable_cancelCallback,tu=r.unstable_shouldYield,mc=r.unstable_requestPaint,Fn=r.unstable_now,Bu=r.unstable_getCurrentPriorityLevel,oo=r.unstable_ImmediatePriority,dl=r.unstable_UserBlockingPriority,Vs=r.unstable_NormalPriority,qu=r.unstable_LowPriority,ru=r.unstable_IdlePriority,so=null,gi=null;function Jr(l){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(so,l,void 0,(l.current.flags&128)===128)}catch{}}var Nr=Math.clz32?Math.clz32:Ti,cn=Math.log,vi=Math.LN2;function Ti(l){return l>>>=0,l===0?32:31-(cn(l)/vi|0)|0}var Ia=64,ja=4194304;function oi(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ri(l,d){var C=l.pendingLanes;if(C===0)return 0;var G=0,ee=l.suspendedLanes,ie=l.pingedLanes,pe=C&268435455;if(pe!==0){var Ne=pe&~ee;Ne!==0?G=oi(Ne):(ie&=pe,ie!==0&&(G=oi(ie)))}else pe=C&~ee,pe!==0?G=oi(pe):ie!==0&&(G=oi(ie));if(G===0)return 0;if(d!==0&&d!==G&&(d&ee)===0&&(ee=G&-G,ie=d&-d,ee>=ie||ee===16&&(ie&4194240)!==0))return d;if((G&4)!==0&&(G|=C&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=G;0<d;)C=31-Nr(d),ee=1<<C,G|=l[C],d&=~ee;return G}function pl(l,d){switch(l){case 1:case 2:case 4:return d+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 d+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 ha(l,d){for(var C=l.suspendedLanes,G=l.pingedLanes,ee=l.expirationTimes,ie=l.pendingLanes;0<ie;){var pe=31-Nr(ie),Ne=1<<pe,Be=ee[pe];Be===-1?((Ne&C)===0||(Ne&G)!==0)&&(ee[pe]=pl(Ne,d)):Be<=d&&(l.expiredLanes|=Ne),ie&=~Ne}}function Wo(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function nu(){var l=Ia;return Ia<<=1,(Ia&4194240)===0&&(Ia=64),l}function da(l){for(var d=[],C=0;31>C;C++)d.push(l);return d}function Gs(l,d,C){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Nr(d),l[d]=C}function af(l,d){var C=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var G=l.eventTimes;for(l=l.expirationTimes;0<C;){var ee=31-Nr(C),ie=1<<ee;d[ee]=0,G[ee]=-1,l[ee]=-1,C&=~ie}}function iu(l,d){var C=l.entangledLanes|=d;for(l=l.entanglements;C;){var G=31-Nr(C),ee=1<<G;ee&d|l[G]&d&&(l[G]|=d),C&=~ee}}var Fr=0;function Ss(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Ws,$s,yc,$o,xs,Es=!1,Ps=[],mn=null,Yo=null,Fa=null,Dt=new Map,Ys=new Map,lo=[],Oo="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function zu(l,d){switch(l){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":Yo=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":Dt.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(d.pointerId)}}function Xs(l,d,C,G,ee,ie){return l===null||l.nativeEvent!==ie?(l={blockedOn:d,domEventName:C,eventSystemFlags:G,nativeEvent:ie,targetContainers:[ee]},d!==null&&(d=vu(d),d!==null&&$s(d)),l):(l.eventSystemFlags|=G,d=l.targetContainers,ee!==null&&d.indexOf(ee)===-1&&d.push(ee),l)}function Dn(l,d,C,G,ee){switch(d){case"focusin":return mn=Xs(mn,l,d,C,G,ee),!0;case"dragenter":return Yo=Xs(Yo,l,d,C,G,ee),!0;case"mouseover":return Fa=Xs(Fa,l,d,C,G,ee),!0;case"pointerover":var ie=ee.pointerId;return Dt.set(ie,Xs(Dt.get(ie)||null,l,d,C,G,ee)),!0;case"gotpointercapture":return ie=ee.pointerId,Ys.set(ie,Xs(Ys.get(ie)||null,l,d,C,G,ee)),!0}return!1}function Ks(l){var d=Ns(l.target);if(d!==null){var C=hr(d);if(C!==null){if(d=C.tag,d===13){if(d=Qr(C),d!==null){l.blockedOn=d,xs(l.priority,function(){yc(C)});return}}else if(d===3&&C.stateNode.current.memoizedState.isDehydrated){l.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}l.blockedOn=null}function au(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var C=gl(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(C===null){C=l.nativeEvent;var G=new C.constructor(C.type,C);it=G,C.target.dispatchEvent(G),it=null}else return d=vu(C),d!==null&&$s(d),l.blockedOn=C,!1;d.shift()}return!0}function ou(l,d,C){au(l)&&C.delete(d)}function of(){Es=!1,mn!==null&&au(mn)&&(mn=null),Yo!==null&&au(Yo)&&(Yo=null),Fa!==null&&au(Fa)&&(Fa=null),Dt.forEach(ou),Ys.forEach(ou)}function uo(l,d){l.blockedOn===d&&(l.blockedOn=null,Es||(Es=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,of)))}function si(l){function d(ee){return uo(ee,l)}if(0<Ps.length){uo(Ps[0],l);for(var C=1;C<Ps.length;C++){var G=Ps[C];G.blockedOn===l&&(G.blockedOn=null)}}for(mn!==null&&uo(mn,l),Yo!==null&&uo(Yo,l),Fa!==null&&uo(Fa,l),Dt.forEach(d),Ys.forEach(d),C=0;C<lo.length;C++)G=lo[C],G.blockedOn===l&&(G.blockedOn=null);for(;0<lo.length&&(C=lo[0],C.blockedOn===null);)Ks(C),C.blockedOn===null&&lo.shift()}var Da=m.ReactCurrentBatchConfig,su=!0;function Mi(l,d,C,G){var ee=Fr,ie=Da.transition;Da.transition=null;try{Fr=1,Ao(l,d,C,G)}finally{Fr=ee,Da.transition=ie}}function Ba(l,d,C,G){var ee=Fr,ie=Da.transition;Da.transition=null;try{Fr=4,Ao(l,d,C,G)}finally{Fr=ee,Da.transition=ie}}function Ao(l,d,C,G){if(su){var ee=gl(l,d,C,G);if(ee===null)du(l,d,G,Os,C),zu(l,G);else if(Dn(ee,l,d,C,G))G.stopPropagation();else if(zu(l,G),d&4&&-1<Oo.indexOf(l)){for(;ee!==null;){var ie=vu(ee);if(ie!==null&&Ws(ie),ie=gl(l,d,C,G),ie===null&&du(l,d,G,Os,C),ie===ee)break;ee=ie}ee!==null&&G.stopPropagation()}else du(l,d,G,null,C)}}var Os=null;function gl(l,d,C,G){if(Os=null,l=Lt(G),l=Ns(l),l!==null)if(d=hr(l),d===null)l=null;else if(C=d.tag,C===13){if(l=Qr(d),l!==null)return l;l=null}else if(C===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return Os=l,null}function Uu(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bu()){case oo:return 1;case dl:return 4;case Vs:case qu:return 16;case ru:return 536870912;default:return 16}default:return 16}}var li=null,Ii=null,ji=null;function vl(){if(ji)return ji;var l,d=Ii,C=d.length,G,ee="value"in li?li.value:li.textContent,ie=ee.length;for(l=0;l<C&&d[l]===ee[l];l++);var pe=C-l;for(G=1;G<=pe&&d[C-G]===ee[ie-G];G++);return ji=ee.slice(l,1<G?1-G:void 0)}function xa(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function xn(){return!0}function Fi(){return!1}function En(l){function d(C,G,ee,ie,pe){this._reactName=C,this._targetInst=ee,this.type=G,this.nativeEvent=ie,this.target=pe,this.currentTarget=null;for(var Ne in l)l.hasOwnProperty(Ne)&&(C=l[Ne],this[Ne]=C?C(ie):ie[Ne]);return this.isDefaultPrevented=(ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue===!1)?xn:Fi,this.isPropagationStopped=Fi,this}return V(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),d}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ta=En(ea),qa=V({},ea,{view:0,detail:0}),lu=En(qa),As,Zs,Xn,mi=V({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zt,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Xn&&(Xn&&l.type==="mousemove"?(As=l.screenX-Xn.screenX,Zs=l.screenY-Xn.screenY):Zs=As=0,Xn=l),As)},movementY:function(l){return"movementY"in l?l.movementY:Zs}}),nn=En(mi),Qs=V({},mi,{dataTransfer:0}),za=En(Qs),ml=V({},qa,{relatedTarget:0}),Xo=En(ml),yl=V({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Ko=En(yl),uu=V({},ea,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),K=En(uu),ce=V({},ea,{data:0}),Le=En(ce),Fe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ke={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"},ht={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pt(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=ht[l])?!!d[l]:!1}function zt(){return Pt}var sr=V({},qa,{key:function(l){if(l.key){var d=Fe[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=xa(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Ke[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zt,charCode:function(l){return l.type==="keypress"?xa(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?xa(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),wr=En(sr),mr=V({},mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Or=En(mr),Nn=V({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zt}),Pn=En(Nn),Bn=V({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),ei=En(Bn),ui=V({},mi,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Ua=En(ui),Ea=[9,13,27,32],Pa=s&&"CompositionEvent"in window,Zo=null;s&&"documentMode"in document&&(Zo=document.documentMode);var Qo=s&&"TextEvent"in window&&!Zo,Di=s&&(!Pa||Zo&&8<Zo&&11>=Zo),Ha=" ",Js=!1;function bl(l,d){switch(l){case"keyup":return Ea.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ra(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var an=!1;function el(l,d){switch(l){case"compositionend":return ra(d);case"keypress":return d.which!==32?null:(Js=!0,Ha);case"textInput":return l=d.data,l===Ha&&Js?null:l;default:return null}}function wl(l,d){if(an)return l==="compositionend"||!Pa&&bl(l,d)?(l=vl(),ji=Ii=li=null,an=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Di&&d.locale!=="ko"?null:d.data;default:return null}}var Oa={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 Va(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!Oa[l.type]:d==="textarea"}function xi(l,d,C,G){Rt(G),d=bc(d,"onChange"),0<d.length&&(C=new ta("onChange","change",null,C,G),l.push({event:C,listeners:d}))}var tl=null,co=null;function Hu(l){fu(l,0)}function yi(l){var d=fi(l);if(_e(d))return l}function Bi(l,d){if(l==="change")return d}var Cs=!1;if(s){var Co;if(s){var bi="oninput"in document;if(!bi){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),bi=typeof Jo.oninput=="function"}Co=bi}else Co=!1;Cs=Co&&(!document.documentMode||9<document.documentMode)}function ci(){tl&&(tl.detachEvent("onpropertychange",qi),co=tl=null)}function qi(l){if(l.propertyName==="value"&&yi(co)){var d=[];xi(d,co,l,Lt(l)),Vt(Hu,d)}}function es(l,d,C){l==="focusin"?(ci(),tl=d,co=C,tl.attachEvent("onpropertychange",qi)):l==="focusout"&&ci()}function Xr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return yi(co)}function fo(l,d){if(l==="click")return yi(d)}function rl(l,d){if(l==="input"||l==="change")return yi(d)}function ko(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Dr=typeof Object.is=="function"?Object.is:ko;function Lo(l,d){if(Dr(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var C=Object.keys(l),G=Object.keys(d);if(C.length!==G.length)return!1;for(G=0;G<C.length;G++){var ee=C[G];if(!u.call(d,ee)||!Dr(l[ee],d[ee]))return!1}return!0}function Kn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Mr(l,d){var C=Kn(l);l=0;for(var G;C;){if(C.nodeType===3){if(G=l+C.textContent.length,l<=d&&G>=d)return{node:C,offset:d-l};l=G}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=Kn(C)}}function On(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?On(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Zn(){for(var l=window,d=Ae();d instanceof l.HTMLIFrameElement;){try{var C=typeof d.contentWindow.location.href=="string"}catch{C=!1}if(C)l=d.contentWindow;else break;d=Ae(l.document)}return d}function ts(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function No(l){var d=Zn(),C=l.focusedElem,G=l.selectionRange;if(d!==C&&C&&C.ownerDocument&&On(C.ownerDocument.documentElement,C)){if(G!==null&&ts(C)){if(d=G.start,l=G.end,l===void 0&&(l=d),"selectionStart"in C)C.selectionStart=d,C.selectionEnd=Math.min(l,C.value.length);else if(l=(d=C.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var ee=C.textContent.length,ie=Math.min(G.start,ee);G=G.end===void 0?ie:Math.min(G.end,ee),!l.extend&&ie>G&&(ee=G,G=ie,ie=ee),ee=Mr(C,ie);var pe=Mr(C,G);ee&&pe&&(l.rangeCount!==1||l.anchorNode!==ee.node||l.anchorOffset!==ee.offset||l.focusNode!==pe.node||l.focusOffset!==pe.offset)&&(d=d.createRange(),d.setStart(ee.node,ee.offset),l.removeAllRanges(),ie>G?(l.addRange(d),l.extend(pe.node,pe.offset)):(d.setEnd(pe.node,pe.offset),l.addRange(d)))}}for(d=[],l=C;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<d.length;C++)l=d[C],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var To=s&&"documentMode"in document&&11>=document.documentMode,Ga=null,Tn=null,ho=null,Ro=!1;function Mo(l,d,C){var G=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;Ro||Ga==null||Ga!==Ae(G)||(G=Ga,"selectionStart"in G&&ts(G)?G={start:G.selectionStart,end:G.selectionEnd}:(G=(G.ownerDocument&&G.ownerDocument.defaultView||window).getSelection(),G={anchorNode:G.anchorNode,anchorOffset:G.anchorOffset,focusNode:G.focusNode,focusOffset:G.focusOffset}),ho&&Lo(ho,G)||(ho=G,G=bc(Tn,"onSelect"),0<G.length&&(d=new ta("onSelect","select",null,d,C),l.push({event:d,listeners:G}),d.target=Ga)))}function zi(l,d){var C={};return C[l.toLowerCase()]=d.toLowerCase(),C["Webkit"+l]="webkit"+d,C["Moz"+l]="moz"+d,C}var fn={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionend:zi("Transition","TransitionEnd")},Ei={},on={};s&&(on=document.createElement("div").style,"AnimationEvent"in window||(delete fn.animationend.animation,delete fn.animationiteration.animation,delete fn.animationstart.animation),"TransitionEvent"in window||delete fn.transitionend.transition);function Kr(l){if(Ei[l])return Ei[l];if(!fn[l])return l;var d=fn[l],C;for(C in d)if(d.hasOwnProperty(C)&&C in on)return Ei[l]=d[C];return l}var qn=Kr("animationend"),ti=Kr("animationiteration"),Io=Kr("animationstart"),_l=Kr("transitionend"),nl=new Map,cu="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function jo(l,d){nl.set(l,d),i(d,[l])}for(var Sl=0;Sl<cu.length;Sl++){var wi=cu[Sl],Wa=wi.toLowerCase(),xl=wi[0].toUpperCase()+wi.slice(1);jo(Wa,"on"+xl)}jo(qn,"onAnimationEnd"),jo(ti,"onAnimationIteration"),jo(Io,"onAnimationStart"),jo("dblclick","onDoubleClick"),jo("focusin","onFocus"),jo("focusout","onBlur"),jo(_l,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function El(l,d,C){var G=l.type||"unknown-event";l.currentTarget=C,br(G,d,void 0,l),l.currentTarget=null}function fu(l,d){d=(d&4)!==0;for(var C=0;C<l.length;C++){var G=l[C],ee=G.event;G=G.listeners;e:{var ie=void 0;if(d)for(var pe=G.length-1;0<=pe;pe--){var Ne=G[pe],Be=Ne.instance,at=Ne.currentTarget;if(Ne=Ne.listener,Be!==ie&&ee.isPropagationStopped())break e;El(ee,Ne,at),ie=Be}else for(pe=0;pe<G.length;pe++){if(Ne=G[pe],Be=Ne.instance,at=Ne.currentTarget,Ne=Ne.listener,Be!==ie&&ee.isPropagationStopped())break e;El(ee,Ne,at),ie=Be}}}if(et)throw l=qt,et=!1,qt=null,l}function hn(l,d){var C=d[pa];C===void 0&&(C=d[pa]=new Set);var G=l+"__bubble";C.has(G)||(hu(d,l,2,!1),C.add(G))}function Vu(l,d,C){var G=0;d&&(G|=4),hu(C,l,G,d)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function ks(l){if(!l[Pl]){l[Pl]=!0,n.forEach(function(C){C!=="selectionchange"&&(sf.has(C)||Vu(C,!1,l),Vu(C,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Pl]||(d[Pl]=!0,Vu("selectionchange",!1,d))}}function hu(l,d,C,G){switch(Uu(d)){case 1:var ee=Mi;break;case 4:ee=Ba;break;default:ee=Ao}C=ee.bind(null,d,C,l),ee=void 0,!Kt||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(ee=!0),G?ee!==void 0?l.addEventListener(d,C,{capture:!0,passive:ee}):l.addEventListener(d,C,!0):ee!==void 0?l.addEventListener(d,C,{passive:ee}):l.addEventListener(d,C,!1)}function du(l,d,C,G,ee){var ie=G;if((d&1)===0&&(d&2)===0&&G!==null)e:for(;;){if(G===null)return;var pe=G.tag;if(pe===3||pe===4){var Ne=G.stateNode.containerInfo;if(Ne===ee||Ne.nodeType===8&&Ne.parentNode===ee)break;if(pe===4)for(pe=G.return;pe!==null;){var Be=pe.tag;if((Be===3||Be===4)&&(Be=pe.stateNode.containerInfo,Be===ee||Be.nodeType===8&&Be.parentNode===ee))return;pe=pe.return}for(;Ne!==null;){if(pe=Ns(Ne),pe===null)return;if(Be=pe.tag,Be===5||Be===6){G=ie=pe;continue e}Ne=Ne.parentNode}}G=G.return}Vt(function(){var at=ie,Ct=Lt(C),Nt=[];e:{var Ot=nl.get(l);if(Ot!==void 0){var Zt=ta,ir=l;switch(l){case"keypress":if(xa(C)===0)break e;case"keydown":case"keyup":Zt=wr;break;case"focusin":ir="focus",Zt=Xo;break;case"focusout":ir="blur",Zt=Xo;break;case"beforeblur":case"afterblur":Zt=Xo;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Zt=nn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Zt=za;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Zt=Pn;break;case qn:case ti:case Io:Zt=Ko;break;case _l:Zt=ei;break;case"scroll":Zt=lu;break;case"wheel":Zt=Ua;break;case"copy":case"cut":case"paste":Zt=K;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Zt=Or}var ur=(d&4)!==0,Yi=!ur&&l==="scroll",Qe=ur?Ot!==null?Ot+"Capture":null:Ot;ur=[];for(var Ve=at,tt;Ve!==null;){tt=Ve;var Mt=tt.stateNode;if(tt.tag===5&&Mt!==null&&(tt=Mt,Qe!==null&&(Mt=wt(Ve,Qe),Mt!=null&&ur.push(pu(Ve,Mt,tt)))),Yi)break;Ve=Ve.return}0<ur.length&&(Ot=new Zt(Ot,ir,null,C,Ct),Nt.push({event:Ot,listeners:ur}))}}if((d&7)===0){e:{if(Ot=l==="mouseover"||l==="pointerover",Zt=l==="mouseout"||l==="pointerout",Ot&&C!==it&&(ir=C.relatedTarget||C.fromElement)&&(Ns(ir)||ir[Vi]))break e;if((Zt||Ot)&&(Ot=Ct.window===Ct?Ct:(Ot=Ct.ownerDocument)?Ot.defaultView||Ot.parentWindow:window,Zt?(ir=C.relatedTarget||C.toElement,Zt=at,ir=ir?Ns(ir):null,ir!==null&&(Yi=hr(ir),ir!==Yi||ir.tag!==5&&ir.tag!==6)&&(ir=null)):(Zt=null,ir=at),Zt!==ir)){if(ur=nn,Mt="onMouseLeave",Qe="onMouseEnter",Ve="mouse",(l==="pointerout"||l==="pointerover")&&(ur=Or,Mt="onPointerLeave",Qe="onPointerEnter",Ve="pointer"),Yi=Zt==null?Ot:fi(Zt),tt=ir==null?Ot:fi(ir),Ot=new ur(Mt,Ve+"leave",Zt,C,Ct),Ot.target=Yi,Ot.relatedTarget=tt,Mt=null,Ns(Ct)===at&&(ur=new ur(Qe,Ve+"enter",ir,C,Ct),ur.target=tt,ur.relatedTarget=Yi,Mt=ur),Yi=Mt,Zt&&ir)t:{for(ur=Zt,Qe=ir,Ve=0,tt=ur;tt;tt=il(tt))Ve++;for(tt=0,Mt=Qe;Mt;Mt=il(Mt))tt++;for(;0<Ve-tt;)ur=il(ur),Ve--;for(;0<tt-Ve;)Qe=il(Qe),tt--;for(;Ve--;){if(ur===Qe||Qe!==null&&ur===Qe.alternate)break t;ur=il(ur),Qe=il(Qe)}ur=null}else ur=null;Zt!==null&&Bf(Nt,Ot,Zt,ur,!1),ir!==null&&Yi!==null&&Bf(Nt,Yi,ir,ur,!0)}}e:{if(Ot=at?fi(at):window,Zt=Ot.nodeName&&Ot.nodeName.toLowerCase(),Zt==="select"||Zt==="input"&&Ot.type==="file")var cr=Bi;else if(Va(Ot))if(Cs)cr=rl;else{cr=Xr;var pr=es}else(Zt=Ot.nodeName)&&Zt.toLowerCase()==="input"&&(Ot.type==="checkbox"||Ot.type==="radio")&&(cr=fo);if(cr&&(cr=cr(l,at))){xi(Nt,cr,C,Ct);break e}pr&&pr(l,Ot,at),l==="focusout"&&(pr=Ot._wrapperState)&&pr.controlled&&Ot.type==="number"&&he(Ot,"number",Ot.value)}switch(pr=at?fi(at):window,l){case"focusin":(Va(pr)||pr.contentEditable==="true")&&(Ga=pr,Tn=at,ho=null);break;case"focusout":ho=Tn=Ga=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,Mo(Nt,C,Ct);break;case"selectionchange":if(To)break;case"keydown":case"keyup":Mo(Nt,C,Ct)}var gr;if(Pa)e:{switch(l){case"compositionstart":var Sr="onCompositionStart";break e;case"compositionend":Sr="onCompositionEnd";break e;case"compositionupdate":Sr="onCompositionUpdate";break e}Sr=void 0}else an?bl(l,C)&&(Sr="onCompositionEnd"):l==="keydown"&&C.keyCode===229&&(Sr="onCompositionStart");Sr&&(Di&&C.locale!=="ko"&&(an||Sr!=="onCompositionStart"?Sr==="onCompositionEnd"&&an&&(gr=vl()):(li=Ct,Ii="value"in li?li.value:li.textContent,an=!0)),pr=bc(at,Sr),0<pr.length&&(Sr=new Le(Sr,l,null,C,Ct),Nt.push({event:Sr,listeners:pr}),gr?Sr.data=gr:(gr=ra(C),gr!==null&&(Sr.data=gr)))),(gr=Qo?el(l,C):wl(l,C))&&(at=bc(at,"onBeforeInput"),0<at.length&&(Ct=new Le("onBeforeInput","beforeinput",null,C,Ct),Nt.push({event:Ct,listeners:at}),Ct.data=gr))}fu(Nt,d)})}function pu(l,d,C){return{instance:l,listener:d,currentTarget:C}}function bc(l,d){for(var C=d+"Capture",G=[];l!==null;){var ee=l,ie=ee.stateNode;ee.tag===5&&ie!==null&&(ee=ie,ie=wt(l,C),ie!=null&&G.unshift(pu(l,ie,ee)),ie=wt(l,d),ie!=null&&G.push(pu(l,ie,ee))),l=l.return}return G}function il(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Bf(l,d,C,G,ee){for(var ie=d._reactName,pe=[];C!==null&&C!==G;){var Ne=C,Be=Ne.alternate,at=Ne.stateNode;if(Be!==null&&Be===G)break;Ne.tag===5&&at!==null&&(Ne=at,ee?(Be=wt(C,ie),Be!=null&&pe.unshift(pu(C,Be,Ne))):ee||(Be=wt(C,ie),Be!=null&&pe.push(pu(C,Be,Ne)))),C=C.return}pe.length!==0&&l.push({event:d,listeners:pe})}var qh=/\r\n?/g,qf=/\u0000|\uFFFD/g;function lf(l){return(typeof l=="string"?l:""+l).replace(qh,`
|
|
30
|
+
`).replace(qf,"")}function Gu(l,d,C){if(d=lf(d),lf(l)!==d&&C)throw Error(t(425))}function Ls(){}var Wu=null,Ol=null;function uf(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var $a=typeof setTimeout=="function"?setTimeout:void 0,wc=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,zf=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(l){return $u.resolve(null).then(l).catch(Uf)}:$a;function Uf(l){setTimeout(function(){throw l})}function _c(l,d){var C=d,G=0;do{var ee=C.nextSibling;if(l.removeChild(C),ee&&ee.nodeType===8)if(C=ee.data,C==="/$"){if(G===0){l.removeChild(ee),si(d);return}G--}else C!=="$"&&C!=="$?"&&C!=="$!"||G++;C=ee}while(C);si(d)}function Ui(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function Hi(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var C=l.data;if(C==="$"||C==="$!"||C==="$?"){if(d===0)return l;d--}else C==="/$"&&d++}l=l.previousSibling}return null}var na=Math.random().toString(36).slice(2),po="__reactFiber$"+na,gu="__reactProps$"+na,Vi="__reactContainer$"+na,pa="__reactEvents$"+na,Hf="__reactListeners$"+na,Vf="__reactHandles$"+na;function Ns(l){var d=l[po];if(d)return d;for(var C=l.parentNode;C;){if(d=C[Vi]||C[po]){if(C=d.alternate,d.child!==null||C!==null&&C.child!==null)for(l=Hi(l);l!==null;){if(C=l[po])return C;l=Hi(l)}return d}l=C,C=l.parentNode}return null}function vu(l){return l=l[po]||l[Vi],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function fi(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function _i(l){return l[gu]||null}var Sc=[],rs=-1;function go(l){return{current:l}}function en(l){0>rs||(l.current=Sc[rs],Sc[rs]=null,rs--)}function sn(l,d){rs++,Sc[rs]=l.current,l.current=d}var ns={},Pi=go(ns),ia=go(!1),al=ns;function Al(l,d){var C=l.type.contextTypes;if(!C)return ns;var G=l.stateNode;if(G&&G.__reactInternalMemoizedUnmaskedChildContext===d)return G.__reactInternalMemoizedMaskedChildContext;var ee={},ie;for(ie in C)ee[ie]=d[ie];return G&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=ee),ee}function aa(l){return l=l.childContextTypes,l!=null}function mu(){en(ia),en(Pi)}function cf(l,d,C){if(Pi.current!==ns)throw Error(t(168));sn(Pi,d),sn(ia,C)}function Yu(l,d,C){var G=l.stateNode;if(d=d.childContextTypes,typeof G.getChildContext!="function")return C;G=G.getChildContext();for(var ee in G)if(!(ee in d))throw Error(t(108,Q(l)||"Unknown",ee));return V({},C,G)}function is(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ns,al=Pi.current,sn(Pi,l),sn(ia,ia.current),!0}function Gf(l,d,C){var G=l.stateNode;if(!G)throw Error(t(169));C?(l=Yu(l,d,al),G.__reactInternalMemoizedMergedChildContext=l,en(ia),en(Pi),sn(Pi,l)):en(ia),sn(ia,C)}var as=null,Cl=!1,N=!1;function W(l){as===null?as=[l]:as.push(l)}function re(l){Cl=!0,W(l)}function oe(){if(!N&&as!==null){N=!0;var l=0,d=Fr;try{var C=as;for(Fr=1;l<C.length;l++){var G=C[l];do G=G(!0);while(G!==null)}as=null,Cl=!1}catch(ee){throw as!==null&&(as=as.slice(l+1)),_s(oo,oe),ee}finally{Fr=d,N=!1}}return null}var ue=[],de=0,ge=null,me=0,we=[],Ee=0,De=null,Xe=1,We="";function Ge(l,d){ue[de++]=me,ue[de++]=ge,ge=l,me=d}function _t(l,d,C){we[Ee++]=Xe,we[Ee++]=We,we[Ee++]=De,De=l;var G=Xe;l=We;var ee=32-Nr(G)-1;G&=~(1<<ee),C+=1;var ie=32-Nr(d)+ee;if(30<ie){var pe=ee-ee%5;ie=(G&(1<<pe)-1).toString(32),G>>=pe,ee-=pe,Xe=1<<32-Nr(d)+ee|C<<ee|G,We=ie+l}else Xe=1<<ie|C<<ee|G,We=l}function ot(l){l.return!==null&&(Ge(l,1),_t(l,1,0))}function Ie(l){for(;l===ge;)ge=ue[--de],ue[de]=null,me=ue[--de],ue[de]=null;for(;l===De;)De=we[--Ee],we[Ee]=null,We=we[--Ee],we[Ee]=null,Xe=we[--Ee],we[Ee]=null}var qe=null,He=null,ft=!1,vt=null;function Gt(l,d){var C=ul(5,null,null,0);C.elementType="DELETED",C.stateNode=d,C.return=l,d=l.deletions,d===null?(l.deletions=[C],l.flags|=16):d.push(C)}function Bt(l,d){switch(l.tag){case 5:var C=l.type;return d=d.nodeType!==1||C.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,qe=l,He=Ui(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,qe=l,He=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(C=De!==null?{id:Xe,overflow:We}:null,l.memoizedState={dehydrated:d,treeContext:C,retryLane:1073741824},C=ul(18,null,null,0),C.stateNode=d,C.return=l,l.child=C,qe=l,He=null,!0):!1;default:return!1}}function lr(l){return(l.mode&1)!==0&&(l.flags&128)===0}function jt(l){if(ft){var d=He;if(d){var C=d;if(!Bt(l,d)){if(lr(l))throw Error(t(418));d=Ui(C.nextSibling);var G=qe;d&&Bt(l,d)?Gt(G,C):(l.flags=l.flags&-4097|2,ft=!1,qe=l)}}else{if(lr(l))throw Error(t(418));l.flags=l.flags&-4097|2,ft=!1,qe=l}}}function Br(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;qe=l}function Ur(l){if(l!==qe)return!1;if(!ft)return Br(l),ft=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!uf(l.type,l.memoizedProps)),d&&(d=He)){if(lr(l))throw Ir(),Error(t(418));for(;d;)Gt(l,d),d=Ui(d.nextSibling)}if(Br(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(t(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var C=l.data;if(C==="/$"){if(d===0){He=Ui(l.nextSibling);break e}d--}else C!=="$"&&C!=="$!"&&C!=="$?"||d++}l=l.nextSibling}He=null}}else He=qe?Ui(l.stateNode.nextSibling):null;return!0}function Ir(){for(var l=He;l;)l=Ui(l.nextSibling)}function xr(){He=qe=null,ft=!1}function Zr(l){vt===null?vt=[l]:vt.push(l)}var tn=m.ReactCurrentBatchConfig;function tr(l,d,C){if(l=C.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(t(309));var G=C.stateNode}if(!G)throw Error(t(147,l));var ee=G,ie=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===ie?d.ref:(d=function(pe){var Ne=ee.refs;pe===null?delete Ne[ie]:Ne[ie]=pe},d._stringRef=ie,d)}if(typeof l!="string")throw Error(t(284));if(!C._owner)throw Error(t(290,l))}return l}function Hr(l,d){throw l=Object.prototype.toString.call(d),Error(t(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function Rn(l){var d=l._init;return d(l._payload)}function zn(l){function d(Qe,Ve){if(l){var tt=Qe.deletions;tt===null?(Qe.deletions=[Ve],Qe.flags|=16):tt.push(Ve)}}function C(Qe,Ve){if(!l)return null;for(;Ve!==null;)d(Qe,Ve),Ve=Ve.sibling;return null}function G(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 ee(Qe,Ve){return Qe=jc(Qe,Ve),Qe.index=0,Qe.sibling=null,Qe}function ie(Qe,Ve,tt){return Qe.index=tt,l?(tt=Qe.alternate,tt!==null?(tt=tt.index,tt<Ve?(Qe.flags|=2,Ve):tt):(Qe.flags|=2,Ve)):(Qe.flags|=1048576,Ve)}function pe(Qe){return l&&Qe.alternate===null&&(Qe.flags|=2),Qe}function Ne(Qe,Ve,tt,Mt){return Ve===null||Ve.tag!==6?(Ve=R0(tt,Qe.mode,Mt),Ve.return=Qe,Ve):(Ve=ee(Ve,tt),Ve.return=Qe,Ve)}function Be(Qe,Ve,tt,Mt){var cr=tt.type;return cr===k?Ct(Qe,Ve,tt.props.children,Mt,tt.key):Ve!==null&&(Ve.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===te&&Rn(cr)===Ve.type)?(Mt=ee(Ve,tt.props),Mt.ref=tr(Qe,Ve,tt),Mt.return=Qe,Mt):(Mt=Yp(tt.type,tt.key,tt.props,null,Qe.mode,Mt),Mt.ref=tr(Qe,Ve,tt),Mt.return=Qe,Mt)}function at(Qe,Ve,tt,Mt){return Ve===null||Ve.tag!==4||Ve.stateNode.containerInfo!==tt.containerInfo||Ve.stateNode.implementation!==tt.implementation?(Ve=M0(tt,Qe.mode,Mt),Ve.return=Qe,Ve):(Ve=ee(Ve,tt.children||[]),Ve.return=Qe,Ve)}function Ct(Qe,Ve,tt,Mt,cr){return Ve===null||Ve.tag!==7?(Ve=mf(tt,Qe.mode,Mt,cr),Ve.return=Qe,Ve):(Ve=ee(Ve,tt),Ve.return=Qe,Ve)}function Nt(Qe,Ve,tt){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return Ve=R0(""+Ve,Qe.mode,tt),Ve.return=Qe,Ve;if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case P:return tt=Yp(Ve.type,Ve.key,Ve.props,null,Qe.mode,tt),tt.ref=tr(Qe,null,Ve),tt.return=Qe,tt;case T:return Ve=M0(Ve,Qe.mode,tt),Ve.return=Qe,Ve;case te:var Mt=Ve._init;return Nt(Qe,Mt(Ve._payload),tt)}if(ke(Ve)||$(Ve))return Ve=mf(Ve,Qe.mode,tt,null),Ve.return=Qe,Ve;Hr(Qe,Ve)}return null}function Ot(Qe,Ve,tt,Mt){var cr=Ve!==null?Ve.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number")return cr!==null?null:Ne(Qe,Ve,""+tt,Mt);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case P:return tt.key===cr?Be(Qe,Ve,tt,Mt):null;case T:return tt.key===cr?at(Qe,Ve,tt,Mt):null;case te:return cr=tt._init,Ot(Qe,Ve,cr(tt._payload),Mt)}if(ke(tt)||$(tt))return cr!==null?null:Ct(Qe,Ve,tt,Mt,null);Hr(Qe,tt)}return null}function Zt(Qe,Ve,tt,Mt,cr){if(typeof Mt=="string"&&Mt!==""||typeof Mt=="number")return Qe=Qe.get(tt)||null,Ne(Ve,Qe,""+Mt,cr);if(typeof Mt=="object"&&Mt!==null){switch(Mt.$$typeof){case P:return Qe=Qe.get(Mt.key===null?tt:Mt.key)||null,Be(Ve,Qe,Mt,cr);case T:return Qe=Qe.get(Mt.key===null?tt:Mt.key)||null,at(Ve,Qe,Mt,cr);case te:var pr=Mt._init;return Zt(Qe,Ve,tt,pr(Mt._payload),cr)}if(ke(Mt)||$(Mt))return Qe=Qe.get(tt)||null,Ct(Ve,Qe,Mt,cr,null);Hr(Ve,Mt)}return null}function ir(Qe,Ve,tt,Mt){for(var cr=null,pr=null,gr=Ve,Sr=Ve=0,Na=null;gr!==null&&Sr<tt.length;Sr++){gr.index>Sr?(Na=gr,gr=null):Na=gr.sibling;var gn=Ot(Qe,gr,tt[Sr],Mt);if(gn===null){gr===null&&(gr=Na);break}l&&gr&&gn.alternate===null&&d(Qe,gr),Ve=ie(gn,Ve,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn,gr=Na}if(Sr===tt.length)return C(Qe,gr),ft&&Ge(Qe,Sr),cr;if(gr===null){for(;Sr<tt.length;Sr++)gr=Nt(Qe,tt[Sr],Mt),gr!==null&&(Ve=ie(gr,Ve,Sr),pr===null?cr=gr:pr.sibling=gr,pr=gr);return ft&&Ge(Qe,Sr),cr}for(gr=G(Qe,gr);Sr<tt.length;Sr++)Na=Zt(gr,Qe,Sr,tt[Sr],Mt),Na!==null&&(l&&Na.alternate!==null&&gr.delete(Na.key===null?Sr:Na.key),Ve=ie(Na,Ve,Sr),pr===null?cr=Na:pr.sibling=Na,pr=Na);return l&&gr.forEach(function(Fc){return d(Qe,Fc)}),ft&&Ge(Qe,Sr),cr}function ur(Qe,Ve,tt,Mt){var cr=$(tt);if(typeof cr!="function")throw Error(t(150));if(tt=cr.call(tt),tt==null)throw Error(t(151));for(var pr=cr=null,gr=Ve,Sr=Ve=0,Na=null,gn=tt.next();gr!==null&&!gn.done;Sr++,gn=tt.next()){gr.index>Sr?(Na=gr,gr=null):Na=gr.sibling;var Fc=Ot(Qe,gr,gn.value,Mt);if(Fc===null){gr===null&&(gr=Na);break}l&&gr&&Fc.alternate===null&&d(Qe,gr),Ve=ie(Fc,Ve,Sr),pr===null?cr=Fc:pr.sibling=Fc,pr=Fc,gr=Na}if(gn.done)return C(Qe,gr),ft&&Ge(Qe,Sr),cr;if(gr===null){for(;!gn.done;Sr++,gn=tt.next())gn=Nt(Qe,gn.value,Mt),gn!==null&&(Ve=ie(gn,Ve,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn);return ft&&Ge(Qe,Sr),cr}for(gr=G(Qe,gr);!gn.done;Sr++,gn=tt.next())gn=Zt(gr,Qe,Sr,gn.value,Mt),gn!==null&&(l&&gn.alternate!==null&&gr.delete(gn.key===null?Sr:gn.key),Ve=ie(gn,Ve,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn);return l&&gr.forEach(function(a7){return d(Qe,a7)}),ft&&Ge(Qe,Sr),cr}function Yi(Qe,Ve,tt,Mt){if(typeof tt=="object"&&tt!==null&&tt.type===k&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case P:e:{for(var cr=tt.key,pr=Ve;pr!==null;){if(pr.key===cr){if(cr=tt.type,cr===k){if(pr.tag===7){C(Qe,pr.sibling),Ve=ee(pr,tt.props.children),Ve.return=Qe,Qe=Ve;break e}}else if(pr.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===te&&Rn(cr)===pr.type){C(Qe,pr.sibling),Ve=ee(pr,tt.props),Ve.ref=tr(Qe,pr,tt),Ve.return=Qe,Qe=Ve;break e}C(Qe,pr);break}else d(Qe,pr);pr=pr.sibling}tt.type===k?(Ve=mf(tt.props.children,Qe.mode,Mt,tt.key),Ve.return=Qe,Qe=Ve):(Mt=Yp(tt.type,tt.key,tt.props,null,Qe.mode,Mt),Mt.ref=tr(Qe,Ve,tt),Mt.return=Qe,Qe=Mt)}return pe(Qe);case T:e:{for(pr=tt.key;Ve!==null;){if(Ve.key===pr)if(Ve.tag===4&&Ve.stateNode.containerInfo===tt.containerInfo&&Ve.stateNode.implementation===tt.implementation){C(Qe,Ve.sibling),Ve=ee(Ve,tt.children||[]),Ve.return=Qe,Qe=Ve;break e}else{C(Qe,Ve);break}else d(Qe,Ve);Ve=Ve.sibling}Ve=M0(tt,Qe.mode,Mt),Ve.return=Qe,Qe=Ve}return pe(Qe);case te:return pr=tt._init,Yi(Qe,Ve,pr(tt._payload),Mt)}if(ke(tt))return ir(Qe,Ve,tt,Mt);if($(tt))return ur(Qe,Ve,tt,Mt);Hr(Qe,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"?(tt=""+tt,Ve!==null&&Ve.tag===6?(C(Qe,Ve.sibling),Ve=ee(Ve,tt),Ve.return=Qe,Qe=Ve):(C(Qe,Ve),Ve=R0(tt,Qe.mode,Mt),Ve.return=Qe,Qe=Ve),pe(Qe)):C(Qe,Ve)}return Yi}var hi=zn(!0),Ar=zn(!1),Gi=go(null),An=null,Un=null,di=null;function Oi(){di=Un=An=null}function ga(l){var d=Gi.current;en(Gi),l._currentValue=d}function Ya(l,d,C){for(;l!==null;){var G=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,G!==null&&(G.childLanes|=d)):G!==null&&(G.childLanes&d)!==d&&(G.childLanes|=d),l===C)break;l=l.return}}function wn(l,d){An=l,di=Un=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(le=!0),l.firstContext=null)}function Hn(l){var d=l._currentValue;if(di!==l)if(l={context:l,memoizedValue:d,next:null},Un===null){if(An===null)throw Error(t(308));Un=l,An.dependencies={lanes:0,firstContext:l}}else Un=Un.next=l;return d}var oa=null;function Do(l){oa===null?oa=[l]:oa.push(l)}function vo(l,d,C,G){var ee=d.interleaved;return ee===null?(C.next=C,Do(d)):(C.next=ee.next,ee.next=C),d.interleaved=C,qr(l,G)}function qr(l,d){l.lanes|=d;var C=l.alternate;for(C!==null&&(C.lanes|=d),C=l,l=l.return;l!==null;)l.childLanes|=d,C=l.alternate,C!==null&&(C.childLanes|=d),C=l,l=l.return;return C.tag===3?C.stateNode:null}var mo=!1;function yu(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Xa(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function Aa(l,d,C){var G=l.updateQueue;if(G===null)return null;if(G=G.shared,(un&2)!==0){var ee=G.pending;return ee===null?d.next=d:(d.next=ee.next,ee.next=d),G.pending=d,qr(l,C)}return ee=G.interleaved,ee===null?(d.next=d,Do(G)):(d.next=ee.next,ee.next=d),G.interleaved=d,qr(l,C)}function kl(l,d,C){if(d=d.updateQueue,d!==null&&(d=d.shared,(C&4194240)!==0)){var G=d.lanes;G&=l.pendingLanes,C|=G,d.lanes=C,iu(l,C)}}function va(l,d){var C=l.updateQueue,G=l.alternate;if(G!==null&&(G=G.updateQueue,C===G)){var ee=null,ie=null;if(C=C.firstBaseUpdate,C!==null){do{var pe={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};ie===null?ee=ie=pe:ie=ie.next=pe,C=C.next}while(C!==null);ie===null?ee=ie=d:ie=ie.next=d}else ee=ie=d;C={baseState:G.baseState,firstBaseUpdate:ee,lastBaseUpdate:ie,shared:G.shared,effects:G.effects},l.updateQueue=C;return}l=C.lastBaseUpdate,l===null?C.firstBaseUpdate=d:l.next=d,C.lastBaseUpdate=d}function Bo(l,d,C,G){var ee=l.updateQueue;mo=!1;var ie=ee.firstBaseUpdate,pe=ee.lastBaseUpdate,Ne=ee.shared.pending;if(Ne!==null){ee.shared.pending=null;var Be=Ne,at=Be.next;Be.next=null,pe===null?ie=at:pe.next=at,pe=Be;var Ct=l.alternate;Ct!==null&&(Ct=Ct.updateQueue,Ne=Ct.lastBaseUpdate,Ne!==pe&&(Ne===null?Ct.firstBaseUpdate=at:Ne.next=at,Ct.lastBaseUpdate=Be))}if(ie!==null){var Nt=ee.baseState;pe=0,Ct=at=Be=null,Ne=ie;do{var Ot=Ne.lane,Zt=Ne.eventTime;if((G&Ot)===Ot){Ct!==null&&(Ct=Ct.next={eventTime:Zt,lane:0,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null});e:{var ir=l,ur=Ne;switch(Ot=d,Zt=C,ur.tag){case 1:if(ir=ur.payload,typeof ir=="function"){Nt=ir.call(Zt,Nt,Ot);break e}Nt=ir;break e;case 3:ir.flags=ir.flags&-65537|128;case 0:if(ir=ur.payload,Ot=typeof ir=="function"?ir.call(Zt,Nt,Ot):ir,Ot==null)break e;Nt=V({},Nt,Ot);break e;case 2:mo=!0}}Ne.callback!==null&&Ne.lane!==0&&(l.flags|=64,Ot=ee.effects,Ot===null?ee.effects=[Ne]:Ot.push(Ne))}else Zt={eventTime:Zt,lane:Ot,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null},Ct===null?(at=Ct=Zt,Be=Nt):Ct=Ct.next=Zt,pe|=Ot;if(Ne=Ne.next,Ne===null){if(Ne=ee.shared.pending,Ne===null)break;Ot=Ne,Ne=Ot.next,Ot.next=null,ee.lastBaseUpdate=Ot,ee.shared.pending=null}}while(!0);if(Ct===null&&(Be=Nt),ee.baseState=Be,ee.firstBaseUpdate=at,ee.lastBaseUpdate=Ct,d=ee.shared.interleaved,d!==null){ee=d;do pe|=ee.lane,ee=ee.next;while(ee!==d)}else ie===null&&(ee.shared.lanes=0);df|=pe,l.lanes=pe,l.memoizedState=Nt}}function yn(l,d,C){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var G=l[d],ee=G.callback;if(ee!==null){if(G.callback=null,G=C,typeof ee!="function")throw Error(t(191,ee));ee.call(G)}}}var _r={},rn=go(_r),Cn=go(_r),Mn=go(_r);function ri(l){if(l===_r)throw Error(t(174));return l}function qo(l,d){switch(sn(Mn,d),sn(Cn,l),sn(rn,_r),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:mt(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=mt(d,l)}en(rn),sn(rn,d)}function dn(){en(rn),en(Cn),en(Mn)}function bu(l){ri(Mn.current);var d=ri(rn.current),C=mt(d,l.type);d!==C&&(sn(Cn,l),sn(rn,C))}function Ts(l){Cn.current===l&&(en(rn),en(Cn))}var pn=go(0);function Ka(l){for(var d=l;d!==null;){if(d.tag===13){var C=d.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Ll=[];function sa(){for(var l=0;l<Ll.length;l++)Ll[l]._workInProgressVersionPrimary=null;Ll.length=0}var wu=m.ReactCurrentDispatcher,_u=m.ReactCurrentBatchConfig,Ai=0,ln=null,Vn=null,Gn=null,Za=!1,yo=!1,Qa=0,xc=0;function Wn(){throw Error(t(321))}function Su(l,d){if(d===null)return!1;for(var C=0;C<d.length&&C<l.length;C++)if(!Dr(l[C],d[C]))return!1;return!0}function ol(l,d,C,G,ee,ie){if(Ai=ie,ln=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,wu.current=l===null||l.memoizedState===null?p0:Eu,l=C(G,ee),yo){ie=0;do{if(yo=!1,Qa=0,25<=ie)throw Error(t(301));ie+=1,Gn=Vn=null,d.updateQueue=null,wu.current=$f,l=C(G,ee)}while(yo)}if(wu.current=Ac,d=Vn!==null&&Vn.next!==null,Ai=0,Gn=Vn=ln=null,Za=!1,d)throw Error(t(300));return l}function Ja(){var l=Qa!==0;return Qa=0,l}function _n(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l,Gn}function pi(){if(Vn===null){var l=ln.alternate;l=l!==null?l.memoizedState:null}else l=Vn.next;var d=Gn===null?ln.memoizedState:Gn.next;if(d!==null)Gn=d,Vn=l;else{if(l===null)throw Error(t(310));Vn=l,l={memoizedState:Vn.memoizedState,baseState:Vn.baseState,baseQueue:Vn.baseQueue,queue:Vn.queue,next:null},Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l}return Gn}function la(l,d){return typeof d=="function"?d(l):d}function Wi(l){var d=pi(),C=d.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=l;var G=Vn,ee=G.baseQueue,ie=C.pending;if(ie!==null){if(ee!==null){var pe=ee.next;ee.next=ie.next,ie.next=pe}G.baseQueue=ee=ie,C.pending=null}if(ee!==null){ie=ee.next,G=G.baseState;var Ne=pe=null,Be=null,at=ie;do{var Ct=at.lane;if((Ai&Ct)===Ct)Be!==null&&(Be=Be.next={lane:0,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null}),G=at.hasEagerState?at.eagerState:l(G,at.action);else{var Nt={lane:Ct,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null};Be===null?(Ne=Be=Nt,pe=G):Be=Be.next=Nt,ln.lanes|=Ct,df|=Ct}at=at.next}while(at!==null&&at!==ie);Be===null?pe=G:Be.next=Ne,Dr(G,d.memoizedState)||(le=!0),d.memoizedState=G,d.baseState=pe,d.baseQueue=Be,C.lastRenderedState=G}if(l=C.interleaved,l!==null){ee=l;do ie=ee.lane,ln.lanes|=ie,df|=ie,ee=ee.next;while(ee!==l)}else ee===null&&(C.lanes=0);return[d.memoizedState,C.dispatch]}function Rs(l){var d=pi(),C=d.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=l;var G=C.dispatch,ee=C.pending,ie=d.memoizedState;if(ee!==null){C.pending=null;var pe=ee=ee.next;do ie=l(ie,pe.action),pe=pe.next;while(pe!==ee);Dr(ie,d.memoizedState)||(le=!0),d.memoizedState=ie,d.baseQueue===null&&(d.baseState=ie),C.lastRenderedState=ie}return[ie,G]}function Ec(){}function Ku(l,d){var C=ln,G=pi(),ee=d(),ie=!Dr(G.memoizedState,ee);if(ie&&(G.memoizedState=ee,le=!0),G=G.queue,Oc(ff.bind(null,C,G,l),[l]),G.getSnapshot!==d||ie||Gn!==null&&Gn.memoizedState.tag&1){if(C.flags|=2048,Ca(9,os.bind(null,C,G,ee,d),void 0,null),La===null)throw Error(t(349));(Ai&30)!==0||Wf(C,d,ee)}return ee}function Wf(l,d,C){l.flags|=16384,l={getSnapshot:d,value:C},d=ln.updateQueue,d===null?(d={lastEffect:null,stores:null},ln.updateQueue=d,d.stores=[l]):(C=d.stores,C===null?d.stores=[l]:C.push(l))}function os(l,d,C,G){d.value=C,d.getSnapshot=G,Nl(d)&&xu(l)}function ff(l,d,C){return C(function(){Nl(d)&&xu(l)})}function Nl(l){var d=l.getSnapshot;l=l.value;try{var C=d();return!Dr(l,C)}catch{return!0}}function xu(l){var d=qr(l,1);d!==null&&Il(d,l,1,-1)}function zo(l){var d=_n();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:l},d.queue=l,l=l.dispatch=Mp.bind(null,ln,l),[d.memoizedState,l]}function Ca(l,d,C,G){return l={tag:l,create:d,destroy:C,deps:G,next:null},d=ln.updateQueue,d===null?(d={lastEffect:null,stores:null},ln.updateQueue=d,d.lastEffect=l.next=l):(C=d.lastEffect,C===null?d.lastEffect=l.next=l:(G=C.next,C.next=l,l.next=G,d.lastEffect=l)),l}function ss(){return pi().memoizedState}function eo(l,d,C,G){var ee=_n();ln.flags|=l,ee.memoizedState=Ca(1|d,C,void 0,G===void 0?null:G)}function ls(l,d,C,G){var ee=pi();G=G===void 0?null:G;var ie=void 0;if(Vn!==null){var pe=Vn.memoizedState;if(ie=pe.destroy,G!==null&&Su(G,pe.deps)){ee.memoizedState=Ca(d,C,ie,G);return}}ln.flags|=l,ee.memoizedState=Ca(1|d,C,ie,G)}function Pc(l,d){return eo(8390656,8,l,d)}function Oc(l,d){return ls(2048,8,l,d)}function hf(l,d){return ls(4,2,l,d)}function Zu(l,d){return ls(4,4,l,d)}function us(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Lp(l,d,C){return C=C!=null?C.concat([l]):null,ls(4,4,us.bind(null,d,l),C)}function Tl(){}function zh(l,d){var C=pi();d=d===void 0?null:d;var G=C.memoizedState;return G!==null&&d!==null&&Su(d,G[1])?G[0]:(C.memoizedState=[l,d],l)}function $n(l,d){var C=pi();d=d===void 0?null:d;var G=C.memoizedState;return G!==null&&d!==null&&Su(d,G[1])?G[0]:(l=l(),C.memoizedState=[l,d],l)}function Np(l,d,C){return(Ai&21)===0?(l.baseState&&(l.baseState=!1,le=!0),l.memoizedState=C):(Dr(C,d)||(C=nu(),ln.lanes|=C,df|=C,l.baseState=!0),d)}function Tp(l,d){var C=Fr;Fr=C!==0&&4>C?C:4,l(!0);var G=_u.transition;_u.transition={};try{l(!1),d()}finally{Fr=C,_u.transition=G}}function Rp(){return pi().memoizedState}function d0(l,d,C){var G=Mc(l);if(C={lane:G,action:C,hasEagerState:!1,eagerState:null,next:null},Uh(l))Ip(d,C);else if(C=vo(l,d,C,G),C!==null){var ee=Ho();Il(C,l,G,ee),Uo(C,d,G)}}function Mp(l,d,C){var G=Mc(l),ee={lane:G,action:C,hasEagerState:!1,eagerState:null,next:null};if(Uh(l))Ip(d,ee);else{var ie=l.alternate;if(l.lanes===0&&(ie===null||ie.lanes===0)&&(ie=d.lastRenderedReducer,ie!==null))try{var pe=d.lastRenderedState,Ne=ie(pe,C);if(ee.hasEagerState=!0,ee.eagerState=Ne,Dr(Ne,pe)){var Be=d.interleaved;Be===null?(ee.next=ee,Do(d)):(ee.next=Be.next,Be.next=ee),d.interleaved=ee;return}}catch{}finally{}C=vo(l,d,ee,G),C!==null&&(ee=Ho(),Il(C,l,G,ee),Uo(C,d,G))}}function Uh(l){var d=l.alternate;return l===ln||d!==null&&d===ln}function Ip(l,d){yo=Za=!0;var C=l.pending;C===null?d.next=d:(d.next=C.next,C.next=d),l.pending=d}function Uo(l,d,C){if((C&4194240)!==0){var G=d.lanes;G&=l.pendingLanes,C|=G,d.lanes=C,iu(l,C)}}var Ac={readContext:Hn,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},p0={readContext:Hn,useCallback:function(l,d){return _n().memoizedState=[l,d===void 0?null:d],l},useContext:Hn,useEffect:Pc,useImperativeHandle:function(l,d,C){return C=C!=null?C.concat([l]):null,eo(4194308,4,us.bind(null,d,l),C)},useLayoutEffect:function(l,d){return eo(4194308,4,l,d)},useInsertionEffect:function(l,d){return eo(4,2,l,d)},useMemo:function(l,d){var C=_n();return d=d===void 0?null:d,l=l(),C.memoizedState=[l,d],l},useReducer:function(l,d,C){var G=_n();return d=C!==void 0?C(d):d,G.memoizedState=G.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},G.queue=l,l=l.dispatch=d0.bind(null,ln,l),[G.memoizedState,l]},useRef:function(l){var d=_n();return l={current:l},d.memoizedState=l},useState:zo,useDebugValue:Tl,useDeferredValue:function(l){return _n().memoizedState=l},useTransition:function(){var l=zo(!1),d=l[0];return l=Tp.bind(null,l[1]),_n().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,C){var G=ln,ee=_n();if(ft){if(C===void 0)throw Error(t(407));C=C()}else{if(C=d(),La===null)throw Error(t(349));(Ai&30)!==0||Wf(G,d,C)}ee.memoizedState=C;var ie={value:C,getSnapshot:d};return ee.queue=ie,Pc(ff.bind(null,G,ie,l),[l]),G.flags|=2048,Ca(9,os.bind(null,G,ie,C,d),void 0,null),C},useId:function(){var l=_n(),d=La.identifierPrefix;if(ft){var C=We,G=Xe;C=(G&~(1<<32-Nr(G)-1)).toString(32)+C,d=":"+d+"R"+C,C=Qa++,0<C&&(d+="H"+C.toString(32)),d+=":"}else C=xc++,d=":"+d+"r"+C.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},Eu={readContext:Hn,useCallback:zh,useContext:Hn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:$n,useReducer:Wi,useRef:ss,useState:function(){return Wi(la)},useDebugValue:Tl,useDeferredValue:function(l){var d=pi();return Np(d,Vn.memoizedState,l)},useTransition:function(){var l=Wi(la)[0],d=pi().memoizedState;return[l,d]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1},$f={readContext:Hn,useCallback:zh,useContext:Hn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:$n,useReducer:Rs,useRef:ss,useState:function(){return Rs(la)},useDebugValue:Tl,useDeferredValue:function(l){var d=pi();return Vn===null?d.memoizedState=l:Np(d,Vn.memoizedState,l)},useTransition:function(){var l=Rs(la)[0],d=pi().memoizedState;return[l,d]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1};function ma(l,d){if(l&&l.defaultProps){d=V({},d),l=l.defaultProps;for(var C in l)d[C]===void 0&&(d[C]=l[C]);return d}return d}function Cc(l,d,C,G){d=l.memoizedState,C=C(G,d),C=C==null?d:V({},d,C),l.memoizedState=C,l.lanes===0&&(l.updateQueue.baseState=C)}var kc={isMounted:function(l){return(l=l._reactInternals)?hr(l)===l:!1},enqueueSetState:function(l,d,C){l=l._reactInternals;var G=Ho(),ee=Mc(l),ie=Xa(G,ee);ie.payload=d,C!=null&&(ie.callback=C),d=Aa(l,ie,ee),d!==null&&(Il(d,l,ee,G),kl(d,l,ee))},enqueueReplaceState:function(l,d,C){l=l._reactInternals;var G=Ho(),ee=Mc(l),ie=Xa(G,ee);ie.tag=1,ie.payload=d,C!=null&&(ie.callback=C),d=Aa(l,ie,ee),d!==null&&(Il(d,l,ee,G),kl(d,l,ee))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var C=Ho(),G=Mc(l),ee=Xa(C,G);ee.tag=2,d!=null&&(ee.callback=d),d=Aa(l,ee,G),d!==null&&(Il(d,l,G,C),kl(d,l,G))}};function Yf(l,d,C,G,ee,ie,pe){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(G,ie,pe):d.prototype&&d.prototype.isPureReactComponent?!Lo(C,G)||!Lo(ee,ie):!0}function jp(l,d,C){var G=!1,ee=ns,ie=d.contextType;return typeof ie=="object"&&ie!==null?ie=Hn(ie):(ee=aa(d)?al:Pi.current,G=d.contextTypes,ie=(G=G!=null)?Al(l,ee):ns),d=new d(C,ie),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=kc,l.stateNode=d,d._reactInternals=l,G&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=ee,l.__reactInternalMemoizedMaskedChildContext=ie),d}function Hh(l,d,C,G){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(C,G),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(C,G),d.state!==l&&kc.enqueueReplaceState(d,d.state,null)}function Xf(l,d,C,G){var ee=l.stateNode;ee.props=C,ee.state=l.memoizedState,ee.refs={},yu(l);var ie=d.contextType;typeof ie=="object"&&ie!==null?ee.context=Hn(ie):(ie=aa(d)?al:Pi.current,ee.context=Al(l,ie)),ee.state=l.memoizedState,ie=d.getDerivedStateFromProps,typeof ie=="function"&&(Cc(l,d,ie,C),ee.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof ee.getSnapshotBeforeUpdate=="function"||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(d=ee.state,typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount(),d!==ee.state&&kc.enqueueReplaceState(ee,ee.state,null),Bo(l,C,ee,G),ee.state=l.memoizedState),typeof ee.componentDidMount=="function"&&(l.flags|=4194308)}function Qu(l,d){try{var C="",G=d;do C+=J(G),G=G.return;while(G);var ee=C}catch(ie){ee=`
|
|
31
|
+
Error generating stack: `+ie.message+`
|
|
32
|
+
`+ie.stack}return{value:l,source:d,stack:ee,digest:null}}function Kf(l,d,C){return{value:l,source:null,stack:C??null,digest:d??null}}function Lc(l,d){try{console.error(d.value)}catch(C){setTimeout(function(){throw C})}}var g0=typeof WeakMap=="function"?WeakMap:Map;function Fp(l,d,C){C=Xa(-1,C),C.tag=3,C.payload={element:null};var G=d.value;return C.callback=function(){Up||(Up=!0,P0=G),Lc(l,d)},C}function b(l,d,C){C=Xa(-1,C),C.tag=3;var G=l.type.getDerivedStateFromError;if(typeof G=="function"){var ee=d.value;C.payload=function(){return G(ee)},C.callback=function(){Lc(l,d)}}var ie=l.stateNode;return ie!==null&&typeof ie.componentDidCatch=="function"&&(C.callback=function(){Lc(l,d),typeof G!="function"&&(Tc===null?Tc=new Set([this]):Tc.add(this));var pe=d.stack;this.componentDidCatch(d.value,{componentStack:pe!==null?pe:""})}),C}function x(l,d,C){var G=l.pingCache;if(G===null){G=l.pingCache=new g0;var ee=new Set;G.set(d,ee)}else ee=G.get(d),ee===void 0&&(ee=new Set,G.set(d,ee));ee.has(C)||(ee.add(C),l=Y_.bind(null,l,d,C),d.then(l,l))}function U(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function Z(l,d,C,G,ee){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(d=Xa(-1,1),d.tag=2,Aa(C,d,1))),C.lanes|=1),l):(l.flags|=65536,l.lanes=ee,l)}var ne=m.ReactCurrentOwner,le=!1;function xe(l,d,C,G){d.child=l===null?Ar(d,null,C,G):hi(d,l.child,C,G)}function $e(l,d,C,G,ee){C=C.render;var ie=d.ref;return wn(d,ee),G=ol(l,d,C,G,ie,ee),C=Ja(),l!==null&&!le?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~ee,ka(l,d,ee)):(ft&&C&&ot(d),d.flags|=1,xe(l,d,G,ee),d.child)}function st(l,d,C,G,ee){if(l===null){var ie=C.type;return typeof ie=="function"&&!T0(ie)&&ie.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(d.tag=15,d.type=ie,Tt(l,d,ie,G,ee)):(l=Yp(C.type,null,G,d,d.mode,ee),l.ref=d.ref,l.return=d,d.child=l)}if(ie=l.child,(l.lanes&ee)===0){var pe=ie.memoizedProps;if(C=C.compare,C=C!==null?C:Lo,C(pe,G)&&l.ref===d.ref)return ka(l,d,ee)}return d.flags|=1,l=jc(ie,G),l.ref=d.ref,l.return=d,d.child=l}function Tt(l,d,C,G,ee){if(l!==null){var ie=l.memoizedProps;if(Lo(ie,G)&&l.ref===d.ref)if(le=!1,d.pendingProps=G=ie,(l.lanes&ee)!==0)(l.flags&131072)!==0&&(le=!0);else return d.lanes=l.lanes,ka(l,d,ee)}return Wt(l,d,C,G,ee)}function er(l,d,C){var G=d.pendingProps,ee=G.children,ie=l!==null?l.memoizedState:null;if(G.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(Qf,Ms),Ms|=C;else{if((C&1073741824)===0)return l=ie!==null?ie.baseLanes|C:C,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,sn(Qf,Ms),Ms|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},G=ie!==null?ie.baseLanes:C,sn(Qf,Ms),Ms|=G}else ie!==null?(G=ie.baseLanes|C,d.memoizedState=null):G=C,sn(Qf,Ms),Ms|=G;return xe(l,d,ee,C),d.child}function Er(l,d){var C=d.ref;(l===null&&C!==null||l!==null&&l.ref!==C)&&(d.flags|=512,d.flags|=2097152)}function Wt(l,d,C,G,ee){var ie=aa(C)?al:Pi.current;return ie=Al(d,ie),wn(d,ee),C=ol(l,d,C,G,ie,ee),G=Ja(),l!==null&&!le?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~ee,ka(l,d,ee)):(ft&&G&&ot(d),d.flags|=1,xe(l,d,C,ee),d.child)}function In(l,d,C,G,ee){if(aa(C)){var ie=!0;is(d)}else ie=!1;if(wn(d,ee),d.stateNode===null)Vr(l,d),jp(d,C,G),Xf(d,C,G,ee),G=!0;else if(l===null){var pe=d.stateNode,Ne=d.memoizedProps;pe.props=Ne;var Be=pe.context,at=C.contextType;typeof at=="object"&&at!==null?at=Hn(at):(at=aa(C)?al:Pi.current,at=Al(d,at));var Ct=C.getDerivedStateFromProps,Nt=typeof Ct=="function"||typeof pe.getSnapshotBeforeUpdate=="function";Nt||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Ne!==G||Be!==at)&&Hh(d,pe,G,at),mo=!1;var Ot=d.memoizedState;pe.state=Ot,Bo(d,G,pe,ee),Be=d.memoizedState,Ne!==G||Ot!==Be||ia.current||mo?(typeof Ct=="function"&&(Cc(d,C,Ct,G),Be=d.memoizedState),(Ne=mo||Yf(d,C,Ne,G,Ot,Be,at))?(Nt||typeof pe.UNSAFE_componentWillMount!="function"&&typeof pe.componentWillMount!="function"||(typeof pe.componentWillMount=="function"&&pe.componentWillMount(),typeof pe.UNSAFE_componentWillMount=="function"&&pe.UNSAFE_componentWillMount()),typeof pe.componentDidMount=="function"&&(d.flags|=4194308)):(typeof pe.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=G,d.memoizedState=Be),pe.props=G,pe.state=Be,pe.context=at,G=Ne):(typeof pe.componentDidMount=="function"&&(d.flags|=4194308),G=!1)}else{pe=d.stateNode,Xu(l,d),Ne=d.memoizedProps,at=d.type===d.elementType?Ne:ma(d.type,Ne),pe.props=at,Nt=d.pendingProps,Ot=pe.context,Be=C.contextType,typeof Be=="object"&&Be!==null?Be=Hn(Be):(Be=aa(C)?al:Pi.current,Be=Al(d,Be));var Zt=C.getDerivedStateFromProps;(Ct=typeof Zt=="function"||typeof pe.getSnapshotBeforeUpdate=="function")||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Ne!==Nt||Ot!==Be)&&Hh(d,pe,G,Be),mo=!1,Ot=d.memoizedState,pe.state=Ot,Bo(d,G,pe,ee);var ir=d.memoizedState;Ne!==Nt||Ot!==ir||ia.current||mo?(typeof Zt=="function"&&(Cc(d,C,Zt,G),ir=d.memoizedState),(at=mo||Yf(d,C,at,G,Ot,ir,Be)||!1)?(Ct||typeof pe.UNSAFE_componentWillUpdate!="function"&&typeof pe.componentWillUpdate!="function"||(typeof pe.componentWillUpdate=="function"&&pe.componentWillUpdate(G,ir,Be),typeof pe.UNSAFE_componentWillUpdate=="function"&&pe.UNSAFE_componentWillUpdate(G,ir,Be)),typeof pe.componentDidUpdate=="function"&&(d.flags|=4),typeof pe.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof pe.componentDidUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=1024),d.memoizedProps=G,d.memoizedState=ir),pe.props=G,pe.state=ir,pe.context=Be,G=at):(typeof pe.componentDidUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=1024),G=!1)}return bn(l,d,C,G,ie,ee)}function bn(l,d,C,G,ee,ie){Er(l,d);var pe=(d.flags&128)!==0;if(!G&&!pe)return ee&&Gf(d,C,!1),ka(l,d,ie);G=d.stateNode,ne.current=d;var Ne=pe&&typeof C.getDerivedStateFromError!="function"?null:G.render();return d.flags|=1,l!==null&&pe?(d.child=hi(d,l.child,null,ie),d.child=hi(d,null,Ne,ie)):xe(l,d,Ne,ie),d.memoizedState=G.state,ee&&Gf(d,C,!0),d.child}function to(l){var d=l.stateNode;d.pendingContext?cf(l,d.pendingContext,d.pendingContext!==d.context):d.context&&cf(l,d.context,!1),qo(l,d.containerInfo)}function sl(l,d,C,G,ee){return xr(),Zr(ee),d.flags|=256,xe(l,d,C,G),d.child}var rt={dehydrated:null,treeContext:null,retryLane:0};function Ye(l){return{baseLanes:l,cachePool:null,transitions:null}}function dt(l,d,C){var G=d.pendingProps,ee=pn.current,ie=!1,pe=(d.flags&128)!==0,Ne;if((Ne=pe)||(Ne=l!==null&&l.memoizedState===null?!1:(ee&2)!==0),Ne?(ie=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(ee|=1),sn(pn,ee&1),l===null)return jt(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(pe=G.children,l=G.fallback,ie?(G=d.mode,ie=d.child,pe={mode:"hidden",children:pe},(G&1)===0&&ie!==null?(ie.childLanes=0,ie.pendingProps=pe):ie=Xp(pe,G,0,null),l=mf(l,G,C,null),ie.return=d,l.return=d,ie.sibling=l,d.child=ie,d.child.memoizedState=Ye(C),d.memoizedState=rt,l):$t(d,pe));if(ee=l.memoizedState,ee!==null&&(Ne=ee.dehydrated,Ne!==null))return Tr(l,d,pe,G,Ne,ee,C);if(ie){ie=G.fallback,pe=d.mode,ee=l.child,Ne=ee.sibling;var Be={mode:"hidden",children:G.children};return(pe&1)===0&&d.child!==ee?(G=d.child,G.childLanes=0,G.pendingProps=Be,d.deletions=null):(G=jc(ee,Be),G.subtreeFlags=ee.subtreeFlags&14680064),Ne!==null?ie=jc(Ne,ie):(ie=mf(ie,pe,C,null),ie.flags|=2),ie.return=d,G.return=d,G.sibling=ie,d.child=G,G=ie,ie=d.child,pe=l.child.memoizedState,pe=pe===null?Ye(C):{baseLanes:pe.baseLanes|C,cachePool:null,transitions:pe.transitions},ie.memoizedState=pe,ie.childLanes=l.childLanes&~C,d.memoizedState=rt,G}return ie=l.child,l=ie.sibling,G=jc(ie,{mode:"visible",children:G.children}),(d.mode&1)===0&&(G.lanes=C),G.return=d,G.sibling=null,l!==null&&(C=d.deletions,C===null?(d.deletions=[l],d.flags|=16):C.push(l)),d.child=G,d.memoizedState=null,G}function $t(l,d){return d=Xp({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function dr(l,d,C,G){return G!==null&&Zr(G),hi(d,l.child,null,C),l=$t(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Tr(l,d,C,G,ee,ie,pe){if(C)return d.flags&256?(d.flags&=-257,G=Kf(Error(t(422))),dr(l,d,pe,G)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(ie=G.fallback,ee=d.mode,G=Xp({mode:"visible",children:G.children},ee,0,null),ie=mf(ie,ee,pe,null),ie.flags|=2,G.return=d,ie.return=d,G.sibling=ie,d.child=G,(d.mode&1)!==0&&hi(d,l.child,null,pe),d.child.memoizedState=Ye(pe),d.memoizedState=rt,ie);if((d.mode&1)===0)return dr(l,d,pe,null);if(ee.data==="$!"){if(G=ee.nextSibling&&ee.nextSibling.dataset,G)var Ne=G.dgst;return G=Ne,ie=Error(t(419)),G=Kf(ie,G,void 0),dr(l,d,pe,G)}if(Ne=(pe&l.childLanes)!==0,le||Ne){if(G=La,G!==null){switch(pe&-pe){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&(G.suspendedLanes|pe))!==0?0:ee,ee!==0&&ee!==ie.retryLane&&(ie.retryLane=ee,qr(l,ee),Il(G,l,ee,-1))}return N0(),G=Kf(Error(t(421))),dr(l,d,pe,G)}return ee.data==="$?"?(d.flags|=128,d.child=l.child,d=X_.bind(null,l),ee._reactRetry=d,null):(l=ie.treeContext,He=Ui(ee.nextSibling),qe=d,ft=!0,vt=null,l!==null&&(we[Ee++]=Xe,we[Ee++]=We,we[Ee++]=De,Xe=l.id,We=l.overflow,De=d),d=$t(d,G.children),d.flags|=4096,d)}function Pr(l,d,C){l.lanes|=d;var G=l.alternate;G!==null&&(G.lanes|=d),Ya(l.return,d,C)}function Wr(l,d,C,G,ee){var ie=l.memoizedState;ie===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:G,tail:C,tailMode:ee}:(ie.isBackwards=d,ie.rendering=null,ie.renderingStartTime=0,ie.last=G,ie.tail=C,ie.tailMode=ee)}function $i(l,d,C){var G=d.pendingProps,ee=G.revealOrder,ie=G.tail;if(xe(l,d,G.children,C),G=pn.current,(G&2)!==0)G=G&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Pr(l,C,d);else if(l.tag===19)Pr(l,C,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}G&=1}if(sn(pn,G),(d.mode&1)===0)d.memoizedState=null;else switch(ee){case"forwards":for(C=d.child,ee=null;C!==null;)l=C.alternate,l!==null&&Ka(l)===null&&(ee=C),C=C.sibling;C=ee,C===null?(ee=d.child,d.child=null):(ee=C.sibling,C.sibling=null),Wr(d,!1,ee,C,ie);break;case"backwards":for(C=null,ee=d.child,d.child=null;ee!==null;){if(l=ee.alternate,l!==null&&Ka(l)===null){d.child=ee;break}l=ee.sibling,ee.sibling=C,C=ee,ee=l}Wr(d,!0,C,null,ie);break;case"together":Wr(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Vr(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function ka(l,d,C){if(l!==null&&(d.dependencies=l.dependencies),df|=d.lanes,(C&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(t(153));if(d.child!==null){for(l=d.child,C=jc(l,l.pendingProps),d.child=C,C.return=d;l.sibling!==null;)l=l.sibling,C=C.sibling=jc(l,l.pendingProps),C.return=d;C.sibling=null}return d.child}function v0(l,d,C){switch(d.tag){case 3:to(d),xr();break;case 5:bu(d);break;case 1:aa(d.type)&&is(d);break;case 4:qo(d,d.stateNode.containerInfo);break;case 10:var G=d.type._context,ee=d.memoizedProps.value;sn(Gi,G._currentValue),G._currentValue=ee;break;case 13:if(G=d.memoizedState,G!==null)return G.dehydrated!==null?(sn(pn,pn.current&1),d.flags|=128,null):(C&d.child.childLanes)!==0?dt(l,d,C):(sn(pn,pn.current&1),l=ka(l,d,C),l!==null?l.sibling:null);sn(pn,pn.current&1);break;case 19:if(G=(C&d.childLanes)!==0,(l.flags&128)!==0){if(G)return $i(l,d,C);d.flags|=128}if(ee=d.memoizedState,ee!==null&&(ee.rendering=null,ee.tail=null,ee.lastEffect=null),sn(pn,pn.current),G)break;return null;case 22:case 23:return d.lanes=0,er(l,d,C)}return ka(l,d,C)}var qm,m0,zm,Um;qm=function(l,d){for(var C=d.child;C!==null;){if(C.tag===5||C.tag===6)l.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===d)break;for(;C.sibling===null;){if(C.return===null||C.return===d)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},m0=function(){},zm=function(l,d,C,G){var ee=l.memoizedProps;if(ee!==G){l=d.stateNode,ri(rn.current);var ie=null;switch(C){case"input":ee=Re(l,ee),G=Re(l,G),ie=[];break;case"select":ee=V({},ee,{value:void 0}),G=V({},G,{value:void 0}),ie=[];break;case"textarea":ee=ve(l,ee),G=ve(l,G),ie=[];break;default:typeof ee.onClick!="function"&&typeof G.onClick=="function"&&(l.onclick=Ls)}Me(C,G);var pe;C=null;for(at in ee)if(!G.hasOwnProperty(at)&&ee.hasOwnProperty(at)&&ee[at]!=null)if(at==="style"){var Ne=ee[at];for(pe in Ne)Ne.hasOwnProperty(pe)&&(C||(C={}),C[pe]="")}else at!=="dangerouslySetInnerHTML"&&at!=="children"&&at!=="suppressContentEditableWarning"&&at!=="suppressHydrationWarning"&&at!=="autoFocus"&&(a.hasOwnProperty(at)?ie||(ie=[]):(ie=ie||[]).push(at,null));for(at in G){var Be=G[at];if(Ne=ee?.[at],G.hasOwnProperty(at)&&Be!==Ne&&(Be!=null||Ne!=null))if(at==="style")if(Ne){for(pe in Ne)!Ne.hasOwnProperty(pe)||Be&&Be.hasOwnProperty(pe)||(C||(C={}),C[pe]="");for(pe in Be)Be.hasOwnProperty(pe)&&Ne[pe]!==Be[pe]&&(C||(C={}),C[pe]=Be[pe])}else C||(ie||(ie=[]),ie.push(at,C)),C=Be;else at==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Ne=Ne?Ne.__html:void 0,Be!=null&&Ne!==Be&&(ie=ie||[]).push(at,Be)):at==="children"?typeof Be!="string"&&typeof Be!="number"||(ie=ie||[]).push(at,""+Be):at!=="suppressContentEditableWarning"&&at!=="suppressHydrationWarning"&&(a.hasOwnProperty(at)?(Be!=null&&at==="onScroll"&&hn("scroll",l),ie||Ne===Be||(ie=[])):(ie=ie||[]).push(at,Be))}C&&(ie=ie||[]).push("style",C);var at=ie;(d.updateQueue=at)&&(d.flags|=4)}},Um=function(l,d,C,G){C!==G&&(d.flags|=4)};function Vh(l,d){if(!ft)switch(l.tailMode){case"hidden":d=l.tail;for(var C=null;d!==null;)d.alternate!==null&&(C=d),d=d.sibling;C===null?l.tail=null:C.sibling=null;break;case"collapsed":C=l.tail;for(var G=null;C!==null;)C.alternate!==null&&(G=C),C=C.sibling;G===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:G.sibling=null}}function bo(l){var d=l.alternate!==null&&l.alternate.child===l.child,C=0,G=0;if(d)for(var ee=l.child;ee!==null;)C|=ee.lanes|ee.childLanes,G|=ee.subtreeFlags&14680064,G|=ee.flags&14680064,ee.return=l,ee=ee.sibling;else for(ee=l.child;ee!==null;)C|=ee.lanes|ee.childLanes,G|=ee.subtreeFlags,G|=ee.flags,ee.return=l,ee=ee.sibling;return l.subtreeFlags|=G,l.childLanes=C,d}function D_(l,d,C){var G=d.pendingProps;switch(Ie(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bo(d),null;case 1:return aa(d.type)&&mu(),bo(d),null;case 3:return G=d.stateNode,dn(),en(ia),en(Pi),sa(),G.pendingContext&&(G.context=G.pendingContext,G.pendingContext=null),(l===null||l.child===null)&&(Ur(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,vt!==null&&(C0(vt),vt=null))),m0(l,d),bo(d),null;case 5:Ts(d);var ee=ri(Mn.current);if(C=d.type,l!==null&&d.stateNode!=null)zm(l,d,C,G,ee),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!G){if(d.stateNode===null)throw Error(t(166));return bo(d),null}if(l=ri(rn.current),Ur(d)){G=d.stateNode,C=d.type;var ie=d.memoizedProps;switch(G[po]=d,G[gu]=ie,l=(d.mode&1)!==0,C){case"dialog":hn("cancel",G),hn("close",G);break;case"iframe":case"object":case"embed":hn("load",G);break;case"video":case"audio":for(ee=0;ee<Fo.length;ee++)hn(Fo[ee],G);break;case"source":hn("error",G);break;case"img":case"image":case"link":hn("error",G),hn("load",G);break;case"details":hn("toggle",G);break;case"input":Pe(G,ie),hn("invalid",G);break;case"select":G._wrapperState={wasMultiple:!!ie.multiple},hn("invalid",G);break;case"textarea":Se(G,ie),hn("invalid",G)}Me(C,ie),ee=null;for(var pe in ie)if(ie.hasOwnProperty(pe)){var Ne=ie[pe];pe==="children"?typeof Ne=="string"?G.textContent!==Ne&&(ie.suppressHydrationWarning!==!0&&Gu(G.textContent,Ne,l),ee=["children",Ne]):typeof Ne=="number"&&G.textContent!==""+Ne&&(ie.suppressHydrationWarning!==!0&&Gu(G.textContent,Ne,l),ee=["children",""+Ne]):a.hasOwnProperty(pe)&&Ne!=null&&pe==="onScroll"&&hn("scroll",G)}switch(C){case"input":be(G),Ce(G,ie,!0);break;case"textarea":be(G),Ue(G);break;case"select":case"option":break;default:typeof ie.onClick=="function"&&(G.onclick=Ls)}G=ee,d.updateQueue=G,G!==null&&(d.flags|=4)}else{pe=ee.nodeType===9?ee:ee.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ct(C)),l==="http://www.w3.org/1999/xhtml"?C==="script"?(l=pe.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof G.is=="string"?l=pe.createElement(C,{is:G.is}):(l=pe.createElement(C),C==="select"&&(pe=l,G.multiple?pe.multiple=!0:G.size&&(pe.size=G.size))):l=pe.createElementNS(l,C),l[po]=d,l[gu]=G,qm(l,d,!1,!1),d.stateNode=l;e:{switch(pe=Oe(C,G),C){case"dialog":hn("cancel",l),hn("close",l),ee=G;break;case"iframe":case"object":case"embed":hn("load",l),ee=G;break;case"video":case"audio":for(ee=0;ee<Fo.length;ee++)hn(Fo[ee],l);ee=G;break;case"source":hn("error",l),ee=G;break;case"img":case"image":case"link":hn("error",l),hn("load",l),ee=G;break;case"details":hn("toggle",l),ee=G;break;case"input":Pe(l,G),ee=Re(l,G),hn("invalid",l);break;case"option":ee=G;break;case"select":l._wrapperState={wasMultiple:!!G.multiple},ee=V({},G,{value:void 0}),hn("invalid",l);break;case"textarea":Se(l,G),ee=ve(l,G),hn("invalid",l);break;default:ee=G}Me(C,ee),Ne=ee;for(ie in Ne)if(Ne.hasOwnProperty(ie)){var Be=Ne[ie];ie==="style"?Ut(l,Be):ie==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Be!=null&&Je(l,Be)):ie==="children"?typeof Be=="string"?(C!=="textarea"||Be!=="")&<(l,Be):typeof Be=="number"&<(l,""+Be):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(a.hasOwnProperty(ie)?Be!=null&&ie==="onScroll"&&hn("scroll",l):Be!=null&&p(l,ie,Be,pe))}switch(C){case"input":be(l),Ce(l,G,!1);break;case"textarea":be(l),Ue(l);break;case"option":G.value!=null&&l.setAttribute("value",""+ae(G.value));break;case"select":l.multiple=!!G.multiple,ie=G.value,ie!=null?Te(l,!!G.multiple,ie,!1):G.defaultValue!=null&&Te(l,!!G.multiple,G.defaultValue,!0);break;default:typeof ee.onClick=="function"&&(l.onclick=Ls)}switch(C){case"button":case"input":case"select":case"textarea":G=!!G.autoFocus;break e;case"img":G=!0;break e;default:G=!1}}G&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return bo(d),null;case 6:if(l&&d.stateNode!=null)Um(l,d,l.memoizedProps,G);else{if(typeof G!="string"&&d.stateNode===null)throw Error(t(166));if(C=ri(Mn.current),ri(rn.current),Ur(d)){if(G=d.stateNode,C=d.memoizedProps,G[po]=d,(ie=G.nodeValue!==C)&&(l=qe,l!==null))switch(l.tag){case 3:Gu(G.nodeValue,C,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Gu(G.nodeValue,C,(l.mode&1)!==0)}ie&&(d.flags|=4)}else G=(C.nodeType===9?C:C.ownerDocument).createTextNode(G),G[po]=d,d.stateNode=G}return bo(d),null;case 13:if(en(pn),G=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ft&&He!==null&&(d.mode&1)!==0&&(d.flags&128)===0)Ir(),xr(),d.flags|=98560,ie=!1;else if(ie=Ur(d),G!==null&&G.dehydrated!==null){if(l===null){if(!ie)throw Error(t(318));if(ie=d.memoizedState,ie=ie!==null?ie.dehydrated:null,!ie)throw Error(t(317));ie[po]=d}else xr(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;bo(d),ie=!1}else vt!==null&&(C0(vt),vt=null),ie=!0;if(!ie)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=C,d):(G=G!==null,G!==(l!==null&&l.memoizedState!==null)&&G&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(pn.current&1)!==0?ya===0&&(ya=3):N0())),d.updateQueue!==null&&(d.flags|=4),bo(d),null);case 4:return dn(),m0(l,d),l===null&&ks(d.stateNode.containerInfo),bo(d),null;case 10:return ga(d.type._context),bo(d),null;case 17:return aa(d.type)&&mu(),bo(d),null;case 19:if(en(pn),ie=d.memoizedState,ie===null)return bo(d),null;if(G=(d.flags&128)!==0,pe=ie.rendering,pe===null)if(G)Vh(ie,!1);else{if(ya!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(pe=Ka(l),pe!==null){for(d.flags|=128,Vh(ie,!1),G=pe.updateQueue,G!==null&&(d.updateQueue=G,d.flags|=4),d.subtreeFlags=0,G=C,C=d.child;C!==null;)ie=C,l=G,ie.flags&=14680066,pe=ie.alternate,pe===null?(ie.childLanes=0,ie.lanes=l,ie.child=null,ie.subtreeFlags=0,ie.memoizedProps=null,ie.memoizedState=null,ie.updateQueue=null,ie.dependencies=null,ie.stateNode=null):(ie.childLanes=pe.childLanes,ie.lanes=pe.lanes,ie.child=pe.child,ie.subtreeFlags=0,ie.deletions=null,ie.memoizedProps=pe.memoizedProps,ie.memoizedState=pe.memoizedState,ie.updateQueue=pe.updateQueue,ie.type=pe.type,l=pe.dependencies,ie.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),C=C.sibling;return sn(pn,pn.current&1|2),d.child}l=l.sibling}ie.tail!==null&&Fn()>Jf&&(d.flags|=128,G=!0,Vh(ie,!1),d.lanes=4194304)}else{if(!G)if(l=Ka(pe),l!==null){if(d.flags|=128,G=!0,C=l.updateQueue,C!==null&&(d.updateQueue=C,d.flags|=4),Vh(ie,!0),ie.tail===null&&ie.tailMode==="hidden"&&!pe.alternate&&!ft)return bo(d),null}else 2*Fn()-ie.renderingStartTime>Jf&&C!==1073741824&&(d.flags|=128,G=!0,Vh(ie,!1),d.lanes=4194304);ie.isBackwards?(pe.sibling=d.child,d.child=pe):(C=ie.last,C!==null?C.sibling=pe:d.child=pe,ie.last=pe)}return ie.tail!==null?(d=ie.tail,ie.rendering=d,ie.tail=d.sibling,ie.renderingStartTime=Fn(),d.sibling=null,C=pn.current,sn(pn,G?C&1|2:C&1),d):(bo(d),null);case 22:case 23:return L0(),G=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==G&&(d.flags|=8192),G&&(d.mode&1)!==0?(Ms&1073741824)!==0&&(bo(d),d.subtreeFlags&6&&(d.flags|=8192)):bo(d),null;case 24:return null;case 25:return null}throw Error(t(156,d.tag))}function B_(l,d){switch(Ie(d),d.tag){case 1:return aa(d.type)&&mu(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return dn(),en(ia),en(Pi),sa(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return Ts(d),null;case 13:if(en(pn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(t(340));xr()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return en(pn),null;case 4:return dn(),null;case 10:return ga(d.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var Dp=!1,wo=!1,q_=typeof WeakSet=="function"?WeakSet:Set,rr=null;function Zf(l,d){var C=l.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(G){Ci(l,d,G)}else C.current=null}function y0(l,d,C){try{C()}catch(G){Ci(l,d,G)}}var Hm=!1;function z_(l,d){if(Wu=su,l=Zn(),ts(l)){if("selectionStart"in l)var C={start:l.selectionStart,end:l.selectionEnd};else e:{C=(C=l.ownerDocument)&&C.defaultView||window;var G=C.getSelection&&C.getSelection();if(G&&G.rangeCount!==0){C=G.anchorNode;var ee=G.anchorOffset,ie=G.focusNode;G=G.focusOffset;try{C.nodeType,ie.nodeType}catch{C=null;break e}var pe=0,Ne=-1,Be=-1,at=0,Ct=0,Nt=l,Ot=null;t:for(;;){for(var Zt;Nt!==C||ee!==0&&Nt.nodeType!==3||(Ne=pe+ee),Nt!==ie||G!==0&&Nt.nodeType!==3||(Be=pe+G),Nt.nodeType===3&&(pe+=Nt.nodeValue.length),(Zt=Nt.firstChild)!==null;)Ot=Nt,Nt=Zt;for(;;){if(Nt===l)break t;if(Ot===C&&++at===ee&&(Ne=pe),Ot===ie&&++Ct===G&&(Be=pe),(Zt=Nt.nextSibling)!==null)break;Nt=Ot,Ot=Nt.parentNode}Nt=Zt}C=Ne===-1||Be===-1?null:{start:Ne,end:Be}}else C=null}C=C||{start:0,end:0}}else C=null;for(Ol={focusedElem:l,selectionRange:C},su=!1,rr=d;rr!==null;)if(d=rr,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,rr=l;else for(;rr!==null;){d=rr;try{var ir=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(ir!==null){var ur=ir.memoizedProps,Yi=ir.memoizedState,Qe=d.stateNode,Ve=Qe.getSnapshotBeforeUpdate(d.elementType===d.type?ur:ma(d.type,ur),Yi);Qe.__reactInternalSnapshotBeforeUpdate=Ve}break;case 3:var tt=d.stateNode.containerInfo;tt.nodeType===1?tt.textContent="":tt.nodeType===9&&tt.documentElement&&tt.removeChild(tt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Mt){Ci(d,d.return,Mt)}if(l=d.sibling,l!==null){l.return=d.return,rr=l;break}rr=d.return}return ir=Hm,Hm=!1,ir}function Gh(l,d,C){var G=d.updateQueue;if(G=G!==null?G.lastEffect:null,G!==null){var ee=G=G.next;do{if((ee.tag&l)===l){var ie=ee.destroy;ee.destroy=void 0,ie!==void 0&&y0(d,C,ie)}ee=ee.next}while(ee!==G)}}function Bp(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var C=d=d.next;do{if((C.tag&l)===l){var G=C.create;C.destroy=G()}C=C.next}while(C!==d)}}function b0(l){var d=l.ref;if(d!==null){var C=l.stateNode;switch(l.tag){case 5:l=C;break;default:l=C}typeof d=="function"?d(l):d.current=l}}function Vm(l){var d=l.alternate;d!==null&&(l.alternate=null,Vm(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[po],delete d[gu],delete d[pa],delete d[Hf],delete d[Vf])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Gm(l){return l.tag===5||l.tag===3||l.tag===4}function Wm(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Gm(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function w0(l,d,C){var G=l.tag;if(G===5||G===6)l=l.stateNode,d?C.nodeType===8?C.parentNode.insertBefore(l,d):C.insertBefore(l,d):(C.nodeType===8?(d=C.parentNode,d.insertBefore(l,C)):(d=C,d.appendChild(l)),C=C._reactRootContainer,C!=null||d.onclick!==null||(d.onclick=Ls));else if(G!==4&&(l=l.child,l!==null))for(w0(l,d,C),l=l.sibling;l!==null;)w0(l,d,C),l=l.sibling}function _0(l,d,C){var G=l.tag;if(G===5||G===6)l=l.stateNode,d?C.insertBefore(l,d):C.appendChild(l);else if(G!==4&&(l=l.child,l!==null))for(_0(l,d,C),l=l.sibling;l!==null;)_0(l,d,C),l=l.sibling}var ro=null,Rl=!1;function Nc(l,d,C){for(C=C.child;C!==null;)$m(l,d,C),C=C.sibling}function $m(l,d,C){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(so,C)}catch{}switch(C.tag){case 5:wo||Zf(C,d);case 6:var G=ro,ee=Rl;ro=null,Nc(l,d,C),ro=G,Rl=ee,ro!==null&&(Rl?(l=ro,C=C.stateNode,l.nodeType===8?l.parentNode.removeChild(C):l.removeChild(C)):ro.removeChild(C.stateNode));break;case 18:ro!==null&&(Rl?(l=ro,C=C.stateNode,l.nodeType===8?_c(l.parentNode,C):l.nodeType===1&&_c(l,C),si(l)):_c(ro,C.stateNode));break;case 4:G=ro,ee=Rl,ro=C.stateNode.containerInfo,Rl=!0,Nc(l,d,C),ro=G,Rl=ee;break;case 0:case 11:case 14:case 15:if(!wo&&(G=C.updateQueue,G!==null&&(G=G.lastEffect,G!==null))){ee=G=G.next;do{var ie=ee,pe=ie.destroy;ie=ie.tag,pe!==void 0&&((ie&2)!==0||(ie&4)!==0)&&y0(C,d,pe),ee=ee.next}while(ee!==G)}Nc(l,d,C);break;case 1:if(!wo&&(Zf(C,d),G=C.stateNode,typeof G.componentWillUnmount=="function"))try{G.props=C.memoizedProps,G.state=C.memoizedState,G.componentWillUnmount()}catch(Ne){Ci(C,d,Ne)}Nc(l,d,C);break;case 21:Nc(l,d,C);break;case 22:C.mode&1?(wo=(G=wo)||C.memoizedState!==null,Nc(l,d,C),wo=G):Nc(l,d,C);break;default:Nc(l,d,C)}}function Ym(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var C=l.stateNode;C===null&&(C=l.stateNode=new q_),d.forEach(function(G){var ee=K_.bind(null,l,G);C.has(G)||(C.add(G),G.then(ee,ee))})}}function Ml(l,d){var C=d.deletions;if(C!==null)for(var G=0;G<C.length;G++){var ee=C[G];try{var ie=l,pe=d,Ne=pe;e:for(;Ne!==null;){switch(Ne.tag){case 5:ro=Ne.stateNode,Rl=!1;break e;case 3:ro=Ne.stateNode.containerInfo,Rl=!0;break e;case 4:ro=Ne.stateNode.containerInfo,Rl=!0;break e}Ne=Ne.return}if(ro===null)throw Error(t(160));$m(ie,pe,ee),ro=null,Rl=!1;var Be=ee.alternate;Be!==null&&(Be.return=null),ee.return=null}catch(at){Ci(ee,d,at)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Xm(d,l),d=d.sibling}function Xm(l,d){var C=l.alternate,G=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ml(d,l),Pu(l),G&4){try{Gh(3,l,l.return),Bp(3,l)}catch(ur){Ci(l,l.return,ur)}try{Gh(5,l,l.return)}catch(ur){Ci(l,l.return,ur)}}break;case 1:Ml(d,l),Pu(l),G&512&&C!==null&&Zf(C,C.return);break;case 5:if(Ml(d,l),Pu(l),G&512&&C!==null&&Zf(C,C.return),l.flags&32){var ee=l.stateNode;try{lt(ee,"")}catch(ur){Ci(l,l.return,ur)}}if(G&4&&(ee=l.stateNode,ee!=null)){var ie=l.memoizedProps,pe=C!==null?C.memoizedProps:ie,Ne=l.type,Be=l.updateQueue;if(l.updateQueue=null,Be!==null)try{Ne==="input"&&ie.type==="radio"&&ie.name!=null&&ye(ee,ie),Oe(Ne,pe);var at=Oe(Ne,ie);for(pe=0;pe<Be.length;pe+=2){var Ct=Be[pe],Nt=Be[pe+1];Ct==="style"?Ut(ee,Nt):Ct==="dangerouslySetInnerHTML"?Je(ee,Nt):Ct==="children"?lt(ee,Nt):p(ee,Ct,Nt,at)}switch(Ne){case"input":nt(ee,ie);break;case"textarea":je(ee,ie);break;case"select":var Ot=ee._wrapperState.wasMultiple;ee._wrapperState.wasMultiple=!!ie.multiple;var Zt=ie.value;Zt!=null?Te(ee,!!ie.multiple,Zt,!1):Ot!==!!ie.multiple&&(ie.defaultValue!=null?Te(ee,!!ie.multiple,ie.defaultValue,!0):Te(ee,!!ie.multiple,ie.multiple?[]:"",!1))}ee[gu]=ie}catch(ur){Ci(l,l.return,ur)}}break;case 6:if(Ml(d,l),Pu(l),G&4){if(l.stateNode===null)throw Error(t(162));ee=l.stateNode,ie=l.memoizedProps;try{ee.nodeValue=ie}catch(ur){Ci(l,l.return,ur)}}break;case 3:if(Ml(d,l),Pu(l),G&4&&C!==null&&C.memoizedState.isDehydrated)try{si(d.containerInfo)}catch(ur){Ci(l,l.return,ur)}break;case 4:Ml(d,l),Pu(l);break;case 13:Ml(d,l),Pu(l),ee=l.child,ee.flags&8192&&(ie=ee.memoizedState!==null,ee.stateNode.isHidden=ie,!ie||ee.alternate!==null&&ee.alternate.memoizedState!==null||(E0=Fn())),G&4&&Ym(l);break;case 22:if(Ct=C!==null&&C.memoizedState!==null,l.mode&1?(wo=(at=wo)||Ct,Ml(d,l),wo=at):Ml(d,l),Pu(l),G&8192){if(at=l.memoizedState!==null,(l.stateNode.isHidden=at)&&!Ct&&(l.mode&1)!==0)for(rr=l,Ct=l.child;Ct!==null;){for(Nt=rr=Ct;rr!==null;){switch(Ot=rr,Zt=Ot.child,Ot.tag){case 0:case 11:case 14:case 15:Gh(4,Ot,Ot.return);break;case 1:Zf(Ot,Ot.return);var ir=Ot.stateNode;if(typeof ir.componentWillUnmount=="function"){G=Ot,C=Ot.return;try{d=G,ir.props=d.memoizedProps,ir.state=d.memoizedState,ir.componentWillUnmount()}catch(ur){Ci(G,C,ur)}}break;case 5:Zf(Ot,Ot.return);break;case 22:if(Ot.memoizedState!==null){Qm(Nt);continue}}Zt!==null?(Zt.return=Ot,rr=Zt):Qm(Nt)}Ct=Ct.sibling}e:for(Ct=null,Nt=l;;){if(Nt.tag===5){if(Ct===null){Ct=Nt;try{ee=Nt.stateNode,at?(ie=ee.style,typeof ie.setProperty=="function"?ie.setProperty("display","none","important"):ie.display="none"):(Ne=Nt.stateNode,Be=Nt.memoizedProps.style,pe=Be!=null&&Be.hasOwnProperty("display")?Be.display:null,Ne.style.display=pt("display",pe))}catch(ur){Ci(l,l.return,ur)}}}else if(Nt.tag===6){if(Ct===null)try{Nt.stateNode.nodeValue=at?"":Nt.memoizedProps}catch(ur){Ci(l,l.return,ur)}}else if((Nt.tag!==22&&Nt.tag!==23||Nt.memoizedState===null||Nt===l)&&Nt.child!==null){Nt.child.return=Nt,Nt=Nt.child;continue}if(Nt===l)break e;for(;Nt.sibling===null;){if(Nt.return===null||Nt.return===l)break e;Ct===Nt&&(Ct=null),Nt=Nt.return}Ct===Nt&&(Ct=null),Nt.sibling.return=Nt.return,Nt=Nt.sibling}}break;case 19:Ml(d,l),Pu(l),G&4&&Ym(l);break;case 21:break;default:Ml(d,l),Pu(l)}}function Pu(l){var d=l.flags;if(d&2){try{e:{for(var C=l.return;C!==null;){if(Gm(C)){var G=C;break e}C=C.return}throw Error(t(160))}switch(G.tag){case 5:var ee=G.stateNode;G.flags&32&&(lt(ee,""),G.flags&=-33);var ie=Wm(l);_0(l,ie,ee);break;case 3:case 4:var pe=G.stateNode.containerInfo,Ne=Wm(l);w0(l,Ne,pe);break;default:throw Error(t(161))}}catch(Be){Ci(l,l.return,Be)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function U_(l,d,C){rr=l,Km(l)}function Km(l,d,C){for(var G=(l.mode&1)!==0;rr!==null;){var ee=rr,ie=ee.child;if(ee.tag===22&&G){var pe=ee.memoizedState!==null||Dp;if(!pe){var Ne=ee.alternate,Be=Ne!==null&&Ne.memoizedState!==null||wo;Ne=Dp;var at=wo;if(Dp=pe,(wo=Be)&&!at)for(rr=ee;rr!==null;)pe=rr,Be=pe.child,pe.tag===22&&pe.memoizedState!==null?Jm(ee):Be!==null?(Be.return=pe,rr=Be):Jm(ee);for(;ie!==null;)rr=ie,Km(ie),ie=ie.sibling;rr=ee,Dp=Ne,wo=at}Zm(l)}else(ee.subtreeFlags&8772)!==0&&ie!==null?(ie.return=ee,rr=ie):Zm(l)}}function Zm(l){for(;rr!==null;){var d=rr;if((d.flags&8772)!==0){var C=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:wo||Bp(5,d);break;case 1:var G=d.stateNode;if(d.flags&4&&!wo)if(C===null)G.componentDidMount();else{var ee=d.elementType===d.type?C.memoizedProps:ma(d.type,C.memoizedProps);G.componentDidUpdate(ee,C.memoizedState,G.__reactInternalSnapshotBeforeUpdate)}var ie=d.updateQueue;ie!==null&&yn(d,ie,G);break;case 3:var pe=d.updateQueue;if(pe!==null){if(C=null,d.child!==null)switch(d.child.tag){case 5:C=d.child.stateNode;break;case 1:C=d.child.stateNode}yn(d,pe,C)}break;case 5:var Ne=d.stateNode;if(C===null&&d.flags&4){C=Ne;var Be=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":Be.autoFocus&&C.focus();break;case"img":Be.src&&(C.src=Be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var at=d.alternate;if(at!==null){var Ct=at.memoizedState;if(Ct!==null){var Nt=Ct.dehydrated;Nt!==null&&si(Nt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wo||d.flags&512&&b0(d)}catch(Ot){Ci(d,d.return,Ot)}}if(d===l){rr=null;break}if(C=d.sibling,C!==null){C.return=d.return,rr=C;break}rr=d.return}}function Qm(l){for(;rr!==null;){var d=rr;if(d===l){rr=null;break}var C=d.sibling;if(C!==null){C.return=d.return,rr=C;break}rr=d.return}}function Jm(l){for(;rr!==null;){var d=rr;try{switch(d.tag){case 0:case 11:case 15:var C=d.return;try{Bp(4,d)}catch(Be){Ci(d,C,Be)}break;case 1:var G=d.stateNode;if(typeof G.componentDidMount=="function"){var ee=d.return;try{G.componentDidMount()}catch(Be){Ci(d,ee,Be)}}var ie=d.return;try{b0(d)}catch(Be){Ci(d,ie,Be)}break;case 5:var pe=d.return;try{b0(d)}catch(Be){Ci(d,pe,Be)}}}catch(Be){Ci(d,d.return,Be)}if(d===l){rr=null;break}var Ne=d.sibling;if(Ne!==null){Ne.return=d.return,rr=Ne;break}rr=d.return}}var H_=Math.ceil,qp=m.ReactCurrentDispatcher,S0=m.ReactCurrentOwner,ll=m.ReactCurrentBatchConfig,un=0,La=null,ua=null,no=0,Ms=0,Qf=go(0),ya=0,Wh=null,df=0,zp=0,x0=0,$h=null,cs=null,E0=0,Jf=1/0,Ju=null,Up=!1,P0=null,Tc=null,Hp=!1,Rc=null,Vp=0,Yh=0,O0=null,Gp=-1,Wp=0;function Ho(){return(un&6)!==0?Fn():Gp!==-1?Gp:Gp=Fn()}function Mc(l){return(l.mode&1)===0?1:(un&2)!==0&&no!==0?no&-no:tn.transition!==null?(Wp===0&&(Wp=nu()),Wp):(l=Fr,l!==0||(l=window.event,l=l===void 0?16:Uu(l.type)),l)}function Il(l,d,C,G){if(50<Yh)throw Yh=0,O0=null,Error(t(185));Gs(l,C,G),((un&2)===0||l!==La)&&(l===La&&((un&2)===0&&(zp|=C),ya===4&&Ic(l,no)),fs(l,G),C===1&&un===0&&(d.mode&1)===0&&(Jf=Fn()+500,Cl&&oe()))}function fs(l,d){var C=l.callbackNode;ha(l,d);var G=Ri(l,l===La?no:0);if(G===0)C!==null&&Go(C),l.callbackNode=null,l.callbackPriority=0;else if(d=G&-G,l.callbackPriority!==d){if(C!=null&&Go(C),d===1)l.tag===0?re(ty.bind(null,l)):W(ty.bind(null,l)),zf(function(){(un&6)===0&&oe()}),C=null;else{switch(Ss(G)){case 1:C=oo;break;case 4:C=dl;break;case 16:C=Vs;break;case 536870912:C=ru;break;default:C=Vs}C=uy(C,ey.bind(null,l))}l.callbackPriority=d,l.callbackNode=C}}function ey(l,d){if(Gp=-1,Wp=0,(un&6)!==0)throw Error(t(327));var C=l.callbackNode;if(eh()&&l.callbackNode!==C)return null;var G=Ri(l,l===La?no:0);if(G===0)return null;if((G&30)!==0||(G&l.expiredLanes)!==0||d)d=$p(l,G);else{d=G;var ee=un;un|=2;var ie=ny();(La!==l||no!==d)&&(Ju=null,Jf=Fn()+500,gf(l,d));do try{W_();break}catch(Ne){ry(l,Ne)}while(!0);Oi(),qp.current=ie,un=ee,ua!==null?d=0:(La=null,no=0,d=ya)}if(d!==0){if(d===2&&(ee=Wo(l),ee!==0&&(G=ee,d=A0(l,ee))),d===1)throw C=Wh,gf(l,0),Ic(l,G),fs(l,Fn()),C;if(d===6)Ic(l,G);else{if(ee=l.current.alternate,(G&30)===0&&!V_(ee)&&(d=$p(l,G),d===2&&(ie=Wo(l),ie!==0&&(G=ie,d=A0(l,ie))),d===1))throw C=Wh,gf(l,0),Ic(l,G),fs(l,Fn()),C;switch(l.finishedWork=ee,l.finishedLanes=G,d){case 0:case 1:throw Error(t(345));case 2:vf(l,cs,Ju);break;case 3:if(Ic(l,G),(G&130023424)===G&&(d=E0+500-Fn(),10<d)){if(Ri(l,0)!==0)break;if(ee=l.suspendedLanes,(ee&G)!==G){Ho(),l.pingedLanes|=l.suspendedLanesⅇbreak}l.timeoutHandle=$a(vf.bind(null,l,cs,Ju),d);break}vf(l,cs,Ju);break;case 4:if(Ic(l,G),(G&4194240)===G)break;for(d=l.eventTimes,ee=-1;0<G;){var pe=31-Nr(G);ie=1<<pe,pe=d[pe],pe>ee&&(ee=pe),G&=~ie}if(G=ee,G=Fn()-G,G=(120>G?120:480>G?480:1080>G?1080:1920>G?1920:3e3>G?3e3:4320>G?4320:1960*H_(G/1960))-G,10<G){l.timeoutHandle=$a(vf.bind(null,l,cs,Ju),G);break}vf(l,cs,Ju);break;case 5:vf(l,cs,Ju);break;default:throw Error(t(329))}}}return fs(l,Fn()),l.callbackNode===C?ey.bind(null,l):null}function A0(l,d){var C=$h;return l.current.memoizedState.isDehydrated&&(gf(l,d).flags|=256),l=$p(l,d),l!==2&&(d=cs,cs=C,d!==null&&C0(d)),l}function C0(l){cs===null?cs=l:cs.push.apply(cs,l)}function V_(l){for(var d=l;;){if(d.flags&16384){var C=d.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var G=0;G<C.length;G++){var ee=C[G],ie=ee.getSnapshot;ee=ee.value;try{if(!Dr(ie(),ee))return!1}catch{return!1}}}if(C=d.child,d.subtreeFlags&16384&&C!==null)C.return=d,d=C;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ic(l,d){for(d&=~x0,d&=~zp,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var C=31-Nr(d),G=1<<C;l[C]=-1,d&=~G}}function ty(l){if((un&6)!==0)throw Error(t(327));eh();var d=Ri(l,0);if((d&1)===0)return fs(l,Fn()),null;var C=$p(l,d);if(l.tag!==0&&C===2){var G=Wo(l);G!==0&&(d=G,C=A0(l,G))}if(C===1)throw C=Wh,gf(l,0),Ic(l,d),fs(l,Fn()),C;if(C===6)throw Error(t(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,vf(l,cs,Ju),fs(l,Fn()),null}function k0(l,d){var C=un;un|=1;try{return l(d)}finally{un=C,un===0&&(Jf=Fn()+500,Cl&&oe())}}function pf(l){Rc!==null&&Rc.tag===0&&(un&6)===0&&eh();var d=un;un|=1;var C=ll.transition,G=Fr;try{if(ll.transition=null,Fr=1,l)return l()}finally{Fr=G,ll.transition=C,un=d,(un&6)===0&&oe()}}function L0(){Ms=Qf.current,en(Qf)}function gf(l,d){l.finishedWork=null,l.finishedLanes=0;var C=l.timeoutHandle;if(C!==-1&&(l.timeoutHandle=-1,wc(C)),ua!==null)for(C=ua.return;C!==null;){var G=C;switch(Ie(G),G.tag){case 1:G=G.type.childContextTypes,G!=null&&mu();break;case 3:dn(),en(ia),en(Pi),sa();break;case 5:Ts(G);break;case 4:dn();break;case 13:en(pn);break;case 19:en(pn);break;case 10:ga(G.type._context);break;case 22:case 23:L0()}C=C.return}if(La=l,ua=l=jc(l.current,null),no=Ms=d,ya=0,Wh=null,x0=zp=df=0,cs=$h=null,oa!==null){for(d=0;d<oa.length;d++)if(C=oa[d],G=C.interleaved,G!==null){C.interleaved=null;var ee=G.next,ie=C.pending;if(ie!==null){var pe=ie.next;ie.next=ee,G.next=pe}C.pending=G}oa=null}return l}function ry(l,d){do{var C=ua;try{if(Oi(),wu.current=Ac,Za){for(var G=ln.memoizedState;G!==null;){var ee=G.queue;ee!==null&&(ee.pending=null),G=G.next}Za=!1}if(Ai=0,Gn=Vn=ln=null,yo=!1,Qa=0,S0.current=null,C===null||C.return===null){ya=1,Wh=d,ua=null;break}e:{var ie=l,pe=C.return,Ne=C,Be=d;if(d=no,Ne.flags|=32768,Be!==null&&typeof Be=="object"&&typeof Be.then=="function"){var at=Be,Ct=Ne,Nt=Ct.tag;if((Ct.mode&1)===0&&(Nt===0||Nt===11||Nt===15)){var Ot=Ct.alternate;Ot?(Ct.updateQueue=Ot.updateQueue,Ct.memoizedState=Ot.memoizedState,Ct.lanes=Ot.lanes):(Ct.updateQueue=null,Ct.memoizedState=null)}var Zt=U(pe);if(Zt!==null){Zt.flags&=-257,Z(Zt,pe,Ne,ie,d),Zt.mode&1&&x(ie,at,d),d=Zt,Be=at;var ir=d.updateQueue;if(ir===null){var ur=new Set;ur.add(Be),d.updateQueue=ur}else ir.add(Be);break e}else{if((d&1)===0){x(ie,at,d),N0();break e}Be=Error(t(426))}}else if(ft&&Ne.mode&1){var Yi=U(pe);if(Yi!==null){(Yi.flags&65536)===0&&(Yi.flags|=256),Z(Yi,pe,Ne,ie,d),Zr(Qu(Be,Ne));break e}}ie=Be=Qu(Be,Ne),ya!==4&&(ya=2),$h===null?$h=[ie]:$h.push(ie),ie=pe;do{switch(ie.tag){case 3:ie.flags|=65536,d&=-d,ie.lanes|=d;var Qe=Fp(ie,Be,d);va(ie,Qe);break e;case 1:Ne=Be;var Ve=ie.type,tt=ie.stateNode;if((ie.flags&128)===0&&(typeof Ve.getDerivedStateFromError=="function"||tt!==null&&typeof tt.componentDidCatch=="function"&&(Tc===null||!Tc.has(tt)))){ie.flags|=65536,d&=-d,ie.lanes|=d;var Mt=b(ie,Ne,d);va(ie,Mt);break e}}ie=ie.return}while(ie!==null)}ay(C)}catch(cr){d=cr,ua===C&&C!==null&&(ua=C=C.return);continue}break}while(!0)}function ny(){var l=qp.current;return qp.current=Ac,l===null?Ac:l}function N0(){(ya===0||ya===3||ya===2)&&(ya=4),La===null||(df&268435455)===0&&(zp&268435455)===0||Ic(La,no)}function $p(l,d){var C=un;un|=2;var G=ny();(La!==l||no!==d)&&(Ju=null,gf(l,d));do try{G_();break}catch(ee){ry(l,ee)}while(!0);if(Oi(),un=C,qp.current=G,ua!==null)throw Error(t(261));return La=null,no=0,ya}function G_(){for(;ua!==null;)iy(ua)}function W_(){for(;ua!==null&&!tu();)iy(ua)}function iy(l){var d=ly(l.alternate,l,Ms);l.memoizedProps=l.pendingProps,d===null?ay(l):ua=d,S0.current=null}function ay(l){var d=l;do{var C=d.alternate;if(l=d.return,(d.flags&32768)===0){if(C=D_(C,d,Ms),C!==null){ua=C;return}}else{if(C=B_(C,d),C!==null){C.flags&=32767,ua=C;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ya=6,ua=null;return}}if(d=d.sibling,d!==null){ua=d;return}ua=d=l}while(d!==null);ya===0&&(ya=5)}function vf(l,d,C){var G=Fr,ee=ll.transition;try{ll.transition=null,Fr=1,$_(l,d,C,G)}finally{ll.transition=ee,Fr=G}return null}function $_(l,d,C,G){do eh();while(Rc!==null);if((un&6)!==0)throw Error(t(327));C=l.finishedWork;var ee=l.finishedLanes;if(C===null)return null;if(l.finishedWork=null,l.finishedLanes=0,C===l.current)throw Error(t(177));l.callbackNode=null,l.callbackPriority=0;var ie=C.lanes|C.childLanes;if(af(l,ie),l===La&&(ua=La=null,no=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Hp||(Hp=!0,uy(Vs,function(){return eh(),null})),ie=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||ie){ie=ll.transition,ll.transition=null;var pe=Fr;Fr=1;var Ne=un;un|=4,S0.current=null,z_(l,C),Xm(C,l),No(Ol),su=!!Wu,Ol=Wu=null,l.current=C,U_(C),mc(),un=Ne,Fr=pe,ll.transition=ie}else l.current=C;if(Hp&&(Hp=!1,Rc=l,Vp=ee),ie=l.pendingLanes,ie===0&&(Tc=null),Jr(C.stateNode),fs(l,Fn()),d!==null)for(G=l.onRecoverableError,C=0;C<d.length;C++)ee=d[C],G(ee.value,{componentStack:ee.stack,digest:ee.digest});if(Up)throw Up=!1,l=P0,P0=null,l;return(Vp&1)!==0&&l.tag!==0&&eh(),ie=l.pendingLanes,(ie&1)!==0?l===O0?Yh++:(Yh=0,O0=l):Yh=0,oe(),null}function eh(){if(Rc!==null){var l=Ss(Vp),d=ll.transition,C=Fr;try{if(ll.transition=null,Fr=16>l?16:l,Rc===null)var G=!1;else{if(l=Rc,Rc=null,Vp=0,(un&6)!==0)throw Error(t(331));var ee=un;for(un|=4,rr=l.current;rr!==null;){var ie=rr,pe=ie.child;if((rr.flags&16)!==0){var Ne=ie.deletions;if(Ne!==null){for(var Be=0;Be<Ne.length;Be++){var at=Ne[Be];for(rr=at;rr!==null;){var Ct=rr;switch(Ct.tag){case 0:case 11:case 15:Gh(8,Ct,ie)}var Nt=Ct.child;if(Nt!==null)Nt.return=Ct,rr=Nt;else for(;rr!==null;){Ct=rr;var Ot=Ct.sibling,Zt=Ct.return;if(Vm(Ct),Ct===at){rr=null;break}if(Ot!==null){Ot.return=Zt,rr=Ot;break}rr=Zt}}}var ir=ie.alternate;if(ir!==null){var ur=ir.child;if(ur!==null){ir.child=null;do{var Yi=ur.sibling;ur.sibling=null,ur=Yi}while(ur!==null)}}rr=ie}}if((ie.subtreeFlags&2064)!==0&&pe!==null)pe.return=ie,rr=pe;else e:for(;rr!==null;){if(ie=rr,(ie.flags&2048)!==0)switch(ie.tag){case 0:case 11:case 15:Gh(9,ie,ie.return)}var Qe=ie.sibling;if(Qe!==null){Qe.return=ie.return,rr=Qe;break e}rr=ie.return}}var Ve=l.current;for(rr=Ve;rr!==null;){pe=rr;var tt=pe.child;if((pe.subtreeFlags&2064)!==0&&tt!==null)tt.return=pe,rr=tt;else e:for(pe=Ve;rr!==null;){if(Ne=rr,(Ne.flags&2048)!==0)try{switch(Ne.tag){case 0:case 11:case 15:Bp(9,Ne)}}catch(cr){Ci(Ne,Ne.return,cr)}if(Ne===pe){rr=null;break e}var Mt=Ne.sibling;if(Mt!==null){Mt.return=Ne.return,rr=Mt;break e}rr=Ne.return}}if(un=ee,oe(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(so,l)}catch{}G=!0}return G}finally{Fr=C,ll.transition=d}}return!1}function oy(l,d,C){d=Qu(C,d),d=Fp(l,d,1),l=Aa(l,d,1),d=Ho(),l!==null&&(Gs(l,1,d),fs(l,d))}function Ci(l,d,C){if(l.tag===3)oy(l,l,C);else for(;d!==null;){if(d.tag===3){oy(d,l,C);break}else if(d.tag===1){var G=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof G.componentDidCatch=="function"&&(Tc===null||!Tc.has(G))){l=Qu(C,l),l=b(d,l,1),d=Aa(d,l,1),l=Ho(),d!==null&&(Gs(d,1,l),fs(d,l));break}}d=d.return}}function Y_(l,d,C){var G=l.pingCache;G!==null&&G.delete(d),d=Ho(),l.pingedLanes|=l.suspendedLanes&C,La===l&&(no&C)===C&&(ya===4||ya===3&&(no&130023424)===no&&500>Fn()-E0?gf(l,0):x0|=C),fs(l,d)}function sy(l,d){d===0&&((l.mode&1)===0?d=1:(d=ja,ja<<=1,(ja&130023424)===0&&(ja=4194304)));var C=Ho();l=qr(l,d),l!==null&&(Gs(l,d,C),fs(l,C))}function X_(l){var d=l.memoizedState,C=0;d!==null&&(C=d.retryLane),sy(l,C)}function K_(l,d){var C=0;switch(l.tag){case 13:var G=l.stateNode,ee=l.memoizedState;ee!==null&&(C=ee.retryLane);break;case 19:G=l.stateNode;break;default:throw Error(t(314))}G!==null&&G.delete(d),sy(l,C)}var ly;ly=function(l,d,C){if(l!==null)if(l.memoizedProps!==d.pendingProps||ia.current)le=!0;else{if((l.lanes&C)===0&&(d.flags&128)===0)return le=!1,v0(l,d,C);le=(l.flags&131072)!==0}else le=!1,ft&&(d.flags&1048576)!==0&&_t(d,me,d.index);switch(d.lanes=0,d.tag){case 2:var G=d.type;Vr(l,d),l=d.pendingProps;var ee=Al(d,Pi.current);wn(d,C),ee=ol(null,d,G,l,ee,C);var ie=Ja();return d.flags|=1,typeof ee=="object"&&ee!==null&&typeof ee.render=="function"&&ee.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,aa(G)?(ie=!0,is(d)):ie=!1,d.memoizedState=ee.state!==null&&ee.state!==void 0?ee.state:null,yu(d),ee.updater=kc,d.stateNode=ee,ee._reactInternals=d,Xf(d,G,l,C),d=bn(null,d,G,!0,ie,C)):(d.tag=0,ft&&ie&&ot(d),xe(null,d,ee,C),d=d.child),d;case 16:G=d.elementType;e:{switch(Vr(l,d),l=d.pendingProps,ee=G._init,G=ee(G._payload),d.type=G,ee=d.tag=Q_(G),l=ma(G,l),ee){case 0:d=Wt(null,d,G,l,C);break e;case 1:d=In(null,d,G,l,C);break e;case 11:d=$e(null,d,G,l,C);break e;case 14:d=st(null,d,G,ma(G.type,l),C);break e}throw Error(t(306,G,""))}return d;case 0:return G=d.type,ee=d.pendingProps,ee=d.elementType===G?ee:ma(G,ee),Wt(l,d,G,ee,C);case 1:return G=d.type,ee=d.pendingProps,ee=d.elementType===G?ee:ma(G,ee),In(l,d,G,ee,C);case 3:e:{if(to(d),l===null)throw Error(t(387));G=d.pendingProps,ie=d.memoizedState,ee=ie.element,Xu(l,d),Bo(d,G,null,C);var pe=d.memoizedState;if(G=pe.element,ie.isDehydrated)if(ie={element:G,isDehydrated:!1,cache:pe.cache,pendingSuspenseBoundaries:pe.pendingSuspenseBoundaries,transitions:pe.transitions},d.updateQueue.baseState=ie,d.memoizedState=ie,d.flags&256){ee=Qu(Error(t(423)),d),d=sl(l,d,G,C,ee);break e}else if(G!==ee){ee=Qu(Error(t(424)),d),d=sl(l,d,G,C,ee);break e}else for(He=Ui(d.stateNode.containerInfo.firstChild),qe=d,ft=!0,vt=null,C=Ar(d,null,G,C),d.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(xr(),G===ee){d=ka(l,d,C);break e}xe(l,d,G,C)}d=d.child}return d;case 5:return bu(d),l===null&&jt(d),G=d.type,ee=d.pendingProps,ie=l!==null?l.memoizedProps:null,pe=ee.children,uf(G,ee)?pe=null:ie!==null&&uf(G,ie)&&(d.flags|=32),Er(l,d),xe(l,d,pe,C),d.child;case 6:return l===null&&jt(d),null;case 13:return dt(l,d,C);case 4:return qo(d,d.stateNode.containerInfo),G=d.pendingProps,l===null?d.child=hi(d,null,G,C):xe(l,d,G,C),d.child;case 11:return G=d.type,ee=d.pendingProps,ee=d.elementType===G?ee:ma(G,ee),$e(l,d,G,ee,C);case 7:return xe(l,d,d.pendingProps,C),d.child;case 8:return xe(l,d,d.pendingProps.children,C),d.child;case 12:return xe(l,d,d.pendingProps.children,C),d.child;case 10:e:{if(G=d.type._context,ee=d.pendingProps,ie=d.memoizedProps,pe=ee.value,sn(Gi,G._currentValue),G._currentValue=pe,ie!==null)if(Dr(ie.value,pe)){if(ie.children===ee.children&&!ia.current){d=ka(l,d,C);break e}}else for(ie=d.child,ie!==null&&(ie.return=d);ie!==null;){var Ne=ie.dependencies;if(Ne!==null){pe=ie.child;for(var Be=Ne.firstContext;Be!==null;){if(Be.context===G){if(ie.tag===1){Be=Xa(-1,C&-C),Be.tag=2;var at=ie.updateQueue;if(at!==null){at=at.shared;var Ct=at.pending;Ct===null?Be.next=Be:(Be.next=Ct.next,Ct.next=Be),at.pending=Be}}ie.lanes|=C,Be=ie.alternate,Be!==null&&(Be.lanes|=C),Ya(ie.return,C,d),Ne.lanes|=C;break}Be=Be.next}}else if(ie.tag===10)pe=ie.type===d.type?null:ie.child;else if(ie.tag===18){if(pe=ie.return,pe===null)throw Error(t(341));pe.lanes|=C,Ne=pe.alternate,Ne!==null&&(Ne.lanes|=C),Ya(pe,C,d),pe=ie.sibling}else pe=ie.child;if(pe!==null)pe.return=ie;else for(pe=ie;pe!==null;){if(pe===d){pe=null;break}if(ie=pe.sibling,ie!==null){ie.return=pe.return,pe=ie;break}pe=pe.return}ie=pe}xe(l,d,ee.children,C),d=d.child}return d;case 9:return ee=d.type,G=d.pendingProps.children,wn(d,C),ee=Hn(ee),G=G(ee),d.flags|=1,xe(l,d,G,C),d.child;case 14:return G=d.type,ee=ma(G,d.pendingProps),ee=ma(G.type,ee),st(l,d,G,ee,C);case 15:return Tt(l,d,d.type,d.pendingProps,C);case 17:return G=d.type,ee=d.pendingProps,ee=d.elementType===G?ee:ma(G,ee),Vr(l,d),d.tag=1,aa(G)?(l=!0,is(d)):l=!1,wn(d,C),jp(d,G,ee),Xf(d,G,ee,C),bn(null,d,G,!0,l,C);case 19:return $i(l,d,C);case 22:return er(l,d,C)}throw Error(t(156,d.tag))};function uy(l,d){return _s(l,d)}function Z_(l,d,C,G){this.tag=l,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=G,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ul(l,d,C,G){return new Z_(l,d,C,G)}function T0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Q_(l){if(typeof l=="function")return T0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===O)return 11;if(l===D)return 14}return 2}function jc(l,d){var C=l.alternate;return C===null?(C=ul(l.tag,d,l.key,l.mode),C.elementType=l.elementType,C.type=l.type,C.stateNode=l.stateNode,C.alternate=l,l.alternate=C):(C.pendingProps=d,C.type=l.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=l.flags&14680064,C.childLanes=l.childLanes,C.lanes=l.lanes,C.child=l.child,C.memoizedProps=l.memoizedProps,C.memoizedState=l.memoizedState,C.updateQueue=l.updateQueue,d=l.dependencies,C.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},C.sibling=l.sibling,C.index=l.index,C.ref=l.ref,C}function Yp(l,d,C,G,ee,ie){var pe=2;if(G=l,typeof l=="function")T0(l)&&(pe=1);else if(typeof l=="string")pe=5;else e:switch(l){case k:return mf(C.children,ee,ie,d);case L:pe=8,ee|=8;break;case I:return l=ul(12,C,d,ee|2),l.elementType=I,l.lanes=ie,l;case M:return l=ul(13,C,d,ee),l.elementType=M,l.lanes=ie,l;case q:return l=ul(19,C,d,ee),l.elementType=q,l.lanes=ie,l;case H:return Xp(C,ee,ie,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case R:pe=10;break e;case A:pe=9;break e;case O:pe=11;break e;case D:pe=14;break e;case te:pe=16,G=null;break e}throw Error(t(130,l==null?l:typeof l,""))}return d=ul(pe,C,d,ee),d.elementType=l,d.type=G,d.lanes=ie,d}function mf(l,d,C,G){return l=ul(7,l,G,d),l.lanes=C,l}function Xp(l,d,C,G){return l=ul(22,l,G,d),l.elementType=H,l.lanes=C,l.stateNode={isHidden:!1},l}function R0(l,d,C){return l=ul(6,l,null,d),l.lanes=C,l}function M0(l,d,C){return d=ul(4,l.children!==null?l.children:[],l.key,d),d.lanes=C,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function J_(l,d,C,G,ee){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=da(0),this.expirationTimes=da(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.identifierPrefix=G,this.onRecoverableError=ee,this.mutableSourceEagerHydrationData=null}function I0(l,d,C,G,ee,ie,pe,Ne,Be){return l=new J_(l,d,C,Ne,Be),d===1?(d=1,ie===!0&&(d|=8)):d=0,ie=ul(3,null,null,d),l.current=ie,ie.stateNode=l,ie.memoizedState={element:G,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},yu(ie),l}function e7(l,d,C){var G=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:G==null?null:""+G,children:l,containerInfo:d,implementation:C}}function cy(l){if(!l)return ns;l=l._reactInternals;e:{if(hr(l)!==l||l.tag!==1)throw Error(t(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(aa(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(t(171))}if(l.tag===1){var C=l.type;if(aa(C))return Yu(l,C,d)}return d}function fy(l,d,C,G,ee,ie,pe,Ne,Be){return l=I0(C,G,!0,l,ee,ie,pe,Ne,Be),l.context=cy(null),C=l.current,G=Ho(),ee=Mc(C),ie=Xa(G,ee),ie.callback=d??null,Aa(C,ie,ee),l.current.lanes=ee,Gs(l,ee,G),fs(l,G),l}function Kp(l,d,C,G){var ee=d.current,ie=Ho(),pe=Mc(ee);return C=cy(C),d.context===null?d.context=C:d.pendingContext=C,d=Xa(ie,pe),d.payload={element:l},G=G===void 0?null:G,G!==null&&(d.callback=G),l=Aa(ee,d,pe),l!==null&&(Il(l,ee,pe,ie),kl(l,ee,pe)),pe}function Zp(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function hy(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var C=l.retryLane;l.retryLane=C!==0&&C<d?C:d}}function j0(l,d){hy(l,d),(l=l.alternate)&&hy(l,d)}function t7(){return null}var dy=typeof reportError=="function"?reportError:function(l){console.error(l)};function F0(l){this._internalRoot=l}Qp.prototype.render=F0.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(t(409));Kp(l,d,null,null)},Qp.prototype.unmount=F0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;pf(function(){Kp(null,l,null,null)}),d[Vi]=null}};function Qp(l){this._internalRoot=l}Qp.prototype.unstable_scheduleHydration=function(l){if(l){var d=$o();l={blockedOn:null,target:l,priority:d};for(var C=0;C<lo.length&&d!==0&&d<lo[C].priority;C++);lo.splice(C,0,l),C===0&&Ks(l)}};function D0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Jp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function py(){}function r7(l,d,C,G,ee){if(ee){if(typeof G=="function"){var ie=G;G=function(){var at=Zp(pe);ie.call(at)}}var pe=fy(d,G,l,0,null,!1,!1,"",py);return l._reactRootContainer=pe,l[Vi]=pe.current,ks(l.nodeType===8?l.parentNode:l),pf(),pe}for(;ee=l.lastChild;)l.removeChild(ee);if(typeof G=="function"){var Ne=G;G=function(){var at=Zp(Be);Ne.call(at)}}var Be=I0(l,0,!1,null,null,!1,!1,"",py);return l._reactRootContainer=Be,l[Vi]=Be.current,ks(l.nodeType===8?l.parentNode:l),pf(function(){Kp(d,Be,C,G)}),Be}function e1(l,d,C,G,ee){var ie=C._reactRootContainer;if(ie){var pe=ie;if(typeof ee=="function"){var Ne=ee;ee=function(){var Be=Zp(pe);Ne.call(Be)}}Kp(d,pe,l,ee)}else pe=r7(C,d,l,ee,G);return Zp(pe)}Ws=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var C=oi(d.pendingLanes);C!==0&&(iu(d,C|1),fs(d,Fn()),(un&6)===0&&(Jf=Fn()+500,oe()))}break;case 13:pf(function(){var G=qr(l,1);if(G!==null){var ee=Ho();Il(G,l,1,ee)}}),j0(l,1)}},$s=function(l){if(l.tag===13){var d=qr(l,134217728);if(d!==null){var C=Ho();Il(d,l,134217728,C)}j0(l,134217728)}},yc=function(l){if(l.tag===13){var d=Mc(l),C=qr(l,d);if(C!==null){var G=Ho();Il(C,l,d,G)}j0(l,d)}},$o=function(){return Fr},xs=function(l,d){var C=Fr;try{return Fr=l,d()}finally{Fr=C}},At=function(l,d,C){switch(d){case"input":if(nt(l,C),d=C.name,C.type==="radio"&&d!=null){for(C=l;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<C.length;d++){var G=C[d];if(G!==l&&G.form===l.form){var ee=_i(G);if(!ee)throw Error(t(90));_e(G),nt(G,ee)}}}break;case"textarea":je(l,C);break;case"select":d=C.value,d!=null&&Te(l,!!C.multiple,d,!1)}},Rr=k0,Ze=pf;var n7={usingClientEntryPoint:!1,Events:[vu,fi,_i,Rt,Xt,k0]},Xh={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},i7={bundleType:Xh.bundleType,version:Xh.version,rendererPackageName:Xh.rendererPackageName,rendererConfig:Xh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:m.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Si(l),l===null?null:l.stateNode},findFiberByHostInstance:Xh.findFiberByHostInstance||t7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var t1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t1.isDisabled&&t1.supportsFiber)try{so=t1.inject(i7),gi=t1}catch{}}return hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n7,hs.createPortal=function(l,d){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!D0(d))throw Error(t(200));return e7(l,d,null,C)},hs.createRoot=function(l,d){if(!D0(l))throw Error(t(299));var C=!1,G="",ee=dy;return d!=null&&(d.unstable_strictMode===!0&&(C=!0),d.identifierPrefix!==void 0&&(G=d.identifierPrefix),d.onRecoverableError!==void 0&&(ee=d.onRecoverableError)),d=I0(l,1,!1,null,null,C,!1,G,ee),l[Vi]=d.current,ks(l.nodeType===8?l.parentNode:l),new F0(d)},hs.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(t(188)):(l=Object.keys(l).join(","),Error(t(268,l)));return l=Si(d),l=l===null?null:l.stateNode,l},hs.flushSync=function(l){return pf(l)},hs.hydrate=function(l,d,C){if(!Jp(d))throw Error(t(200));return e1(null,l,d,!0,C)},hs.hydrateRoot=function(l,d,C){if(!D0(l))throw Error(t(405));var G=C!=null&&C.hydratedSources||null,ee=!1,ie="",pe=dy;if(C!=null&&(C.unstable_strictMode===!0&&(ee=!0),C.identifierPrefix!==void 0&&(ie=C.identifierPrefix),C.onRecoverableError!==void 0&&(pe=C.onRecoverableError)),d=fy(d,null,l,1,C??null,ee,!1,ie,pe),l[Vi]=d.current,ks(l),G)for(l=0;l<G.length;l++)C=G[l],ee=C._getVersion,ee=ee(C._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[C,ee]:d.mutableSourceEagerHydrationData.push(C,ee);return new Qp(d)},hs.render=function(l,d,C){if(!Jp(d))throw Error(t(200));return e1(null,l,d,!1,C)},hs.unmountComponentAtNode=function(l){if(!Jp(l))throw Error(t(40));return l._reactRootContainer?(pf(function(){e1(null,null,l,!1,function(){l._reactRootContainer=null,l[Vi]=null})}),!0):!1},hs.unstable_batchedUpdates=k0,hs.unstable_renderSubtreeIntoContainer=function(l,d,C,G){if(!Jp(C))throw Error(t(200));if(l==null||l._reactInternals===void 0)throw Error(t(38));return e1(l,d,C,!1,G)},hs.version="18.3.1-next-f1338f8080-20240426",hs}var wy;function vw(){if(wy)return q0.exports;wy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),q0.exports=l7(),q0.exports}var _y;function u7(){if(_y)return r1;_y=1;var e=vw();return r1.createRoot=e.createRoot,r1.hydrateRoot=e.hydrateRoot,r1}var c7=u7();const mw=yp(c7);var Kh={};function kr(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var f7={};function q1(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:f7}var yw=Object.assign,P1=Object.getOwnPropertyDescriptor,Nu=Object.defineProperty,bp=Object.prototype,d2=[];Object.freeze(d2);var z2={};Object.freeze(z2);var h7=typeof Proxy<"u",d7=Object.toString();function bw(){h7||kr("Proxy not available")}function ww(e){var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}}var ch=function(){};function qs(e){return typeof e=="function"}function Af(e){var r=typeof e;switch(r){case"string":case"symbol":case"number":return!0}return!1}function z1(e){return e!==null&&typeof e=="object"}function dc(e){if(!z1(e))return!1;var r=Object.getPrototypeOf(e);if(r==null)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t.toString()===d7}function _w(e){var r=e?.constructor;return r?r.name==="GeneratorFunction"||r.displayName==="GeneratorFunction":!1}function wp(e,r,t){Nu(e,r,{enumerable:!1,writable:!0,configurable:!0,value:t})}function Sw(e,r,t){Nu(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Qc(e,r){var t="isMobX"+e;return r.prototype[t]=!0,function(n){return z1(n)&&n[t]===!0}}function Th(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function p7(e){var r=Object.getPrototypeOf(e),t=Object.getPrototypeOf(r),n=Object.getPrototypeOf(t);return n===null}function uc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var xw=typeof Object.getOwnPropertySymbols<"u";function g7(e){var r=Object.keys(e);if(!xw)return r;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(r,t.filter(function(n){return bp.propertyIsEnumerable.call(e,n)})):r}var wh=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:xw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Ew(e){return e===null?null:typeof e=="object"?""+e:e}function cc(e,r){return bp.hasOwnProperty.call(e,r)}var v7=Object.getOwnPropertyDescriptors||function(r){var t={};return wh(r).forEach(function(n){t[n]=P1(r,n)}),t};function Fs(e,r){return!!(e&r)}function Ds(e,r,t){return t?e|=r:e&=~r,e}function Sy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function m7(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,b7(n.key),n)}}function Rh(e,r,t){return r&&m7(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fh(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=w7(e))||r){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},$c.apply(null,arguments)}function Pw(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,p2(e,r)}function p2(e,r){return p2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},p2(e,r)}function y7(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function b7(e){var r=y7(e,"string");return typeof r=="symbol"?r:r+""}function w7(e,r){if(e){if(typeof e=="string")return Sy(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Sy(e,r):void 0}}var ku=Symbol("mobx-stored-annotations");function Wl(e){function r(t,n){if(Sp(n))return e.decorate_20223_(t,n);_p(t,n,e)}return Object.assign(r,e)}function _p(e,r,t){cc(e,ku)||wp(e,ku,$c({},e[ku])),k7(t)||(e[ku][r]=t)}function _7(e){return cc(e,ku)||wp(e,ku,$c({},e[ku])),e[ku]}function Sp(e){return typeof e=="object"&&typeof e.kind=="string"}var fr=Symbol("mobx administration"),Jc=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=vn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var r=e.prototype;return r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.reportObserved=function(){return Vw(this)},r.reportChanged=function(){ps(),Gw(this),gs()},r.toString=function(){return this.name_},Rh(e,[{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Jc.isBeingObservedMask_=1;Jc.isPendingUnobservationMask_=2;Jc.diffValueMask_=4;var U2=Qc("Atom",Jc);function fp(e,r,t){r===void 0&&(r=ch),t===void 0&&(t=ch);var n=new Jc(e);return r!==ch&&e6(n,r),t!==ch&&Y2(n,t),n}function S7(e,r){return e===r}function x7(e,r){return im(e,r)}function E7(e,r){return im(e,r,1)}function P7(e,r){return Object.is?Object.is(e,r):e===r?e!==0||1/e===1/r:e!==e&&r!==r}var Cf={identity:S7,structural:x7,default:P7,shallow:E7};function kf(e,r,t){return X1(e)?e:Array.isArray(e)?jn.array(e,{name:t}):dc(e)?jn.object(e,void 0,{name:t}):Th(e)?jn.map(e,{name:t}):uc(e)?jn.set(e,{name:t}):typeof e=="function"&&!xh(e)&&!Eh(e)?_w(e)?Nf(e):_h(t,e):e}function O7(e,r,t){if(e==null||Ra(e)||Vo(e)||ao(e)||ba(e))return e;if(Array.isArray(e))return jn.array(e,{name:t,deep:!1});if(dc(e))return jn.object(e,void 0,{name:t,deep:!1});if(Th(e))return jn.map(e,{name:t,deep:!1});if(uc(e))return jn.set(e,{name:t,deep:!1})}function U1(e){return e}function A7(e,r){return im(e,r)?r:e}var Ow="override",C7=Wl({annotationType_:Ow,make_:L7,extend_:N7,decorate_20223_:T7});function k7(e){return e.annotationType_===Ow}function L7(e,r){return 0}function N7(e,r,t,n){kr("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function T7(e,r){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function xp(e,r){return{annotationType_:e,options_:r,make_:R7,extend_:M7,decorate_20223_:I7}}function R7(e,r,t,n){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,r,t,!1)===null?0:1;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if(xh(t.value))return 1;var i=Aw(e,this,r,t,!1);return Nu(n,r,i),2}function M7(e,r,t,n){var a=Aw(e,this,r,t);return e.defineProperty_(r,a,n)}function I7(e,r){var t=r.kind,n=r.name,a=r.addInitializer,i=this,o=function(c){var h,v,g,f;return Yc((h=(v=i.options_)==null?void 0:v.name)!=null?h:n.toString(),c,(g=(f=i.options_)==null?void 0:f.autoAction)!=null?g:!1)};if(t=="field")return function(u){var c,h=u;return xh(h)||(h=o(h)),(c=i.options_)!=null&&c.bound&&(h=h.bind(this),h.isMobxAction=!0),h};if(t=="method"){var s;return xh(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&a(function(){var u=this,c=u[n].bind(u);c.isMobxAction=!0,u[n]=c}),e}kr("Cannot apply '"+i.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
|
|
34
|
+
'`+i.annotationType_+"' can only be used on properties with a function value."))}function j7(e,r,t,n){r.annotationType_,n.value}function Aw(e,r,t,n,a){var i,o,s,u,c,h,v;a===void 0&&(a=It.safeDescriptors),j7(e,r,t,n);var g=n.value;if((i=r.options_)!=null&&i.bound){var f;g=g.bind((f=e.proxy_)!=null?f:e.target_)}return{value:Yc((o=(s=r.options_)==null?void 0:s.name)!=null?o:t.toString(),g,(u=(c=r.options_)==null?void 0:c.autoAction)!=null?u:!1,(h=r.options_)!=null&&h.bound?(v=e.proxy_)!=null?v:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Cw(e,r){return{annotationType_:e,options_:r,make_:F7,extend_:D7,decorate_20223_:B7}}function F7(e,r,t,n){var a;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!cc(e.target_,r)||!Eh(e.target_[r]))&&this.extend_(e,r,t,!1)===null)return 0;if(Eh(t.value))return 1;var i=kw(e,this,r,t,!1,!1);return Nu(n,r,i),2}function D7(e,r,t,n){var a,i=kw(e,this,r,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(r,i,n)}function B7(e,r){var t,n=r.name,a=r.addInitializer;return Eh(e)||(e=Nf(e)),(t=this.options_)!=null&&t.bound&&a(function(){var i=this,o=i[n].bind(i);o.isMobXFlow=!0,i[n]=o}),e}function q7(e,r,t,n){r.annotationType_,n.value}function kw(e,r,t,n,a,i){i===void 0&&(i=It.safeDescriptors),q7(e,r,t,n);var o=n.value;if(Eh(o)||(o=Nf(o)),a){var s;o=o.bind((s=e.proxy_)!=null?s:e.target_),o.isMobXFlow=!0}return{value:o,configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function H2(e,r){return{annotationType_:e,options_:r,make_:z7,extend_:U7,decorate_20223_:H7}}function z7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function U7(e,r,t,n){return V7(e,this,r,t),e.defineComputedProperty_(r,$c({},this.options_,{get:t.get,set:t.set}),n)}function H7(e,r){var t=this,n=r.name,a=r.addInitializer;return a(function(){var i=Mf(this)[fr],o=$c({},t.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),i.values_.set(n,new Xl(o))}),function(){return this[fr].getObservablePropValue_(n)}}function V7(e,r,t,n){r.annotationType_,n.get}function H1(e,r){return{annotationType_:e,options_:r,make_:G7,extend_:W7,decorate_20223_:$7}}function G7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function W7(e,r,t,n){var a,i;return Y7(e,this),e.defineObservableProperty_(r,t.value,(a=(i=this.options_)==null?void 0:i.enhancer)!=null?a:kf,n)}function $7(e,r){var t=this,n=r.kind,a=r.name,i=new WeakSet;function o(s,u){var c,h,v=Mf(s)[fr],g=new Gc(u,(c=(h=t.options_)==null?void 0:h.enhancer)!=null?c:kf,"ObservableObject."+a.toString(),!1);v.values_.set(a,g),i.add(s)}if(n=="accessor")return{get:function(){return i.has(this)||o(this,e.get.call(this)),this[fr].getObservablePropValue_(a)},set:function(u){return i.has(this)||o(this,u),this[fr].setObservablePropValue_(a,u)},init:function(u){return i.has(this)||o(this,u),u}}}function Y7(e,r,t,n){r.annotationType_}var X7="true",K7=Lw();function Lw(e){return{annotationType_:X7,options_:e,make_:Z7,extend_:Q7,decorate_20223_:J7}}function Z7(e,r,t,n){var a,i;if(t.get)return Tf.make_(e,r,t,n);if(t.set){var o=Yc(r.toString(),t.set);return n===e.target_?e.defineProperty_(r,{configurable:It.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Nu(n,r,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof t.value=="function"){var s;if(_w(t.value)){var u,c=(u=this.options_)!=null&&u.autoBind?Nf.bound:Nf;return c.make_(e,r,t,n)}var h=(s=this.options_)!=null&&s.autoBind?_h.bound:_h;return h.make_(e,r,t,n)}var v=((a=this.options_)==null?void 0:a.deep)===!1?jn.ref:jn;if(typeof t.value=="function"&&(i=this.options_)!=null&&i.autoBind){var g;t.value=t.value.bind((g=e.proxy_)!=null?g:e.target_)}return v.make_(e,r,t,n)}function Q7(e,r,t,n){var a,i;if(t.get)return Tf.extend_(e,r,t,n);if(t.set)return e.defineProperty_(r,{configurable:It.safeDescriptors?e.isPlainObject_:!0,set:Yc(r.toString(),t.set)},n);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var o;t.value=t.value.bind((o=e.proxy_)!=null?o:e.target_)}var s=((i=this.options_)==null?void 0:i.deep)===!1?jn.ref:jn;return s.extend_(e,r,t,n)}function J7(e,r){kr("'"+this.annotationType_+"' cannot be used as a decorator")}var e9="observable",t9="observable.ref",r9="observable.shallow",n9="observable.struct",Nw={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Nw);function n1(e){return e||Nw}var g2=H1(e9),i9=H1(t9,{enhancer:U1}),a9=H1(r9,{enhancer:O7}),o9=H1(n9,{enhancer:A7}),Tw=Wl(g2);function i1(e){return e.deep===!0?kf:e.deep===!1?U1:l9(e.defaultDecorator)}function s9(e){var r;return e?(r=e.defaultDecorator)!=null?r:Lw(e):void 0}function l9(e){var r,t;return e&&(r=(t=e.options_)==null?void 0:t.enhancer)!=null?r:kf}function Rw(e,r,t){if(Sp(r))return g2.decorate_20223_(e,r);if(Af(r)){_p(e,r,g2);return}return X1(e)?e:dc(e)?jn.object(e,r,t):Array.isArray(e)?jn.array(e,r):Th(e)?jn.map(e,r):uc(e)?jn.set(e,r):typeof e=="object"&&e!==null?e:jn.box(e,r)}yw(Rw,Tw);var u9={box:function(r,t){var n=n1(t);return new Gc(r,i1(n),n.name,!0,n.equals)},array:function(r,t){var n=n1(t);return(It.useProxies===!1||n.proxy===!1?gS:aS)(r,i1(n),n.name)},map:function(r,t){var n=n1(t);return new Z1(r,i1(n),n.name)},set:function(r,t){var n=n1(t);return new rm(r,i1(n),n.name)},object:function(r,t,n){return ef(function(){return X2(It.useProxies===!1||n?.proxy===!1?Mf({},n):tS({},n),r,t)})},ref:Wl(i9),shallow:Wl(a9),deep:Tw,struct:Wl(o9)},jn=yw(Rw,u9),Mw="computed",c9="computed.struct",v2=H2(Mw),f9=H2(c9,{equals:Cf.structural}),Tf=function(r,t){if(Sp(t))return v2.decorate_20223_(r,t);if(Af(t))return _p(r,t,v2);if(dc(r))return Wl(H2(Mw,r));var n=dc(t)?t:{};return n.get=r,n.name||(n.name=r.name||""),new Xl(n)};Object.assign(Tf,v2);Tf.struct=Wl(f9);var xy,Ey,O1=0,h9=1,d9=(xy=(Ey=P1(function(){},"name"))==null?void 0:Ey.configurable)!=null?xy:!1,Py={value:"action",configurable:!0,writable:!1,enumerable:!1};function Yc(e,r,t,n){t===void 0&&(t=!1);function a(){return Iw(e,t,r,n||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return r.toString()},d9&&(Py.value=e,Nu(a,"name",Py)),a}function Iw(e,r,t,n,a){var i=jw(e,r);try{return t.apply(n,a)}catch(o){throw i.error_=o,o}finally{Fw(i)}}function jw(e,r,t,n){var a=!1,i=0,o=It.trackingDerivation,s=!r||!o;ps();var u=It.allowStateChanges;s&&(Rf(),u=V1(!0));var c=W1(!0),h={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:c,notifySpy_:a,startTime_:i,actionId_:h9++,parentActionId_:O1};return O1=h.actionId_,h}function Fw(e){O1!==e.actionId_&&kr(30),O1=e.parentActionId_,e.error_!==void 0&&(It.suppressReactionErrors=!0),G1(e.prevAllowStateChanges_),ph(e.prevAllowStateReads_),gs(),e.runAsAction_&&fc(e.prevDerivation_),It.suppressReactionErrors=!1}function V2(e,r){var t=V1(e);try{return r()}finally{G1(t)}}function V1(e){var r=It.allowStateChanges;return It.allowStateChanges=e,r}function G1(e){It.allowStateChanges=e}var Gc=function(e){function r(n,a,i,o,s){var u;return i===void 0&&(i="ObservableValue"),s===void 0&&(s=Cf.default),u=e.call(this,i)||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=a,u.name_=i,u.equals=s,u.value_=a(n,void 0,i),u}Pw(r,e);var t=r.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==It.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(cl(this)){var i=fl(this,{object:this,type:Tu,newValue:a});if(!i)return It.UNCHANGED;a=i.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?It.UNCHANGED:a},t.setNewValue_=function(a){var i=this.value_;this.value_=a,this.reportChanged(),$l(this)&&Yl(this,{type:Tu,object:this,newValue:a,oldValue:i})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return Ep(this,a)},t.observe_=function(a,i){return i&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:Tu,newValue:this.value_,oldValue:void 0}),Pp(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return Ew(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},r}(Jc),G2=Qc("ObservableValue",Gc),Xl=function(){function e(t){this.dependenciesState_=vn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=vn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new C1(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=A1.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||kr(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Yc("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Cf.structural:Cf.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var r=e.prototype;return r.onBecomeStale_=function(){x9(this)},r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.get=function(){if(this.isComputing&&kr(32,this.name_,this.derivation),It.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)m2(this)&&(this.warnAboutUntrackedRead_(),ps(),this.value_=this.computeValue_(!1),gs());else if(Vw(this),m2(this)){var n=It.trackingContext;this.keepAlive_&&!n&&(It.trackingContext=this),this.trackAndCompute()&&S9(this),It.trackingContext=n}var a=this.value_;if(g1(a))throw a.cause;return a},r.set=function(n){if(this.setter_){this.isRunningSetter&&kr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else kr(34,this.name_)},r.trackAndCompute=function(){var n=this.value_,a=this.dependenciesState_===vn.NOT_TRACKING_,i=this.computeValue_(!0),o=a||g1(n)||g1(i)||!this.equals_(n,i);return o&&(this.value_=i),o},r.computeValue_=function(n){this.isComputing=!0;var a=V1(!1),i;if(n)i=Dw(this,this.derivation,this.scope_);else if(It.disableErrorBoundaries===!0)i=this.derivation.call(this.scope_);else try{i=this.derivation.call(this.scope_)}catch(o){i=new C1(o)}return G1(a),this.isComputing=!1,i},r.suspend_=function(){this.keepAlive_||(y2(this),this.value_=void 0)},r.observe_=function(n,a){var i=this,o=!0,s=void 0;return $2(function(){var u=i.get();if(!o||a){var c=Rf();n({observableKind:"computed",debugObjectName:i.name_,type:Tu,object:i,newValue:u,oldValue:s}),fc(c)}o=!1,s=u})},r.warnAboutUntrackedRead_=function(){},r.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},r.valueOf=function(){return Ew(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},Rh(e,[{key:"isComputing",get:function(){return Fs(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Fs(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Xl.isComputingMask_=1;Xl.isRunningSetterMask_=2;Xl.isBeingObservedMask_=4;Xl.isPendingUnobservationMask_=8;Xl.diffValueMask_=16;var Lf=Qc("ComputedValue",Xl),vn;(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_"})(vn||(vn={}));var A1;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(A1||(A1={}));var C1=function(r){this.cause=void 0,this.cause=r};function g1(e){return e instanceof C1}function m2(e){switch(e.dependenciesState_){case vn.UP_TO_DATE_:return!1;case vn.NOT_TRACKING_:case vn.STALE_:return!0;case vn.POSSIBLY_STALE_:{for(var r=W1(!0),t=Rf(),n=e.observing_,a=n.length,i=0;i<a;i++){var o=n[i];if(Lf(o)){if(It.disableErrorBoundaries)o.get();else try{o.get()}catch{return fc(t),ph(r),!0}if(e.dependenciesState_===vn.STALE_)return fc(t),ph(r),!0}}return Bw(e),fc(t),ph(r),!1}}}function p9(){return It.trackingDerivation!==null}function Dw(e,r,t){var n=W1(!0);Bw(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++It.runId;var a=It.trackingDerivation;It.trackingDerivation=e,It.inBatch++;var i;if(It.disableErrorBoundaries===!0)i=r.call(t);else try{i=r.call(t)}catch(o){i=new C1(o)}return It.inBatch--,It.trackingDerivation=a,g9(e),ph(n),i}function g9(e){for(var r=e.observing_,t=e.observing_=e.newObserving_,n=vn.UP_TO_DATE_,a=0,i=e.unboundDepsCount_,o=0;o<i;o++){var s=t[o];s.diffValue===0&&(s.diffValue=1,a!==o&&(t[a]=s),a++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(t.length=a,e.newObserving_=null,i=r.length;i--;){var u=r[i];u.diffValue===0&&Uw(u,e),u.diffValue=0}for(;a--;){var c=t[a];c.diffValue===1&&(c.diffValue=0,_9(c,e))}n!==vn.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function y2(e){var r=e.observing_;e.observing_=[];for(var t=r.length;t--;)Uw(r[t],e);e.dependenciesState_=vn.NOT_TRACKING_}function W2(e){var r=Rf();try{return e()}finally{fc(r)}}function Rf(){var e=It.trackingDerivation;return It.trackingDerivation=null,e}function fc(e){It.trackingDerivation=e}function W1(e){var r=It.allowStateReads;return It.allowStateReads=e,r}function ph(e){It.allowStateReads=e}function Bw(e){if(e.dependenciesState_!==vn.UP_TO_DATE_){e.dependenciesState_=vn.UP_TO_DATE_;for(var r=e.observing_,t=r.length;t--;)r[t].lowestObserverState_=vn.UP_TO_DATE_}}var v9=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],op=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},v1=!0,qw=!1,It=function(){var e=q1();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(v1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new op().version&&(v1=!1),v1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new op):(setTimeout(function(){qw||kr(35)},1),new op)}();function m9(){if((It.pendingReactions.length||It.inBatch||It.isRunningReactions)&&kr(36),qw=!0,v1){var e=q1();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),It=new op}}function zw(){return It}function y9(){var e=new op;for(var r in e)v9.indexOf(r)===-1&&(It[r]=e[r]);It.allowStateChanges=!It.enforceActions}function b9(e){return e.observers_&&e.observers_.size>0}function w9(e){return e.observers_}function _9(e,r){e.observers_.add(r),e.lowestObserverState_>r.dependenciesState_&&(e.lowestObserverState_=r.dependenciesState_)}function Uw(e,r){e.observers_.delete(r),e.observers_.size===0&&Hw(e)}function Hw(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,It.pendingUnobservations.push(e))}function ps(){It.inBatch++}function gs(){if(--It.inBatch===0){Ww();for(var e=It.pendingUnobservations,r=0;r<e.length;r++){var t=e[r];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof Xl&&t.suspend_())}It.pendingUnobservations=[]}}function Vw(e){var r=It.trackingDerivation;return r!==null?(r.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=r.runId_,r.newObserving_[r.unboundDepsCount_++]=e,!e.isBeingObserved&&It.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&It.inBatch>0&&Hw(e),!1)}function Gw(e){e.lowestObserverState_!==vn.STALE_&&(e.lowestObserverState_=vn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.UP_TO_DATE_&&r.onBecomeStale_(),r.dependenciesState_=vn.STALE_}))}function S9(e){e.lowestObserverState_!==vn.STALE_&&(e.lowestObserverState_=vn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.POSSIBLY_STALE_?r.dependenciesState_=vn.STALE_:r.dependenciesState_===vn.UP_TO_DATE_&&(e.lowestObserverState_=vn.UP_TO_DATE_)}))}function x9(e){e.lowestObserverState_===vn.UP_TO_DATE_&&(e.lowestObserverState_=vn.POSSIBLY_STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.UP_TO_DATE_&&(r.dependenciesState_=vn.POSSIBLY_STALE_,r.onBecomeStale_())}))}var Kl=function(){function e(t,n,a,i){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=vn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=A1.NONE,this.name_=t,this.onInvalidate_=n,this.errorHandler_=a,this.requiresObservable_=i}var r=e.prototype;return r.onBecomeStale_=function(){this.schedule_()},r.schedule_=function(){this.isScheduled||(this.isScheduled=!0,It.pendingReactions.push(this),Ww())},r.runReaction_=function(){if(!this.isDisposed){ps(),this.isScheduled=!1;var n=It.trackingContext;if(It.trackingContext=this,m2(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}It.trackingContext=n,gs()}},r.track=function(n){if(!this.isDisposed){ps(),this.isRunning=!0;var a=It.trackingContext;It.trackingContext=this;var i=Dw(this,n,void 0);It.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&y2(this),g1(i)&&this.reportExceptionInDerivation_(i.cause),gs()}},r.reportExceptionInDerivation_=function(n){var a=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(It.disableErrorBoundaries)throw n;var i="[mobx] uncaught error in '"+this+"'";It.suppressReactionErrors||console.error(i,n),It.globalReactionErrorHandlers.forEach(function(o){return o(n,a)})},r.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ps(),y2(this),gs()))},r.getDisposer_=function(n){var a=this,i=function o(){a.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",i),i[fr]=this,i},r.toString=function(){return"Reaction["+this.name_+"]"},r.trace=function(n){},Rh(e,[{key:"isDisposed",get:function(){return Fs(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Fs(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Fs(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Fs(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Kl.isDisposedMask_=1;Kl.isScheduledMask_=2;Kl.isTrackPendingMask_=4;Kl.isRunningMask_=8;Kl.diffValueMask_=16;function E9(e){return It.globalReactionErrorHandlers.push(e),function(){var r=It.globalReactionErrorHandlers.indexOf(e);r>=0&&It.globalReactionErrorHandlers.splice(r,1)}}var P9=100,b2=function(r){return r()};function Ww(){It.inBatch>0||It.isRunningReactions||b2(O9)}function O9(){It.isRunningReactions=!0;for(var e=It.pendingReactions,r=0;e.length>0;){++r===P9&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),n=0,a=t.length;n<a;n++)t[n].runReaction_()}It.isRunningReactions=!1}var k1=Qc("Reaction",Kl);function A9(e){var r=b2;b2=function(n){return e(function(){return r(n)})}}function sp(){return!1}function $w(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Yw="action",C9="action.bound",Xw="autoAction",k9="autoAction.bound",Kw="<unnamed action>",w2=xp(Yw),L9=xp(C9,{bound:!0}),_2=xp(Xw,{autoAction:!0}),N9=xp(k9,{autoAction:!0,bound:!0});function Zw(e){var r=function(n,a){if(qs(n))return Yc(n.name||Kw,n,e);if(qs(a))return Yc(n,a,e);if(Sp(a))return(e?_2:w2).decorate_20223_(n,a);if(Af(a))return _p(n,a,e?_2:w2);if(Af(n))return Wl(xp(e?Xw:Yw,{name:n,autoAction:e}))};return r}var ca=Zw(!1);Object.assign(ca,w2);var _h=Zw(!0);Object.assign(_h,_2);ca.bound=Wl(L9);_h.bound=Wl(N9);function Sh(e){return Iw(e.name||Kw,!1,e,this,void 0)}function xh(e){return qs(e)&&e.isMobxAction===!0}function $2(e,r){var t,n,a,i;r===void 0&&(r=z2);var o=(t=(n=r)==null?void 0:n.name)!=null?t:"Autorun",s=!r.scheduler&&!r.delay,u;if(s)u=new Kl(o,function(){this.track(v)},r.onError,r.requiresObservable);else{var c=Qw(r),h=!1;u=new Kl(o,function(){h||(h=!0,c(function(){h=!1,u.isDisposed||u.track(v)}))},r.onError,r.requiresObservable)}function v(){e(u)}return(a=r)!=null&&(a=a.signal)!=null&&a.aborted||u.schedule_(),u.getDisposer_((i=r)==null?void 0:i.signal)}var T9=function(r){return r()};function Qw(e){return e.scheduler?e.scheduler:e.delay?function(r){return setTimeout(r,e.delay)}:T9}function Jw(e,r,t){var n,a,i;t===void 0&&(t=z2);var o=(n=t.name)!=null?n:"Reaction",s=ca(o,t.onError?R9(t.onError,r):r),u=!t.scheduler&&!t.delay,c=Qw(t),h=!0,v=!1,g,f=t.compareStructural?Cf.structural:t.equals||Cf.default,E=new Kl(o,function(){h||u?S():v||(v=!0,c(S))},t.onError,t.requiresObservable);function S(){if(v=!1,!E.isDisposed){var w=!1,_=g;E.track(function(){var y=V2(!1,function(){return e(E)});w=h||!f(g,y),g=y}),(h&&t.fireImmediately||!h&&w)&&s(g,_,E),h=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||E.schedule_(),E.getDisposer_((i=t)==null?void 0:i.signal)}function R9(e,r){return function(){try{return r.apply(this,arguments)}catch(t){e.call(this,t)}}}var M9="onBO",I9="onBUO";function e6(e,r,t){return t6(M9,e,r,t)}function Y2(e,r,t){return t6(I9,e,r,t)}function t6(e,r,t,n){var a=typeof n=="function"?Mu(r,t):Mu(r),i=qs(n)?n:t,o=e+"L";return a[o]?a[o].add(i):a[o]=new Set([i]),function(){var s=a[o];s&&(s.delete(i),s.size===0&&delete a[o])}}var j9="never",a1="always",F9="observed";function r6(e){e.isolateGlobalState===!0&&m9();var r=e.useProxies,t=e.enforceActions;if(r!==void 0&&(It.useProxies=r===a1?!0:r===j9?!1:typeof Proxy<"u"),r==="ifavailable"&&(It.verifyProxies=!0),t!==void 0){var n=t===a1?a1:t===F9;It.enforceActions=n,It.allowStateChanges=!(n===!0||n===a1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(It[a]=!!e[a])}),It.allowStateReads=!It.observableRequiresReaction,e.reactionScheduler&&A9(e.reactionScheduler)}function X2(e,r,t,n){var a=v7(r);return ef(function(){var i=Mf(e,n)[fr];wh(a).forEach(function(o){i.extend_(o,a[o],t&&o in t?t[o]:!0)})}),e}function n6(e,r){return i6(Mu(e,r))}function i6(e){var r={name:e.name_};return e.observing_&&e.observing_.length>0&&(r.dependencies=B9(e.observing_).map(i6)),r}function D9(e,r){return a6(Mu(e,r))}function a6(e){var r={name:e.name_};return b9(e)&&(r.observers=Array.from(w9(e)).map(a6)),r}function B9(e){return Array.from(new Set(e))}var q9=0;function $1(){this.message="FLOW_CANCELLED"}$1.prototype=Object.create(Error.prototype);function z9(e){return e instanceof $1}var H0=Cw("flow"),U9=Cw("flow.bound",{bound:!0}),Nf=Object.assign(function(r,t){if(Sp(t))return H0.decorate_20223_(r,t);if(Af(t))return _p(r,t,H0);var n=r,a=n.name||"<unnamed flow>",i=function(){var s=this,u=arguments,c=++q9,h=ca(a+" - runid: "+c+" - init",n).apply(s,u),v,g=void 0,f=new Promise(function(E,S){var w=0;v=S;function _(m){g=void 0;var P;try{P=ca(a+" - runid: "+c+" - yield "+w++,h.next).call(h,m)}catch(T){return S(T)}p(P)}function y(m){g=void 0;var P;try{P=ca(a+" - runid: "+c+" - yield "+w++,h.throw).call(h,m)}catch(T){return S(T)}p(P)}function p(m){if(qs(m?.then)){m.then(p,S);return}return m.done?E(m.value):(g=Promise.resolve(m.value),g.then(_,y))}_(void 0)});return f.cancel=ca(a+" - runid: "+c+" - cancel",function(){try{g&&Oy(g);var E=h.return(void 0),S=Promise.resolve(E.value);S.then(ch,ch),Oy(S),v(new $1)}catch(w){v(w)}}),f};return i.isMobXFlow=!0,i},H0);Nf.bound=Wl(U9);function Oy(e){qs(e.cancel)&&e.cancel()}function H9(e){return e}function Eh(e){return e?.isMobXFlow===!0}function K2(e,r,t){var n;return ao(e)||Vo(e)||G2(e)?n=Zl(e):Ra(e)&&(n=Zl(e,r)),n.dehancer=typeof r=="function"?r:t,function(){n.dehancer=void 0}}function Y1(e,r,t){return qs(t)?G9(e,r,t):V9(e,r)}function V9(e,r){return Zl(e).intercept_(r)}function G9(e,r,t){return Zl(e,r).intercept_(t)}function o6(e,r){if(r===void 0)return Lf(e);if(Ra(e)===!1||!e[fr].values_.has(r))return!1;var t=Mu(e,r);return Lf(t)}function W9(e){return o6(e)}function s6(e,r){return o6(e,r)}function l6(e,r){return e?r!==void 0?Ra(e)?e[fr].values_.has(r):!1:Ra(e)||!!e[fr]||U2(e)||k1(e)||Lf(e):!1}function X1(e){return l6(e)}function u6(e,r){return l6(e,r)}function hp(e){if(Ra(e))return e[fr].keys_();if(ao(e)||ba(e))return Array.from(e.keys());if(Vo(e))return e.map(function(r,t){return t});kr(5)}function Z2(e){if(Ra(e))return hp(e).map(function(r){return e[r]});if(ao(e))return hp(e).map(function(r){return e.get(r)});if(ba(e))return Array.from(e.values());if(Vo(e))return e.slice();kr(6)}function c6(e){if(Ra(e))return hp(e).map(function(r){return[r,e[r]]});if(ao(e))return hp(e).map(function(r){return[r,e.get(r)]});if(ba(e))return Array.from(e.entries());if(Vo(e))return e.map(function(r,t){return[t,r]});kr(7)}function Q2(e,r,t){if(arguments.length===2&&!ba(e)){ps();var n=r;try{for(var a in n)Q2(e,a,n[a])}finally{gs()}return}Ra(e)?e[fr].set_(r,t):ao(e)?e.set(r,t):ba(e)?e.add(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),r<0&&kr("Invalid index: '"+r+"'"),ps(),r>=e.length&&(e.length=r+1),e[r]=t,gs()):kr(8)}function $9(e,r){Ra(e)?e[fr].delete_(r):ao(e)||ba(e)?e.delete(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),e.splice(r,1)):kr(9)}function f6(e,r){if(Ra(e))return e[fr].has_(r);if(ao(e))return e.has(r);if(ba(e))return e.has(r);if(Vo(e))return r>=0&&r<e.length;kr(10)}function Y9(e,r){if(f6(e,r)){if(Ra(e))return e[fr].get_(r);if(ao(e))return e.get(r);if(Vo(e))return e[r];kr(11)}}function J2(e,r,t){if(Ra(e))return e[fr].defineProperty_(r,t);kr(39)}function h6(e){if(Ra(e))return e[fr].ownKeys_();kr(38)}function K1(e,r,t,n){return qs(t)?K9(e,r,t,n):X9(e,r,t)}function X9(e,r,t){return Zl(e).observe_(r,t)}function K9(e,r,t,n){return Zl(e,r).observe_(t,n)}function o1(e,r,t){return e.set(r,t),t}function oh(e,r){if(e==null||typeof e!="object"||e instanceof Date||!X1(e))return e;if(G2(e)||Lf(e))return oh(e.get(),r);if(r.has(e))return r.get(e);if(Vo(e)){var t=o1(r,e,new Array(e.length));return e.forEach(function(o,s){t[s]=oh(o,r)}),t}if(ba(e)){var n=o1(r,e,new Set);return e.forEach(function(o){n.add(oh(o,r))}),n}if(ao(e)){var a=o1(r,e,new Map);return e.forEach(function(o,s){a.set(s,oh(o,r))}),a}else{var i=o1(r,e,{});return h6(e).forEach(function(o){bp.propertyIsEnumerable.call(e,o)&&(i[o]=oh(e[o],r))}),i}}function Z9(e,r){return oh(e,new Map)}function Q9(){}function Cu(e,r){r===void 0&&(r=void 0),ps();try{return e.apply(r)}finally{gs()}}function S2(e,r,t){return arguments.length===1||r&&typeof r=="object"?J9(e,r):d6(e,r,t||{})}function d6(e,r,t){var n;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[fr].isDisposed)if(o(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var i=Yc("When-effect",r),o=$2(function(s){var u=V2(!1,e);u&&(s.dispose(),n&&clearTimeout(n),i())},t);return o}function J9(e,r){var t;if(r!=null&&(t=r.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,a,i=new Promise(function(o,s){var u,c=d6(e,o,$c({},r,{onError:s}));n=function(){c(),s(new Error("WHEN_CANCELLED"))},a=function(){c(),s(new Error("WHEN_ABORTED"))},r==null||(u=r.signal)==null||u.addEventListener==null||u.addEventListener("abort",a)}).finally(function(){var o;return r==null||(o=r.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",a)});return i.cancel=n,i}function th(e){return e[fr]}var eS={has:function(r,t){return th(r).has_(t)},get:function(r,t){return th(r).get_(t)},set:function(r,t,n){var a;return Af(t)?(a=th(r).set_(t,n,!0))!=null?a:!0:!1},deleteProperty:function(r,t){var n;return Af(t)?(n=th(r).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(r,t,n){var a;return(a=th(r).defineProperty_(t,n))!=null?a:!0},ownKeys:function(r){return th(r).ownKeys_()},preventExtensions:function(r){kr(13)}};function tS(e,r){var t,n;return bw(),e=Mf(e,r),(n=(t=e[fr]).proxy_)!=null?n:t.proxy_=new Proxy(e,eS)}function cl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ep(e,r){var t=e.interceptors_||(e.interceptors_=[]);return t.push(r),ww(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function fl(e,r){var t=Rf();try{for(var n=[].concat(e.interceptors_||[]),a=0,i=n.length;a<i&&(r=n[a](r),r&&!r.type&&kr(14),!!r);a++);return r}finally{fc(t)}}function $l(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Pp(e,r){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(r),ww(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function Yl(e,r){var t=Rf(),n=e.changeListeners_;if(n){n=n.slice();for(var a=0,i=n.length;a<i;a++)n[a](r);fc(t)}}function em(e,r,t){return ef(function(){var n,a=Mf(e,t)[fr];(n=r)!=null||(r=_7(e)),wh(r).forEach(function(i){return a.make_(i,r[i])})}),e}var V0=Symbol("mobx-keys");function rS(e,r,t){return dc(e)?X2(e,e,r,t):(ef(function(){var n=Mf(e,t)[fr];if(!e[V0]){var a=Object.getPrototypeOf(e),i=new Set([].concat(wh(e),wh(a)));i.delete("constructor"),i.delete(fr),wp(a,V0,i)}e[V0].forEach(function(o){return n.make_(o,r&&o in r?r[o]:!0)})}),e)}var Ay="splice",Tu="update",nS=1e4,iS={get:function(r,t){var n=r[fr];return t===fr?n:t==="length"?n.getArrayLength_():typeof t=="string"&&!isNaN(t)?n.get_(parseInt(t)):cc(L1,t)?L1[t]:r[t]},set:function(r,t,n){var a=r[fr];return t==="length"&&a.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?r[t]=n:a.set_(parseInt(t),n),!0},preventExtensions:function(){kr(15)}},tm=function(){function e(t,n,a,i){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=a,this.legacyMode_=i,this.atom_=new Jc(t),this.enhancer_=function(o,s){return n(o,s,"ObservableArray[..]")}}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},r.intercept_=function(n){return Ep(this,n)},r.observe_=function(n,a){return a===void 0&&(a=!1),a&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Pp(this,n)},r.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},r.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&kr("Out of range: "+n);var a=this.values_.length;if(n!==a)if(n>a){for(var i=new Array(n-a),o=0;o<n-a;o++)i[o]=void 0;this.spliceWithArray_(a,0,i)}else this.spliceWithArray_(n,a-n)},r.updateArrayLength_=function(n,a){n!==this.lastKnownLength_&&kr(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&y6(n+a+1)},r.spliceWithArray_=function(n,a,i){var o=this;this.atom_;var s=this.values_.length;if(n===void 0?n=0:n>s?n=s:n<0&&(n=Math.max(0,s+n)),arguments.length===1?a=s-n:a==null?a=0:a=Math.max(0,Math.min(a,s-n)),i===void 0&&(i=d2),cl(this)){var u=fl(this,{object:this.proxy_,type:Ay,index:n,removedCount:a,added:i});if(!u)return d2;a=u.removedCount,i=u.added}if(i=i.length===0?i:i.map(function(v){return o.enhancer_(v,void 0)}),this.legacyMode_){var c=i.length-a;this.updateArrayLength_(s,c)}var h=this.spliceItemsIntoValues_(n,a,i);return(a!==0||i.length!==0)&&this.notifyArraySplice_(n,i,h),this.dehanceValues_(h)},r.spliceItemsIntoValues_=function(n,a,i){if(i.length<nS){var o;return(o=this.values_).splice.apply(o,[n,a].concat(i))}else{var s=this.values_.slice(n,n+a),u=this.values_.slice(n+a);this.values_.length+=i.length-a;for(var c=0;c<i.length;c++)this.values_[n+c]=i[c];for(var h=0;h<u.length;h++)this.values_[n+i.length+h]=u[h];return s}},r.notifyArrayChildUpdate_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),u=s||o?{observableKind:"array",object:this.proxy_,type:Tu,debugObjectName:this.atom_.name_,index:n,newValue:a,oldValue:i}:null;this.atom_.reportChanged(),s&&Yl(this,u)},r.notifyArraySplice_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ay,index:n,removed:i,added:a,removedCount:i.length,addedCount:a.length}:null;this.atom_.reportChanged(),s&&Yl(this,u)},r.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},r.set_=function(n,a){var i=this.values_;if(this.legacyMode_&&n>i.length&&kr(17,n,i.length),n<i.length){this.atom_;var o=i[n];if(cl(this)){var s=fl(this,{type:Tu,object:this.proxy_,index:n,newValue:a});if(!s)return;a=s.newValue}a=this.enhancer_(a,o);var u=a!==o;u&&(i[n]=a,this.notifyArrayChildUpdate_(n,a,o))}else{for(var c=new Array(n+1-i.length),h=0;h<c.length-1;h++)c[h]=void 0;c[c.length-1]=a,this.spliceWithArray_(i.length,0,c)}},e}();function aS(e,r,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),bw(),ef(function(){var a=new tm(t,r,n,!1);Sw(a.values_,fr,a);var i=new Proxy(a.values_,iS);return a.proxy_=i,e&&e.length&&a.spliceWithArray_(0,0,e),i})}var L1={clear:function(){return this.splice(0)},replace:function(r){var t=this[fr];return t.spliceWithArray_(0,t.values_.length,r)},toJSON:function(){return this.slice()},splice:function(r,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o=this[fr];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(r);case 2:return o.spliceWithArray_(r,t)}return o.spliceWithArray_(r,t,a)},spliceWithArray:function(r,t,n){return this[fr].spliceWithArray_(r,t,n)},push:function(){for(var r=this[fr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(r.values_.length,0,n),r.values_.length},pop:function(){return this.splice(Math.max(this[fr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var r=this[fr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(0,0,n),r.values_.length},reverse:function(){return It.trackingDerivation&&kr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){It.trackingDerivation&&kr(37,"sort");var r=this.slice();return r.sort.apply(r,arguments),this.replace(r),this},remove:function(r){var t=this[fr],n=t.dehanceValues_(t.values_).indexOf(r);return n>-1?(this.splice(n,1),!0):!1}};Qn("at",zs);Qn("concat",zs);Qn("flat",zs);Qn("includes",zs);Qn("indexOf",zs);Qn("join",zs);Qn("lastIndexOf",zs);Qn("slice",zs);Qn("toString",zs);Qn("toLocaleString",zs);Qn("toSorted",zs);Qn("toSpliced",zs);Qn("with",zs);Qn("every",Ql);Qn("filter",Ql);Qn("find",Ql);Qn("findIndex",Ql);Qn("findLast",Ql);Qn("findLastIndex",Ql);Qn("flatMap",Ql);Qn("forEach",Ql);Qn("map",Ql);Qn("some",Ql);Qn("toReversed",Ql);Qn("reduce",p6);Qn("reduceRight",p6);function Qn(e,r){typeof Array.prototype[e]=="function"&&(L1[e]=r(e))}function zs(e){return function(){var r=this[fr];r.atom_.reportObserved();var t=r.dehanceValues_(r.values_);return t[e].apply(t,arguments)}}function Ql(e){return function(r,t){var n=this,a=this[fr];a.atom_.reportObserved();var i=a.dehanceValues_(a.values_);return i[e](function(o,s){return r.call(t,o,s,n)})}}function p6(e){return function(){var r=this,t=this[fr];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(i,o,s){return a(i,o,s,r)},n[e].apply(n,arguments)}}var oS=Qc("ObservableArrayAdministration",tm);function Vo(e){return z1(e)&&oS(e[fr])}var sS={},Hc="add",N1="delete",Z1=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[fr]=sS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=a,qs(Map)||kr(18),ef(function(){i.keysAtom_=fp("ObservableMap.keys()"),i.data_=new Map,i.hasMap_=new Map,t&&i.merge(t)})}var r=e.prototype;return r.has_=function(n){return this.data_.has(n)},r.has=function(n){var a=this;if(!It.trackingDerivation)return this.has_(n);var i=this.hasMap_.get(n);if(!i){var o=i=new Gc(this.has_(n),U1,"ObservableMap.key?",!1);this.hasMap_.set(n,o),Y2(o,function(){return a.hasMap_.delete(n)})}return i.get()},r.set=function(n,a){var i=this.has_(n);if(cl(this)){var o=fl(this,{type:i?Tu:Hc,object:this,newValue:a,name:n});if(!o)return this;a=o.newValue}return i?this.updateValue_(n,a):this.addValue_(n,a),this},r.delete=function(n){var a=this;if(this.keysAtom_,cl(this)){var i=fl(this,{type:N1,object:this,name:n});if(!i)return!1}if(this.has_(n)){var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:N1,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Cu(function(){var c;a.keysAtom_.reportChanged(),(c=a.hasMap_.get(n))==null||c.setNewValue_(!1);var h=a.data_.get(n);h.setNewValue_(void 0),a.data_.delete(n)}),s&&Yl(this,u),!0}return!1},r.updateValue_=function(n,a){var i=this.data_.get(n);if(a=i.prepareNewValue_(a),a!==It.UNCHANGED){var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Tu,object:this,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,u)}},r.addValue_=function(n,a){var i=this;this.keysAtom_,Cu(function(){var c,h=new Gc(a,i.enhancer_,"ObservableMap.key",!1);i.data_.set(n,h),a=h.value_,(c=i.hasMap_.get(n))==null||c.setNewValue_(!0),i.keysAtom_.reportChanged()});var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Hc,object:this,name:n,newValue:a}:null;s&&Yl(this,u)},r.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},r.values=function(){var n=this,a=this.keys();return Cy({next:function(){var o=a.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:n.get(u)}}})},r.entries=function(){var n=this,a=this.keys();return Cy({next:function(){var o=a.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,n.get(u)]}}})},r[Symbol.iterator]=function(){return this.entries()},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value,u=s[0],c=s[1];n.call(a,c,u,this)}},r.merge=function(n){var a=this;return ao(n)&&(n=new Map(n)),Cu(function(){dc(n)?g7(n).forEach(function(i){return a.set(i,n[i])}):Array.isArray(n)?n.forEach(function(i){var o=i[0],s=i[1];return a.set(o,s)}):Th(n)?(p7(n)||kr(19,n),n.forEach(function(i,o){return a.set(o,i)})):n!=null&&kr(20,n)}),this},r.clear=function(){var n=this;Cu(function(){W2(function(){for(var a=fh(n.keys()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.replace=function(n){var a=this;return Cu(function(){for(var i=lS(n),o=new Map,s=!1,u=fh(a.data_.keys()),c;!(c=u()).done;){var h=c.value;if(!i.has(h)){var v=a.delete(h);if(v)s=!0;else{var g=a.data_.get(h);o.set(h,g)}}}for(var f=fh(i.entries()),E;!(E=f()).done;){var S=E.value,w=S[0],_=S[1],y=a.data_.has(w);if(a.set(w,_),a.data_.has(w)){var p=a.data_.get(w);o.set(w,p),y||(s=!0)}}if(!s)if(a.data_.size!==o.size)a.keysAtom_.reportChanged();else for(var m=a.data_.keys(),P=o.keys(),T=m.next(),k=P.next();!T.done;){if(T.value!==k.value){a.keysAtom_.reportChanged();break}T=m.next(),k=P.next()}a.data_=o}),this},r.toString=function(){return"[object ObservableMap]"},r.toJSON=function(){return Array.from(this)},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},Rh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),ao=Qc("ObservableMap",Z1);function Cy(e){return e[Symbol.toStringTag]="MapIterator",am(e)}function lS(e){if(Th(e)||ao(e))return e;if(Array.isArray(e))return new Map(e);if(dc(e)){var r=new Map;for(var t in e)r.set(t,e[t]);return r}else return kr(21,e)}var uS={},rm=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[fr]=uS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=a,qs(Set)||kr(22),this.enhancer_=function(o,s){return n(o,s,a)},ef(function(){i.atom_=fp(i.name_),t&&i.replace(t)})}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.clear=function(){var n=this;Cu(function(){W2(function(){for(var a=fh(n.data_.values()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value;n.call(a,s,s,this)}},r.add=function(n){var a=this;if(this.atom_,cl(this)){var i=fl(this,{type:Hc,object:this,newValue:n});if(!i)return this;n=i.newValue}if(!this.has(n)){Cu(function(){a.data_.add(a.enhancer_(n,void 0)),a.atom_.reportChanged()});var o=!1,s=$l(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:Hc,object:this,newValue:n}:null;s&&Yl(this,u)}return this},r.delete=function(n){var a=this;if(cl(this)){var i=fl(this,{type:N1,object:this,oldValue:n});if(!i)return!1}if(this.has(n)){var o=!1,s=$l(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:N1,object:this,oldValue:n}:null;return Cu(function(){a.atom_.reportChanged(),a.data_.delete(n)}),s&&Yl(this,u),!0}return!1},r.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},r.entries=function(){var n=this.values();return ky({next:function(){var i=n.next(),o=i.value,s=i.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},r.keys=function(){return this.values()},r.values=function(){this.atom_.reportObserved();var n=this,a=this.data_.values();return ky({next:function(){var o=a.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(s),done:u}}})},r.intersection=function(n){if(uc(n)&&!ba(n))return n.intersection(this);var a=new Set(this);return a.intersection(n)},r.union=function(n){if(uc(n)&&!ba(n))return n.union(this);var a=new Set(this);return a.union(n)},r.difference=function(n){return new Set(this).difference(n)},r.symmetricDifference=function(n){if(uc(n)&&!ba(n))return n.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(n)},r.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},r.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},r.isDisjointFrom=function(n){if(uc(n)&&!ba(n))return n.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(n)},r.replace=function(n){var a=this;return ba(n)&&(n=new Set(n)),Cu(function(){Array.isArray(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):uc(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):n!=null&&kr("Cannot initialize set from "+n)}),this},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.toJSON=function(){return Array.from(this)},r.toString=function(){return"[object ObservableSet]"},r[Symbol.iterator]=function(){return this.values()},Rh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),ba=Qc("ObservableSet",rm);function ky(e){return e[Symbol.toStringTag]="SetIterator",am(e)}var Ly=Object.create(null),Ny="remove",g6=function(){function e(t,n,a,i){n===void 0&&(n=new Map),i===void 0&&(i=K7),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=n,this.name_=a,this.defaultAnnotation_=i,this.keysAtom_=new Jc("ObservableObject.keys"),this.isPlainObject_=dc(this.target_)}var r=e.prototype;return r.getObservablePropValue_=function(n){return this.values_.get(n).get()},r.setObservablePropValue_=function(n,a){var i=this.values_.get(n);if(i instanceof Xl)return i.set(a),!0;if(cl(this)){var o=fl(this,{type:Tu,object:this.proxy_||this.target_,name:n,newValue:a});if(!o)return null;a=o.newValue}if(a=i.prepareNewValue_(a),a!==It.UNCHANGED){var s=$l(this),u=!1,c=s||u?{type:Tu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,c)}return!0},r.get_=function(n){return It.trackingDerivation&&!cc(this.target_,n)&&this.has_(n),this.target_[n]},r.set_=function(n,a,i){return i===void 0&&(i=!1),cc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,a):i?Reflect.set(this.target_,n,a):(this.target_[n]=a,!0):this.extend_(n,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,i)},r.has_=function(n){if(!It.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(n);return a||(a=new Gc(n in this.target_,U1,"ObservableObject.key?",!1),this.pendingKeys_.set(n,a)),a.get()},r.make_=function(n,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(n in this.target_)){var i;if((i=this.target_[ku])!=null&&i[n])return;kr(1,a.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==bp;){var s=P1(o,n);if(s){var u=a.make_(this,n,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}Ry(this,a,n)}},r.extend_=function(n,a,i,o){if(o===void 0&&(o=!1),i===!0&&(i=this.defaultAnnotation_),i===!1)return this.defineProperty_(n,a,o);var s=i.extend_(this,n,a,o);return s&&Ry(this,i,n),s},r.defineProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a.value});if(!s)return null;var u=s.newValue;a.value!==u&&(a=$c({},a,{value:u}))}if(i){if(!Reflect.defineProperty(this.target_,n,a))return!1}else Nu(this.target_,n,a);this.notifyPropertyAddition_(n,a.value)}finally{gs()}return!0},r.defineObservableProperty_=function(n,a,i,o){o===void 0&&(o=!1),this.keysAtom_;try{ps();var s=this.delete_(n);if(!s)return s;if(cl(this)){var u=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a});if(!u)return null;a=u.newValue}var c=Ty(n),h={configurable:It.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Nu(this.target_,n,h);var v=new Gc(a,i,"ObservableObject.key",!1);this.values_.set(n,v),this.notifyPropertyAddition_(n,v.value_)}finally{gs()}return!0},r.defineComputedProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:void 0});if(!s)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var u=Ty(n),c={configurable:It.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(i){if(!Reflect.defineProperty(this.target_,n,c))return!1}else Nu(this.target_,n,c);this.values_.set(n,new Xl(a)),this.notifyPropertyAddition_(n,void 0)}finally{gs()}return!0},r.delete_=function(n,a){if(a===void 0&&(a=!1),this.keysAtom_,!cc(this.target_,n))return!0;if(cl(this)){var i=fl(this,{object:this.proxy_||this.target_,name:n,type:Ny});if(!i)return null}try{var o;ps();var s=$l(this),u=!1,c=this.values_.get(n),h=void 0;if(!c&&(s||u)){var v;h=(v=P1(this.target_,n))==null?void 0:v.value}if(a){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(c&&(this.values_.delete(n),c instanceof Gc&&(h=c.value_),Gw(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),s||u){var g={type:Ny,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};s&&Yl(this,g)}}finally{gs()}return!0},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.notifyPropertyAddition_=function(n,a){var i,o=$l(this),s=!1;if(o||s){var u=o||s?{type:Hc,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:a}:null;o&&Yl(this,u)}(i=this.pendingKeys_)==null||(i=i.get(n))==null||i.set(!0),this.keysAtom_.reportChanged()},r.ownKeys_=function(){return this.keysAtom_.reportObserved(),wh(this.target_)},r.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Mf(e,r){var t;if(cc(e,fr))return e;var n=(t=r?.name)!=null?t:"ObservableObject",a=new g6(e,new Map,String(n),s9(r));return wp(e,fr,a),e}var cS=Qc("ObservableObjectAdministration",g6);function Ty(e){return Ly[e]||(Ly[e]={get:function(){return this[fr].getObservablePropValue_(e)},set:function(t){return this[fr].setObservablePropValue_(e,t)}})}function Ra(e){return z1(e)?cS(e[fr]):!1}function Ry(e,r,t){var n;(n=e.target_[ku])==null||delete n[t]}var fS=m6(0),hS=function(){var e=!1,r={};return Object.defineProperty(r,"0",{set:function(){e=!0}}),Object.create(r)[0]=1,e===!1}(),G0=0,v6=function(){};function dS(e,r){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,r):e.prototype.__proto__!==void 0?e.prototype.__proto__=r:e.prototype=r}dS(v6,Array.prototype);var nm=function(e){function r(n,a,i,o){var s;return i===void 0&&(i="ObservableArray"),o===void 0&&(o=!1),s=e.call(this)||this,ef(function(){var u=new tm(i,a,o,!0);u.proxy_=s,Sw(s,fr,u),n&&n.length&&s.spliceWithArray(0,0,n),hS&&Object.defineProperty(s,"0",fS)}),s}Pw(r,e);var t=r.prototype;return t.concat=function(){this[fr].atom_.reportObserved();for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),i.map(function(s){return Vo(s)?s.slice():s}))},t[Symbol.iterator]=function(){var n=this,a=0;return am({next:function(){return a<n.length?{value:n[a++],done:!1}:{done:!0,value:void 0}}})},Rh(r,[{key:"length",get:function(){return this[fr].getArrayLength_()},set:function(a){this[fr].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(v6);Object.entries(L1).forEach(function(e){var r=e[0],t=e[1];r!=="concat"&&wp(nm.prototype,r,t)});function m6(e){return{enumerable:!1,configurable:!0,get:function(){return this[fr].get_(e)},set:function(t){this[fr].set_(e,t)}}}function pS(e){Nu(nm.prototype,""+e,m6(e))}function y6(e){if(e>G0){for(var r=G0;r<e+100;r++)pS(r);G0=e}}y6(1e3);function gS(e,r,t){return new nm(e,r,t)}function Mu(e,r){if(typeof e=="object"&&e!==null){if(Vo(e))return r!==void 0&&kr(23),e[fr].atom_;if(ba(e))return e.atom_;if(ao(e)){if(r===void 0)return e.keysAtom_;var t=e.data_.get(r)||e.hasMap_.get(r);return t||kr(25,r,T1(e)),t}if(Ra(e)){if(!r)return kr(26);var n=e[fr].values_.get(r);return n||kr(27,r,T1(e)),n}if(U2(e)||Lf(e)||k1(e))return e}else if(qs(e)&&k1(e[fr]))return e[fr];kr(28)}function Zl(e,r){if(e||kr(29),r!==void 0)return Zl(Mu(e,r));if(U2(e)||Lf(e)||k1(e)||ao(e)||ba(e))return e;if(e[fr])return e[fr];kr(24,e)}function T1(e,r){var t;if(r!==void 0)t=Mu(e,r);else{if(xh(e))return e.name;Ra(e)||ao(e)||ba(e)?t=Zl(e):t=Mu(e)}return t.name_}function ef(e){var r=Rf(),t=V1(!0);ps();try{return e()}finally{gs(),G1(t),fc(r)}}var My=bp.toString;function im(e,r,t){return t===void 0&&(t=-1),x2(e,r,t)}function x2(e,r,t,n,a){if(e===r)return e!==0||1/e===1/r;if(e==null||r==null)return!1;if(e!==e)return r!==r;var i=typeof e;if(i!=="function"&&i!=="object"&&typeof r!="object")return!1;var o=My.call(e);if(o!==My.call(r))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+r;case"[object Number]":return+e!=+e?+r!=+r:+e==0?1/+e===1/r:+e==+r;case"[object Date]":case"[object Boolean]":return+e==+r;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(r);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Iy(e),r=Iy(r);var s=o==="[object Array]";if(!s){if(typeof e!="object"||typeof r!="object")return!1;var u=e.constructor,c=r.constructor;if(u!==c&&!(qs(u)&&u instanceof u&&qs(c)&&c instanceof c)&&"constructor"in e&&"constructor"in r)return!1}if(t===0)return!1;t<0&&(t=-1),n=n||[],a=a||[];for(var h=n.length;h--;)if(n[h]===e)return a[h]===r;if(n.push(e),a.push(r),s){if(h=e.length,h!==r.length)return!1;for(;h--;)if(!x2(e[h],r[h],t-1,n,a))return!1}else{var v=Object.keys(e),g=v.length;if(Object.keys(r).length!==g)return!1;for(var f=0;f<g;f++){var E=v[f];if(!(cc(r,E)&&x2(e[E],r[E],t-1,n,a)))return!1}}return n.pop(),a.pop(),!0}function Iy(e){return Vo(e)?e.slice():Th(e)||ao(e)||uc(e)||ba(e)?Array.from(e.entries()):e}var jy,vS=((jy=q1().Iterator)==null?void 0:jy.prototype)||{};function am(e){return e[Symbol.iterator]=mS,Object.assign(Object.create(vS),e)}function mS(){return this}["Symbol","Map","Set"].forEach(function(e){var r=q1();typeof r[e]>"u"&&kr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$w,extras:{getDebugName:T1},$mobx:fr});const yS=Object.freeze(Object.defineProperty({__proto__:null,$mobx:fr,FlowCancellationError:$1,ObservableMap:Z1,ObservableSet:rm,Reaction:Kl,_allowStateChanges:V2,_allowStateChangesInsideComputed:Sh,_allowStateReadsEnd:ph,_allowStateReadsStart:W1,_autoAction:_h,_endAction:Fw,_getAdministration:Zl,_getGlobalState:zw,_interceptReads:K2,_isComputingDerivation:p9,_resetGlobalState:y9,_startAction:jw,action:ca,autorun:$2,comparer:Cf,computed:Tf,configure:r6,createAtom:fp,defineProperty:J2,entries:c6,extendObservable:X2,flow:Nf,flowResult:H9,get:Y9,getAtom:Mu,getDebugName:T1,getDependencyTree:n6,getObserverTree:D9,has:f6,intercept:Y1,isAction:xh,isBoxedObservable:G2,isComputed:W9,isComputedProp:s6,isFlow:Eh,isFlowCancellationError:z9,isObservable:X1,isObservableArray:Vo,isObservableMap:ao,isObservableObject:Ra,isObservableProp:u6,isObservableSet:ba,keys:hp,makeAutoObservable:rS,makeObservable:em,observable:jn,observe:K1,onBecomeObserved:e6,onBecomeUnobserved:Y2,onReactionError:E9,override:C7,ownKeys:h6,reaction:Jw,remove:$9,runInAction:Sh,set:Q2,spy:$w,toJS:Z9,trace:Q9,transaction:Cu,untracked:W2,values:Z2,when:S2},Symbol.toStringTag,{value:"Module"}));if(!ii.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!em)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var b6=vw();function bS(e){e()}function w6(e){e||(e=bS),r6({reactionScheduler:e})}var wS=function(){return!0};function _S(e){return n6(e)}var _6=!1;function S6(e){_6=e}function om(){return _6}var SS=1e4,xS=1e4,ES=function(){function e(r){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=SS),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(i,o){a-i.registeredAt>=n&&(t.finalize(i.value),t.registrations.delete(o))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.registrations.delete(r)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,xS))}}),e}(),PS=typeof FinalizationRegistry<"u"?FinalizationRegistry:ES,R1=new PS(function(e){var r;(r=e.reaction)===null||r===void 0||r.dispose(),e.reaction=null}),W0={exports:{}},$0={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* use-sync-external-store-shim.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var Fy;function OS(){if(Fy)return $0;Fy=1;var e=ai();function r(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var t=typeof Object.is=="function"?Object.is:r,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function s(v,g){var f=g(),E=n({inst:{value:f,getSnapshot:g}}),S=E[0].inst,w=E[1];return i(function(){S.value=f,S.getSnapshot=g,u(S)&&w({inst:S})},[v,f,g]),a(function(){return u(S)&&w({inst:S}),v(function(){u(S)&&w({inst:S})})},[v]),o(f),f}function u(v){var g=v.getSnapshot;v=v.value;try{var f=g();return!t(v,f)}catch{return!0}}function c(v,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return $0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,$0}var Dy;function AS(){return Dy||(Dy=1,W0.exports=OS()),W0.exports}var CS=AS();function By(e){e.reaction=new Kl("observer".concat(e.name),function(){var r;e.stateVersion=Symbol(),(r=e.onStoreChange)===null||r===void 0||r.call(e)})}function sm(e,r){if(r===void 0&&(r="observed"),om())return e();var t=$r.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:r,subscribe:function(s){return R1.unregister(n),n.onStoreChange=s,n.reaction||(By(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}};t.current=n}var a=t.current;a.reaction||(By(a),R1.register(t,a,a)),$r.useDebugValue(a.reaction,_S),CS.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var i,o;if(a.reaction.track(function(){try{i=e()}catch(s){o=s}}),o)throw o;return i}var Y0,X0,x6=typeof Symbol=="function"&&Symbol.for,kS=(X0=(Y0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Y0===void 0?void 0:Y0.configurable)!==null&&X0!==void 0?X0:!1,qy=x6?Symbol.for("react.forward_ref"):typeof ii.forwardRef=="function"&&ii.forwardRef(function(e){return null}).$$typeof,zy=x6?Symbol.for("react.memo"):typeof ii.memo=="function"&&ii.memo(function(e){return null}).$$typeof;function LS(e,r){var t;if(zy&&e.$$typeof===zy)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(om())return e;var n=(t=r?.forwardRef)!==null&&t!==void 0?t:!1,a=e,i=e.displayName||e.name;if(qy&&e.$$typeof===qy&&(n=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return sm(function(){return a(s,u)},i)};return o.displayName=e.displayName,kS&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=ii.forwardRef(o)),o=ii.memo(o),TS(e,o),o}var NS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function TS(e,r){Object.keys(e).forEach(function(t){NS[t]||Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}function E6(e){var r=e.children,t=e.render;r&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var n=r||t;return typeof n!="function"?null:sm(n)}E6.displayName="Observer";function RS(e,r){return ii.useState(function(){return jn(e(),r,{autoBind:!0})})[0]}function P6(e){var r=ii.useState(function(){return jn(e,{},{deep:!1})})[0];return Sh(function(){Object.assign(r,e)}),r}function MS(e,r){var t=r&&P6(r);return ii.useState(function(){return jn(e(t),void 0,{autoBind:!0})})[0]}var K0;w6(b6.unstable_batchedUpdates);var IS=(K0=R1.finalizeAllImmediately)!==null&&K0!==void 0?K0:function(){};function jS(e,r){return r===void 0&&(r="observed"),sm(e,r)}function FS(e){S6(e)}const DS=Object.freeze(Object.defineProperty({__proto__:null,Observer:E6,_observerFinalizationRegistry:R1,clearTimers:IS,enableStaticRendering:S6,isObserverBatched:wS,isUsingStaticRendering:om,observer:LS,observerBatching:w6,useAsObservableSource:P6,useLocalObservable:RS,useLocalStore:MS,useObserver:jS,useStaticRendering:FS},Symbol.toStringTag,{value:"Module"})),Us=Zc(DS);var yf={};const vs=Zc(yS);var m1={exports:{}},Zh={},Z0={},Q0={},Uy;function jr(){return Uy||(Uy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const r=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof bh<"u"?bh:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.22",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*r:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const n=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(Q0)),Q0}var J0={},Hy;function Li(){return Hy||(Hy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const r=jr();class t{constructor(m=[1,0,0,1,0,0]){this.dirty=!1,this.m=m&&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 t(this.m)}copyInto(m){m.m[0]=this.m[0],m.m[1]=this.m[1],m.m[2]=this.m[2],m.m[3]=this.m[3],m.m[4]=this.m[4],m.m[5]=this.m[5]}point(m){const P=this.m;return{x:P[0]*m.x+P[2]*m.y+P[4],y:P[1]*m.x+P[3]*m.y+P[5]}}translate(m,P){return this.m[4]+=this.m[0]*m+this.m[2]*P,this.m[5]+=this.m[1]*m+this.m[3]*P,this}scale(m,P){return this.m[0]*=m,this.m[1]*=m,this.m[2]*=P,this.m[3]*=P,this}rotate(m){const P=Math.cos(m),T=Math.sin(m),k=this.m[0]*P+this.m[2]*T,L=this.m[1]*P+this.m[3]*T,I=this.m[0]*-T+this.m[2]*P,R=this.m[1]*-T+this.m[3]*P;return this.m[0]=k,this.m[1]=L,this.m[2]=I,this.m[3]=R,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,P){const T=this.m[0]+this.m[2]*P,k=this.m[1]+this.m[3]*P,L=this.m[2]+this.m[0]*m,I=this.m[3]+this.m[1]*m;return this.m[0]=T,this.m[1]=k,this.m[2]=L,this.m[3]=I,this}multiply(m){const P=this.m[0]*m.m[0]+this.m[2]*m.m[1],T=this.m[1]*m.m[0]+this.m[3]*m.m[1],k=this.m[0]*m.m[2]+this.m[2]*m.m[3],L=this.m[1]*m.m[2]+this.m[3]*m.m[3],I=this.m[0]*m.m[4]+this.m[2]*m.m[5]+this.m[4],R=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=P,this.m[1]=T,this.m[2]=k,this.m[3]=L,this.m[4]=I,this.m[5]=R,this}invert(){const m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*m,T=-this.m[1]*m,k=-this.m[2]*m,L=this.m[0]*m,I=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),R=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=T,this.m[2]=k,this.m[3]=L,this.m[4]=I,this.m[5]=R,this}getMatrix(){return this.m}decompose(){const m=this.m[0],P=this.m[1],T=this.m[2],k=this.m[3],L=this.m[4],I=this.m[5],R=m*k-P*T,A={x:L,y:I,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||P!=0){const O=Math.sqrt(m*m+P*P);A.rotation=P>0?Math.acos(m/O):-Math.acos(m/O),A.scaleX=O,A.scaleY=R/O,A.skewX=(m*T+P*k)/R,A.skewY=0}else if(T!=0||k!=0){const O=Math.sqrt(T*T+k*k);A.rotation=Math.PI/2-(k>0?Math.acos(-T/O):-Math.acos(T/O)),A.scaleX=R/O,A.scaleY=O,A.skewX=0,A.skewY=(m*T+P*k)/R}return A.rotation=e.Util._getRotation(A.rotation),A}}e.Transform=t;const n="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,u=180/Math.PI,c="#",h="",v="0",g="Konva warning: ",f="Konva error: ",E="rgb(",S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},w=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let _=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(p){setTimeout(p,60)};e.Util={_isElement(p){return!!(p&&p.nodeType==1)},_isFunction(p){return!!(p&&p.constructor&&p.call&&p.apply)},_isPlainObject(p){return!!p&&p.constructor===Object},_isArray(p){return Object.prototype.toString.call(p)===n},_isNumber(p){return Object.prototype.toString.call(p)===a&&!isNaN(p)&&isFinite(p)},_isString(p){return Object.prototype.toString.call(p)===i},_isBoolean(p){return Object.prototype.toString.call(p)===o},isObject(p){return p instanceof Object},isValidSelector(p){if(typeof p!="string")return!1;const m=p[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(p){return p===0||p>0?1:-1},requestAnimFrame(p){_.push(p),_.length===1&&y(function(){const m=_;_=[],m.forEach(function(P){P()})})},createCanvasElement(){const p=document.createElement("canvas");try{p.style=p.style||{}}catch{}return p},createImageElement(){return document.createElement("img")},_isInDocument(p){for(;p=p.parentNode;)if(p==document)return!0;return!1},_urlToImage(p,m){const P=e.Util.createImageElement();P.onload=function(){m(P)},P.src=p},_rgbToHex(p,m,P){return((1<<24)+(p<<16)+(m<<8)+P).toString(16).slice(1)},_hexToRgb(p){p=p.replace(c,h);const m=parseInt(p,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){let p=(Math.random()*16777215<<0).toString(16);for(;p.length<6;)p=v+p;return c+p},getRGB(p){let m;return p in S?(m=S[p],{r:m[0],g:m[1],b:m[2]}):p[0]===c?this._hexToRgb(p.substring(1)):p.substr(0,4)===E?(m=w.exec(p.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[3],10)}):{r:0,g:0,b:0}},colorToRGBA(p){return p=p||"black",e.Util._namedColorToRBA(p)||e.Util._hex3ColorToRGBA(p)||e.Util._hex4ColorToRGBA(p)||e.Util._hex6ColorToRGBA(p)||e.Util._hex8ColorToRGBA(p)||e.Util._rgbColorToRGBA(p)||e.Util._rgbaColorToRGBA(p)||e.Util._hslColorToRGBA(p)},_namedColorToRBA(p){const m=S[p.toLowerCase()];return m?{r:m[0],g:m[1],b:m[2],a:1}:null},_rgbColorToRGBA(p){if(p.indexOf("rgb(")===0){p=p.match(/rgb\(([^)]+)\)/)[1];const m=p.split(/ *, */).map(Number);return{r:m[0],g:m[1],b:m[2],a:1}}},_rgbaColorToRGBA(p){if(p.indexOf("rgba(")===0){p=p.match(/rgba\(([^)]+)\)/)[1];const m=p.split(/ *, */).map((P,T)=>P.slice(-1)==="%"?T===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:m[0],g:m[1],b:m[2],a:m[3]}}},_hex8ColorToRGBA(p){if(p[0]==="#"&&p.length===9)return{r:parseInt(p.slice(1,3),16),g:parseInt(p.slice(3,5),16),b:parseInt(p.slice(5,7),16),a:parseInt(p.slice(7,9),16)/255}},_hex6ColorToRGBA(p){if(p[0]==="#"&&p.length===7)return{r:parseInt(p.slice(1,3),16),g:parseInt(p.slice(3,5),16),b:parseInt(p.slice(5,7),16),a:1}},_hex4ColorToRGBA(p){if(p[0]==="#"&&p.length===5)return{r:parseInt(p[1]+p[1],16),g:parseInt(p[2]+p[2],16),b:parseInt(p[3]+p[3],16),a:parseInt(p[4]+p[4],16)/255}},_hex3ColorToRGBA(p){if(p[0]==="#"&&p.length===4)return{r:parseInt(p[1]+p[1],16),g:parseInt(p[2]+p[2],16),b:parseInt(p[3]+p[3],16),a:1}},_hslColorToRGBA(p){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(p)){const[m,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(p),T=Number(P[0])/360,k=Number(P[1])/100,L=Number(P[2])/100;let I,R,A;if(k===0)return A=L*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};L<.5?I=L*(1+k):I=L+k-L*k;const O=2*L-I,M=[0,0,0];for(let q=0;q<3;q++)R=T+1/3*-(q-1),R<0&&R++,R>1&&R--,6*R<1?A=O+(I-O)*6*R:2*R<1?A=I:3*R<2?A=O+(I-O)*(2/3-R)*6:A=O,M[q]=A*255;return{r:Math.round(M[0]),g:Math.round(M[1]),b:Math.round(M[2]),a:1}}},haveIntersection(p,m){return!(m.x>p.x+p.width||m.x+m.width<p.x||m.y>p.y+p.height||m.y+m.height<p.y)},cloneObject(p){const m={};for(const P in p)this._isPlainObject(p[P])?m[P]=this.cloneObject(p[P]):this._isArray(p[P])?m[P]=this.cloneArray(p[P]):m[P]=p[P];return m},cloneArray(p){return p.slice(0)},degToRad(p){return p*s},radToDeg(p){return p*u},_degToRad(p){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(p)},_radToDeg(p){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(p)},_getRotation(p){return r.Konva.angleDeg?e.Util.radToDeg(p):p},_capitalize(p){return p.charAt(0).toUpperCase()+p.slice(1)},throw(p){throw new Error(f+p)},error(p){console.error(f+p)},warn(p){r.Konva.showWarnings&&console.warn(g+p)},each(p,m){for(const P in p)m(P,p[P])},_inRange(p,m,P){return m<=p&&p<P},_getProjectionToSegment(p,m,P,T,k,L){let I,R,A;const O=(p-P)*(p-P)+(m-T)*(m-T);if(O==0)I=p,R=m,A=(k-P)*(k-P)+(L-T)*(L-T);else{const M=((k-p)*(P-p)+(L-m)*(T-m))/O;M<0?(I=p,R=m,A=(p-k)*(p-k)+(m-L)*(m-L)):M>1?(I=P,R=T,A=(P-k)*(P-k)+(T-L)*(T-L)):(I=p+M*(P-p),R=m+M*(T-m),A=(I-k)*(I-k)+(R-L)*(R-L))}return[I,R,A]},_getProjectionToLine(p,m,P){const T=e.Util.cloneObject(p);let k=Number.MAX_VALUE;return m.forEach(function(L,I){if(!P&&I===m.length-1)return;const R=m[(I+1)%m.length],A=e.Util._getProjectionToSegment(L.x,L.y,R.x,R.y,p.x,p.y),O=A[0],M=A[1],q=A[2];q<k&&(T.x=O,T.y=M,k=q)}),T},_prepareArrayForTween(p,m,P){const T=[],k=[];if(p.length>m.length){const I=m;m=p,p=I}for(let I=0;I<p.length;I+=2)T.push({x:p[I],y:p[I+1]});for(let I=0;I<m.length;I+=2)k.push({x:m[I],y:m[I+1]});const L=[];return k.forEach(function(I){const R=e.Util._getProjectionToLine(I,T,P);L.push(R.x),L.push(R.y)}),L},_prepareToStringify(p){let m;p.visitedByCircularReferenceRemoval=!0;for(const P in p)if(p.hasOwnProperty(P)&&p[P]&&typeof p[P]=="object"){if(m=Object.getOwnPropertyDescriptor(p,P),p[P].visitedByCircularReferenceRemoval||e.Util._isElement(p[P]))if(m.configurable)delete p[P];else return null;else if(e.Util._prepareToStringify(p[P])===null)if(m.configurable)delete p[P];else return null}return delete p.visitedByCircularReferenceRemoval,p},_assign(p,m){for(const P in m)p[P]=m[P];return p},_getFirstPointerId(p){return p.touches?p.changedTouches[0].identifier:p.pointerId||999},releaseCanvas(...p){r.Konva.releaseCanvasOnDestroy&&p.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(p,m,P,T){let k=0,L=0,I=0,R=0;typeof T=="number"?k=L=I=R=Math.min(T,m/2,P/2):(k=Math.min(T[0]||0,m/2,P/2),L=Math.min(T[1]||0,m/2,P/2),R=Math.min(T[2]||0,m/2,P/2),I=Math.min(T[3]||0,m/2,P/2)),p.moveTo(k,0),p.lineTo(m-L,0),p.arc(m-L,L,L,Math.PI*3/2,0,!1),p.lineTo(m,P-R),p.arc(m-R,P-R,R,0,Math.PI/2,!1),p.lineTo(I,P),p.arc(I,P-I,I,Math.PI/2,Math.PI,!1),p.lineTo(0,k),p.arc(k,k,k,Math.PI,Math.PI*3/2,!1)}}}(J0)),J0}var Qh={},ec={},tc={},Vy;function O6(){if(Vy)return tc;Vy=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.HitContext=tc.SceneContext=tc.Context=void 0;const e=Li(),r=jr();function t(_){const y=[],p=_.length,m=e.Util;for(let P=0;P<p;P++){let T=_[P];m._isNumber(T)?T=Math.round(T*1e3)/1e3:m._isString(T)||(T=T+""),y.push(T)}return y}const n=",",a="(",i=")",o="([",s="])",u=";",c="()",h="=",v=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],g=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],f=100;let E=class{constructor(y){this.canvas=y,r.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(y){y.fillEnabled()&&this._fill(y)}_fill(y){}strokeShape(y){y.hasStroke()&&this._stroke(y)}_stroke(y){}fillStrokeShape(y){y.attrs.fillAfterStrokeEnabled?(this.strokeShape(y),this.fillShape(y)):(this.fillShape(y),this.strokeShape(y))}getTrace(y,p){let m=this.traceArr,P=m.length,T="",k,L,I,R;for(k=0;k<P;k++)L=m[k],I=L.method,I?(R=L.args,T+=I,y?T+=c:e.Util._isArray(R[0])?T+=o+R.join(n)+s:(p&&(R=R.map(A=>typeof A=="number"?Math.floor(A):A)),T+=a+R.join(n)+i)):(T+=L.property,y||(T+=h+L.val)),T+=u;return T}clearTrace(){this.traceArr=[]}_trace(y){let p=this.traceArr,m;p.push(y),m=p.length,m>=f&&p.shift()}reset(){const y=this.getCanvas().getPixelRatio();this.setTransform(1*y,0,0,1*y,0,0)}getCanvas(){return this.canvas}clear(y){const p=this.getCanvas();y?this.clearRect(y.x||0,y.y||0,y.width||0,y.height||0):this.clearRect(0,0,p.getWidth()/p.pixelRatio,p.getHeight()/p.pixelRatio)}_applyLineCap(y){const p=y.attrs.lineCap;p&&this.setAttr("lineCap",p)}_applyOpacity(y){const p=y.getAbsoluteOpacity();p!==1&&this.setAttr("globalAlpha",p)}_applyLineJoin(y){const p=y.attrs.lineJoin;p&&this.setAttr("lineJoin",p)}setAttr(y,p){this._context[y]=p}arc(y,p,m,P,T,k){this._context.arc(y,p,m,P,T,k)}arcTo(y,p,m,P,T){this._context.arcTo(y,p,m,P,T)}beginPath(){this._context.beginPath()}bezierCurveTo(y,p,m,P,T,k){this._context.bezierCurveTo(y,p,m,P,T,k)}clearRect(y,p,m,P){this._context.clearRect(y,p,m,P)}clip(...y){this._context.clip.apply(this._context,y)}closePath(){this._context.closePath()}createImageData(y,p){const m=arguments;if(m.length===2)return this._context.createImageData(y,p);if(m.length===1)return this._context.createImageData(y)}createLinearGradient(y,p,m,P){return this._context.createLinearGradient(y,p,m,P)}createPattern(y,p){return this._context.createPattern(y,p)}createRadialGradient(y,p,m,P,T,k){return this._context.createRadialGradient(y,p,m,P,T,k)}drawImage(y,p,m,P,T,k,L,I,R){const A=arguments,O=this._context;A.length===3?O.drawImage(y,p,m):A.length===5?O.drawImage(y,p,m,P,T):A.length===9&&O.drawImage(y,p,m,P,T,k,L,I,R)}ellipse(y,p,m,P,T,k,L,I){this._context.ellipse(y,p,m,P,T,k,L,I)}isPointInPath(y,p,m,P){return m?this._context.isPointInPath(m,y,p,P):this._context.isPointInPath(y,p,P)}fill(...y){this._context.fill.apply(this._context,y)}fillRect(y,p,m,P){this._context.fillRect(y,p,m,P)}strokeRect(y,p,m,P){this._context.strokeRect(y,p,m,P)}fillText(y,p,m,P){P?this._context.fillText(y,p,m,P):this._context.fillText(y,p,m)}measureText(y){return this._context.measureText(y)}getImageData(y,p,m,P){return this._context.getImageData(y,p,m,P)}lineTo(y,p){this._context.lineTo(y,p)}moveTo(y,p){this._context.moveTo(y,p)}rect(y,p,m,P){this._context.rect(y,p,m,P)}roundRect(y,p,m,P,T){this._context.roundRect(y,p,m,P,T)}putImageData(y,p,m){this._context.putImageData(y,p,m)}quadraticCurveTo(y,p,m,P){this._context.quadraticCurveTo(y,p,m,P)}restore(){this._context.restore()}rotate(y){this._context.rotate(y)}save(){this._context.save()}scale(y,p){this._context.scale(y,p)}setLineDash(y){this._context.setLineDash?this._context.setLineDash(y):"mozDash"in this._context?this._context.mozDash=y:"webkitLineDash"in this._context&&(this._context.webkitLineDash=y)}getLineDash(){return this._context.getLineDash()}setTransform(y,p,m,P,T,k){this._context.setTransform(y,p,m,P,T,k)}stroke(y){y?this._context.stroke(y):this._context.stroke()}strokeText(y,p,m,P){this._context.strokeText(y,p,m,P)}transform(y,p,m,P,T,k){this._context.transform(y,p,m,P,T,k)}translate(y,p){this._context.translate(y,p)}_enableTrace(){let y=this,p=v.length,m=this.setAttr,P,T;const k=function(L){let I=y[L],R;y[L]=function(){return T=t(Array.prototype.slice.call(arguments,0)),R=I.apply(y,arguments),y._trace({method:L,args:T}),R}};for(P=0;P<p;P++)k(v[P]);y.setAttr=function(){m.apply(y,arguments);const L=arguments[0];let I=arguments[1];(L==="shadowOffsetX"||L==="shadowOffsetY"||L==="shadowBlur")&&(I=I/this.canvas.getPixelRatio()),y._trace({property:L,val:I})}}_applyGlobalCompositeOperation(y){const p=y.attrs.globalCompositeOperation;!p||p==="source-over"||this.setAttr("globalCompositeOperation",p)}};tc.Context=E,g.forEach(function(_){Object.defineProperty(E.prototype,_,{get(){return this._context[_]},set(y){this._context[_]=y}})});class S extends E{constructor(y,{willReadFrequently:p=!1}={}){super(y),this._context=y._canvas.getContext("2d",{willReadFrequently:p})}_fillColor(y){const p=y.fill();this.setAttr("fillStyle",p),y._fillFunc(this)}_fillPattern(y){this.setAttr("fillStyle",y._getFillPattern()),y._fillFunc(this)}_fillLinearGradient(y){const p=y._getLinearGradient();p&&(this.setAttr("fillStyle",p),y._fillFunc(this))}_fillRadialGradient(y){const p=y._getRadialGradient();p&&(this.setAttr("fillStyle",p),y._fillFunc(this))}_fill(y){const p=y.fill(),m=y.getFillPriority();if(p&&m==="color"){this._fillColor(y);return}const P=y.getFillPatternImage();if(P&&m==="pattern"){this._fillPattern(y);return}const T=y.getFillLinearGradientColorStops();if(T&&m==="linear-gradient"){this._fillLinearGradient(y);return}const k=y.getFillRadialGradientColorStops();if(k&&m==="radial-gradient"){this._fillRadialGradient(y);return}p?this._fillColor(y):P?this._fillPattern(y):T?this._fillLinearGradient(y):k&&this._fillRadialGradient(y)}_strokeLinearGradient(y){const p=y.getStrokeLinearGradientStartPoint(),m=y.getStrokeLinearGradientEndPoint(),P=y.getStrokeLinearGradientColorStops(),T=this.createLinearGradient(p.x,p.y,m.x,m.y);if(P){for(let k=0;k<P.length;k+=2)T.addColorStop(P[k],P[k+1]);this.setAttr("strokeStyle",T)}}_stroke(y){const p=y.dash(),m=y.getStrokeScaleEnabled();if(y.hasStroke()){if(!m){this.save();const T=this.getCanvas().getPixelRatio();this.setTransform(T,0,0,T,0,0)}this._applyLineCap(y),p&&y.dashEnabled()&&(this.setLineDash(p),this.setAttr("lineDashOffset",y.dashOffset())),this.setAttr("lineWidth",y.strokeWidth()),y.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),y.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(y):this.setAttr("strokeStyle",y.stroke()),y._strokeFunc(this),m||this.restore()}}_applyShadow(y){var p,m,P;const T=(p=y.getShadowRGBA())!==null&&p!==void 0?p:"black",k=(m=y.getShadowBlur())!==null&&m!==void 0?m:5,L=(P=y.getShadowOffset())!==null&&P!==void 0?P:{x:0,y:0},I=y.getAbsoluteScale(),R=this.canvas.getPixelRatio(),A=I.x*R,O=I.y*R;this.setAttr("shadowColor",T),this.setAttr("shadowBlur",k*Math.min(Math.abs(A),Math.abs(O))),this.setAttr("shadowOffsetX",L.x*A),this.setAttr("shadowOffsetY",L.y*O)}}tc.SceneContext=S;class w extends E{constructor(y){super(y),this._context=y._canvas.getContext("2d",{willReadFrequently:!0})}_fill(y){this.save(),this.setAttr("fillStyle",y.colorKey),y._fillFuncHit(this),this.restore()}strokeShape(y){y.hasHitStroke()&&this._stroke(y)}_stroke(y){if(y.hasHitStroke()){const p=y.getStrokeScaleEnabled();if(!p){this.save();const T=this.getCanvas().getPixelRatio();this.setTransform(T,0,0,T,0,0)}this._applyLineCap(y);const m=y.hitStrokeWidth(),P=m==="auto"?y.strokeWidth():m;this.setAttr("lineWidth",P),this.setAttr("strokeStyle",y.colorKey),y._strokeFuncHit(this),p||this.restore()}}}return tc.HitContext=w,tc}var Gy;function Q1(){if(Gy)return ec;Gy=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.HitCanvas=ec.SceneCanvas=ec.Canvas=void 0;const e=Li(),r=O6(),t=jr();let n;function a(){if(n)return n;const u=e.Util.createCanvasElement(),c=u.getContext("2d");return n=function(){const h=t.Konva._global.devicePixelRatio||1,v=c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1;return h/v}(),e.Util.releaseCanvas(u),n}let i=class{constructor(c){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const v=(c||{}).pixelRatio||t.Konva.pixelRatio||a();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(c){const h=this.pixelRatio;this.pixelRatio=c,this.setSize(this.getWidth()/h,this.getHeight()/h)}setWidth(c){this.width=this._canvas.width=c*this.pixelRatio,this._canvas.style.width=c+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}setHeight(c){this.height=this._canvas.height=c*this.pixelRatio,this._canvas.style.height=c+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}getWidth(){return this.width}getHeight(){return this.height}setSize(c,h){this.setWidth(c||0),this.setHeight(h||0)}toDataURL(c,h){try{return this._canvas.toDataURL(c,h)}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."),""}}}};ec.Canvas=i;class o extends i{constructor(c={width:0,height:0,willReadFrequently:!1}){super(c),this.context=new r.SceneContext(this,{willReadFrequently:c.willReadFrequently}),this.setSize(c.width,c.height)}}ec.SceneCanvas=o;class s extends i{constructor(c={width:0,height:0}){super(c),this.hitCanvas=!0,this.context=new r.HitContext(this),this.setSize(c.width,c.height)}}return ec.HitCanvas=s,ec}var eg={},Wy;function lm(){return Wy||(Wy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const r=jr(),t=Li();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(a=>{n=a.node}),n},_dragElements:new Map,_drag(n){const a=[];e.DD._dragElements.forEach((i,o)=>{const{node:s}=i,u=s.getStage();u.setPointersPositions(n),i.pointerId===void 0&&(i.pointerId=t.Util._getFirstPointerId(n));const c=u._changedPointerPositions.find(h=>h.id===i.pointerId);if(c){if(i.dragStatus!=="dragging"){const h=s.dragDistance();if(Math.max(Math.abs(c.x-i.startPointerPos.x),Math.abs(c.y-i.startPointerPos.y))<h||(s.startDrag({evt:n}),!s.isDragging()))return}s._setDragPosition(n,i),a.push(s)}}),a.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:n},!0)})},_endDragBefore(n){const a=[];e.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(n&&s.setPointersPositions(n),!s._changedPointerPositions.find(h=>h.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(e.DD.justDragged=!0,r.Konva._mouseListenClick=!1,r.Konva._touchListenClick=!1,r.Konva._pointerListenClick=!1,i.dragStatus="stopped");const c=i.node.getLayer()||i.node instanceof r.Konva.Stage&&i.node;c&&a.indexOf(c)===-1&&a.push(c)}),a.forEach(i=>{i.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:n},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(i)})}},r.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(eg)),eg}var tg={},ds={},$y;function Yr(){if($y)return ds;$y=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.RGBComponent=n,ds.alphaComponent=a,ds.getNumberValidator=i,ds.getNumberOrArrayOfNumbersValidator=o,ds.getNumberOrAutoValidator=s,ds.getStringValidator=u,ds.getStringOrGradientValidator=c,ds.getFunctionValidator=h,ds.getNumberArrayValidator=v,ds.getBooleanValidator=g,ds.getComponentValidator=f;const e=jr(),r=Li();function t(E){return r.Util._isString(E)?'"'+E+'"':Object.prototype.toString.call(E)==="[object Number]"||r.Util._isBoolean(E)?E:Object.prototype.toString.call(E)}function n(E){return E>255?255:E<0?0:Math.round(E)}function a(E){return E>1?1:E<1e-4?1e-4:E}function i(){if(e.Konva.isUnminified)return function(E,S){return r.Util._isNumber(E)||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a number.'),E}}function o(E){if(e.Konva.isUnminified)return function(S,w){let _=r.Util._isNumber(S),y=r.Util._isArray(S)&&S.length==E;return!_&&!y&&r.Util.warn(t(S)+' is a not valid value for "'+w+'" attribute. The value should be a number or Array<number>('+E+")"),S}}function s(){if(e.Konva.isUnminified)return function(E,S){return r.Util._isNumber(E)||E==="auto"||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a number or "auto".'),E}}function u(){if(e.Konva.isUnminified)return function(E,S){return r.Util._isString(E)||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a string.'),E}}function c(){if(e.Konva.isUnminified)return function(E,S){const w=r.Util._isString(E),_=Object.prototype.toString.call(E)==="[object CanvasGradient]"||E&&E.addColorStop;return w||_||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a string or a native gradient.'),E}}function h(){if(e.Konva.isUnminified)return function(E,S){return r.Util._isFunction(E)||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a function.'),E}}function v(){if(e.Konva.isUnminified)return function(E,S){const w=Int8Array?Object.getPrototypeOf(Int8Array):null;return w&&E instanceof w||(r.Util._isArray(E)?E.forEach(function(_){r.Util._isNumber(_)||r.Util.warn('"'+S+'" attribute has non numeric element '+_+". Make sure that all elements are numbers.")}):r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a array of numbers.')),E}}function g(){if(e.Konva.isUnminified)return function(E,S){return E===!0||E===!1||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a boolean.'),E}}function f(E){if(e.Konva.isUnminified)return function(S,w){return S==null||r.Util.isObject(S)||r.Util.warn(t(S)+' is a not valid value for "'+w+'" attribute. The value should be an object with properties '+E),S}}return ds}var Yy;function Gr(){return Yy||(Yy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const r=Li(),t=Yr(),n="get",a="set";e.Factory={addGetterSetter(i,o,s,u,c){e.Factory.addGetter(i,o,s),e.Factory.addSetter(i,o,u,c),e.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){const u=n+r.Util._capitalize(o);i.prototype[u]=i.prototype[u]||function(){const c=this.attrs[o];return c===void 0?s:c}},addSetter(i,o,s,u){const c=a+r.Util._capitalize(o);i.prototype[c]||e.Factory.overWriteSetter(i,o,s,u)},overWriteSetter(i,o,s,u){const c=a+r.Util._capitalize(o);i.prototype[c]=function(h){return s&&h!==void 0&&h!==null&&(h=s.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(i,o,s,u,c){const h=s.length,v=r.Util._capitalize,g=n+v(o),f=a+v(o);i.prototype[g]=function(){const S={};for(let w=0;w<h;w++){const _=s[w];S[_]=this.getAttr(o+v(_))}return S};const E=(0,t.getComponentValidator)(s);i.prototype[f]=function(S){const w=this.attrs[o];u&&(S=u.call(this,S,o)),E&&E.call(this,S,o);for(const _ in S)S.hasOwnProperty(_)&&this._setAttr(o+v(_),S[_]);return S||s.forEach(_=>{this._setAttr(o+v(_),void 0)}),this._fireChangeEvent(o,w,S),c&&c.call(this),this},e.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){const s=r.Util._capitalize(o),u=a+s,c=n+s;i.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[c]()}},addDeprecatedGetterSetter(i,o,s,u){r.Util.error("Adding deprecated "+o);const c=n+r.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[c]=function(){r.Util.error(h);const v=this.attrs[o];return v===void 0?s:v},e.Factory.addSetter(i,o,u,function(){r.Util.error(h)}),e.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){r.Util.each(o,function(s,u){const c=i.prototype[u],h=n+r.Util._capitalize(s),v=a+r.Util._capitalize(s);function g(){c.apply(this,arguments),r.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}i.prototype[s]=g,i.prototype[h]=g,i.prototype[v]=g})},afterSetFilter(){this._filterUpToDate=!1}}}(tg)),tg}var Xy;function Ji(){if(Xy)return Qh;Xy=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.Node=void 0;const e=Q1(),r=lm(),t=Gr(),n=jr(),a=Li(),i=Yr(),o="absoluteOpacity",s="allEventListeners",u="absoluteTransform",c="absoluteScale",h="canvas",v="Change",g="children",f="konva",E="listening",S="mouseenter",w="mouseleave",_="pointerenter",y="pointerleave",p="touchenter",m="touchleave",P="set",T="Shape",k=" ",L="stage",I="transform",R="Stage",A="visible",O=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(k);let M=1;class q{constructor(H){this._id=M++,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===I||H===u)&&this._cache.get(H)?this._cache.get(H).dirty=!0:H?this._cache.delete(H):this._cache.clear()}_getCache(H,B){let $=this._cache.get(H);return($===void 0||(H===I||H===u)&&$.dirty===!0)&&($=B.call(this),this._cache.set(H,$)),$}_calculate(H,B,$){if(!this._attachedDepsListeners.get(H)){const V=B.map(j=>j+"Change.konva").join(k);this.on(V,()=>{this._clearCache(H)}),this._attachedDepsListeners.set(H,!0)}return this._getCache(H,$)}_getCanvasCache(){return this._cache.get(h)}_clearSelfAndDescendantCache(H){this._clearCache(H),H===u&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(h)){const{scene:H,filter:B,hit:$,buffer:V}=this._cache.get(h);a.Util.releaseCanvas(H,B,$,V),this._cache.delete(h)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(H){const B=H||{};let $={};(B.x===void 0||B.y===void 0||B.width===void 0||B.height===void 0)&&($=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let V=Math.ceil(B.width||$.width),j=Math.ceil(B.height||$.height),z=B.pixelRatio,F=B.x===void 0?Math.floor($.x):B.x,Y=B.y===void 0?Math.floor($.y):B.y,J=B.offset||0,X=B.drawBorder||!1,Q=B.hitCanvasPixelRatio||1;if(!V||!j){a.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ae=Math.abs(Math.round($.x)-F)>.5?1:0,se=Math.abs(Math.round($.y)-Y)>.5?1:0;V+=J*2+ae,j+=J*2+se,F-=J,Y-=J;const fe=new e.SceneCanvas({pixelRatio:z,width:V,height:j}),be=new e.SceneCanvas({pixelRatio:z,width:0,height:0,willReadFrequently:!0}),_e=new e.HitCanvas({pixelRatio:Q,width:V,height:j}),Ae=fe.getContext(),Re=_e.getContext(),Pe=new e.SceneCanvas({width:fe.width/fe.pixelRatio+Math.abs(F),height:fe.height/fe.pixelRatio+Math.abs(Y),pixelRatio:fe.pixelRatio}),ye=Pe.getContext();return _e.isCache=!0,fe.isCache=!0,this._cache.delete(h),this._filterUpToDate=!1,B.imageSmoothingEnabled===!1&&(fe.getContext()._context.imageSmoothingEnabled=!1,be.getContext()._context.imageSmoothingEnabled=!1),Ae.save(),Re.save(),ye.save(),Ae.translate(-F,-Y),Re.translate(-F,-Y),ye.translate(-F,-Y),Pe.x=F,Pe.y=Y,this._isUnderCache=!0,this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(c),this.drawScene(fe,this,Pe),this.drawHit(_e,this),this._isUnderCache=!1,Ae.restore(),Re.restore(),X&&(Ae.save(),Ae.beginPath(),Ae.rect(0,0,V,j),Ae.closePath(),Ae.setAttr("strokeStyle","red"),Ae.setAttr("lineWidth",5),Ae.stroke(),Ae.restore()),this._cache.set(h,{scene:fe,filter:be,hit:_e,buffer:Pe,x:F,y:Y}),this._requestDraw(),this}isCached(){return this._cache.has(h)}getClientRect(H){throw new Error('abstract "getClientRect" method call')}_transformedRect(H,B){const $=[{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 V=1/0,j=1/0,z=-1/0,F=-1/0;const Y=this.getAbsoluteTransform(B);return $.forEach(function(J){const X=Y.point(J);V===void 0&&(V=z=X.x,j=F=X.y),V=Math.min(V,X.x),j=Math.min(j,X.y),z=Math.max(z,X.x),F=Math.max(F,X.y)}),{x:V,y:j,width:z-V,height:F-j}}_drawCachedSceneCanvas(H){H.save(),H._applyOpacity(this),H._applyGlobalCompositeOperation(this);const B=this._getCanvasCache();H.translate(B.x,B.y);const $=this._getCachedSceneCanvas(),V=$.pixelRatio;H.drawImage($._canvas,0,0,$.width/V,$.height/V),H.restore()}_drawCachedHitCanvas(H){const B=this._getCanvasCache(),$=B.hit;H.save(),H.translate(B.x,B.y),H.drawImage($._canvas,0,0,$.width/$.pixelRatio,$.height/$.pixelRatio),H.restore()}_getCachedSceneCanvas(){let H=this.filters(),B=this._getCanvasCache(),$=B.scene,V=B.filter,j=V.getContext(),z,F,Y,J;if(H){if(!this._filterUpToDate){const X=$.pixelRatio;V.setSize($.width/$.pixelRatio,$.height/$.pixelRatio);try{for(z=H.length,j.clear(),j.drawImage($._canvas,0,0,$.getWidth()/X,$.getHeight()/X),F=j.getImageData(0,0,V.getWidth(),V.getHeight()),Y=0;Y<z;Y++){if(J=H[Y],typeof J!="function"){a.Util.error("Filter should be type of function, but got "+typeof J+" instead. Please check correct filters");continue}J.call(this,F),j.putImageData(F,0,0)}}catch(Q){a.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 V}return $}on(H,B){if(this._cache&&this._cache.delete(s),arguments.length===3)return this._delegate.apply(this,arguments);const $=H.split(k);for(let V=0;V<$.length;V++){const z=$[V].split("."),F=z[0],Y=z[1]||"";this.eventListeners[F]||(this.eventListeners[F]=[]),this.eventListeners[F].push({name:Y,handler:B})}return this}off(H,B){let $=(H||"").split(k),V=$.length,j,z,F,Y,J,X;if(this._cache&&this._cache.delete(s),!H)for(z in this.eventListeners)this._off(z);for(j=0;j<V;j++)if(F=$[j],Y=F.split("."),J=Y[0],X=Y[1],J)this.eventListeners[J]&&this._off(J,X,B);else for(z in this.eventListeners)this._off(z,X,B);return this}dispatchEvent(H){const B={target:this,type:H.type,evt:H};return this.fire(H.type,B),this}addEventListener(H,B){return this.on(H,function($){B.call(this,$.evt)}),this}removeEventListener(H){return this.off(H),this}_delegate(H,B,$){const V=this;this.on(H,function(j){const z=j.target.findAncestors(B,!0,V);for(let F=0;F<z.length;F++)j=a.Util.cloneObject(j),j.currentTarget=z[F],$.call(z[F],j)})}remove(){return this.isDragging()&&this.stopDrag(),r.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(c),this._clearSelfAndDescendantCache(L),this._clearSelfAndDescendantCache(A),this._clearSelfAndDescendantCache(E)}_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 B="get"+a.Util._capitalize(H);return a.Util._isFunction(this[B])?this[B]():this.attrs[H]}getAncestors(){let H=this.getParent(),B=[];for(;H;)B.push(H),H=H.getParent();return B}getAttrs(){return this.attrs||{}}setAttrs(H){return this._batchTransformChanges(()=>{let B,$;if(!H)return this;for(B in H)B!==g&&($=P+a.Util._capitalize(B),a.Util._isFunction(this[$])?this[$](H[B]):this._setAttr(B,H[B]))}),this}isListening(){return this._getCache(E,this._isListening)}_isListening(H){if(!this.listening())return!1;const $=this.getParent();return $&&$!==H&&this!==H?$._isListening(H):!0}isVisible(){return this._getCache(A,this._isVisible)}_isVisible(H){if(!this.visible())return!1;const $=this.getParent();return $&&$!==H&&this!==H?$._isVisible(H):!0}shouldDrawHit(H,B=!1){if(H)return this._isVisible(H)&&this._isListening(H);const $=this.getLayer();let V=!1;r.DD._dragElements.forEach(z=>{z.dragStatus==="dragging"&&(z.node.nodeType==="Stage"||z.node.getLayer()===$)&&(V=!0)});const j=!B&&!n.Konva.hitOnDragEnabled&&(V||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!j}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let H=this.getDepth(),B=this,$=0,V,j,z,F;function Y(X){for(V=[],j=X.length,z=0;z<j;z++)F=X[z],$++,F.nodeType!==T&&(V=V.concat(F.getChildren().slice())),F._id===B._id&&(z=j);V.length>0&&V[0].getDepth()<=H&&Y(V)}const J=this.getStage();return B.nodeType!==R&&J&&Y(J.getChildren()),$}getDepth(){let H=0,B=this.parent;for(;B;)H++,B=B.parent;return H}_batchTransformChanges(H){this._batchingTransformChange=!0,H(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(I),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 B=H.getPointerPosition();if(!B)return null;const $=this.getAbsoluteTransform().copy();return $.invert(),$.point(B)}getAbsolutePosition(H){let B=!1,$=this.parent;for(;$;){if($.isCached()){B=!0;break}$=$.parent}B&&!H&&(H=!0);const V=this.getAbsoluteTransform(H).getMatrix(),j=new a.Transform,z=this.offset();return j.m=V.slice(),j.translate(z.x,z.y),j.getTranslation()}setAbsolutePosition(H){const{x:B,y:$,...V}=this._clearTransform();this.attrs.x=B,this.attrs.y=$,this._clearCache(I);const j=this._getAbsoluteTransform().copy();return j.invert(),j.translate(H.x,H.y),H={x:this.attrs.x+j.getTranslation().x,y:this.attrs.y+j.getTranslation().y},this._setTransform(V),this.setPosition({x:H.x,y:H.y}),this._clearCache(I),this._clearSelfAndDescendantCache(u),this}_setTransform(H){let B;for(B in H)this.attrs[B]=H[B]}_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 B=H.x,$=H.y,V=this.x(),j=this.y();return B!==void 0&&(V+=B),$!==void 0&&(j+=$),this.setPosition({x:V,y:j}),this}_eachAncestorReverse(H,B){let $=[],V=this.getParent(),j,z;if(!(B&&B._id===this._id)){for($.unshift(this);V&&(!B||V._id!==B._id);)$.unshift(V),V=V.parent;for(j=$.length,z=0;z<j;z++)H($[z])}}rotate(H){return this.rotation(this.rotation()+H),this}moveToTop(){if(!this.parent)return a.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const H=this.index,B=this.parent.getChildren().length;return H<B-1?(this.parent.children.splice(H,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return a.Util.warn("Node has no parent. moveUp function is ignored."),!1;const H=this.index,B=this.parent.getChildren().length;return H<B-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 a.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 a.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 a.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(H<0||H>=this.parent.children.length)&&a.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 B=this.index;return this.parent.children.splice(B,1),this.parent.children.splice(H,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(o,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let H=this.opacity();const B=this.getParent();return B&&!B._isUnderCache&&(H*=B.getAbsoluteOpacity()),H}moveTo(H){return this.getParent()!==H&&(this._remove(),H.add(this)),this}toObject(){let H=this.getAttrs(),B,$,V,j,z;const F={attrs:{},className:this.getClassName()};for(B in H)$=H[B],z=a.Util.isObject($)&&!a.Util._isPlainObject($)&&!a.Util._isArray($),!z&&(V=typeof this[B]=="function"&&this[B],delete H[B],j=V?V.call(this):null,H[B]=$,j!==$&&(F.attrs[B]=$));return a.Util._prepareToStringify(F)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(H,B,$){const V=[];B&&this._isMatch(H)&&V.push(this);let j=this.parent;for(;j;){if(j===$)return V;j._isMatch(H)&&V.push(j),j=j.parent}return V}isAncestorOf(H){return!1}findAncestor(H,B,$){return this.findAncestors(H,B,$)[0]}_isMatch(H){if(!H)return!1;if(typeof H=="function")return H(this);let B=H.replace(/ /g,"").split(","),$=B.length,V,j;for(V=0;V<$;V++)if(j=B[V],a.Util.isValidSelector(j)||(a.Util.warn('Selector "'+j+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),a.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),a.Util.warn("Konva is awesome, right?")),j.charAt(0)==="#"){if(this.id()===j.slice(1))return!0}else if(j.charAt(0)==="."){if(this.hasName(j.slice(1)))return!0}else if(this.className===j||this.nodeType===j)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,B={},$){return B.target=B.target||this,$?this._fireAndBubble(H,B):this._fire(H,B),this}getAbsoluteTransform(H){return H?this._getAbsoluteTransform(H):this._getCache(u,this._getAbsoluteTransform)}_getAbsoluteTransform(H){let B;if(H)return B=new a.Transform,this._eachAncestorReverse(function($){const V=$.transformsEnabled();V==="all"?B.multiply($.getTransform()):V==="position"&&B.translate($.x()-$.offsetX(),$.y()-$.offsetY())},H),B;{B=this._cache.get(u)||new a.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(B):B.reset();const $=this.transformsEnabled();if($==="all")B.multiply(this.getTransform());else if($==="position"){const V=this.attrs.x||0,j=this.attrs.y||0,z=this.attrs.offsetX||0,F=this.attrs.offsetY||0;B.translate(V-z,j-F)}return B.dirty=!1,B}}getAbsoluteScale(H){let B=this;for(;B;)B._isUnderCache&&(H=B),B=B.getParent();const V=this.getAbsoluteTransform(H).decompose();return{x:V.scaleX,y:V.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(I,this._getTransform)}_getTransform(){var H,B;const $=this._cache.get(I)||new a.Transform;$.reset();const V=this.x(),j=this.y(),z=n.Konva.getAngle(this.rotation()),F=(H=this.attrs.scaleX)!==null&&H!==void 0?H:1,Y=(B=this.attrs.scaleY)!==null&&B!==void 0?B:1,J=this.attrs.skewX||0,X=this.attrs.skewY||0,Q=this.attrs.offsetX||0,ae=this.attrs.offsetY||0;return(V!==0||j!==0)&&$.translate(V,j),z!==0&&$.rotate(z),(J!==0||X!==0)&&$.skew(J,X),(F!==1||Y!==1)&&$.scale(F,Y),(Q!==0||ae!==0)&&$.translate(-1*Q,-1*ae),$.dirty=!1,$}clone(H){let B=a.Util.cloneObject(this.attrs),$,V,j,z,F;for($ in H)B[$]=H[$];const Y=new this.constructor(B);for($ in this.eventListeners)for(V=this.eventListeners[$],j=V.length,z=0;z<j;z++)F=V[z],F.name.indexOf(f)<0&&(Y.eventListeners[$]||(Y.eventListeners[$]=[]),Y.eventListeners[$].push(F));return Y}_toKonvaCanvas(H){H=H||{};const B=this.getClientRect(),$=this.getStage(),V=H.x!==void 0?H.x:Math.floor(B.x),j=H.y!==void 0?H.y:Math.floor(B.y),z=H.pixelRatio||1,F=new e.SceneCanvas({width:H.width||Math.ceil(B.width)||($?$.width():0),height:H.height||Math.ceil(B.height)||($?$.height():0),pixelRatio:z}),Y=F.getContext(),J=new e.SceneCanvas({width:F.width/F.pixelRatio+Math.abs(V),height:F.height/F.pixelRatio+Math.abs(j),pixelRatio:F.pixelRatio});return H.imageSmoothingEnabled===!1&&(Y._context.imageSmoothingEnabled=!1),Y.save(),(V||j)&&Y.translate(-1*V,-1*j),this.drawScene(F,void 0,J),Y.restore(),F}toCanvas(H){return this._toKonvaCanvas(H)._canvas}toDataURL(H){H=H||{};const B=H.mimeType||null,$=H.quality||null,V=this._toKonvaCanvas(H).toDataURL(B,$);return H.callback&&H.callback(V),V}toImage(H){return new Promise((B,$)=>{try{const V=H?.callback;V&&delete H.callback,a.Util._urlToImage(this.toDataURL(H),function(j){B(j),V?.(j)})}catch(V){$(V)}})}toBlob(H){return new Promise((B,$)=>{try{const V=H?.callback;V&&delete H.callback,this.toCanvas(H).toBlob(j=>{B(j),V?.(j)},H?.mimeType,H?.quality)}catch(V){$(V)}})}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,B,$){let V=this.eventListeners[H],j,z,F;for(j=0;j<V.length;j++)if(z=V[j].name,F=V[j].handler,(z!=="konva"||B==="konva")&&(!B||z===B)&&(!$||$===F)){if(V.splice(j,1),V.length===0){delete this.eventListeners[H];break}j--}}_fireChangeEvent(H,B,$){this._fire(H+v,{oldVal:B,newVal:$})}addName(H){if(!this.hasName(H)){const B=this.name(),$=B?B+" "+H:H;this.name($)}return this}hasName(H){if(!H)return!1;const B=this.name();return B?(B||"").split(/\s/g).indexOf(H)!==-1:!1}removeName(H){const B=(this.name()||"").split(/\s/g),$=B.indexOf(H);return $!==-1&&(B.splice($,1),this.name(B.join(" "))),this}setAttr(H,B){const $=this[P+a.Util._capitalize(H)];return a.Util._isFunction($)?$.call(this,B):this._setAttr(H,B),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const H=this.getLayer()||this.getStage();H?.batchDraw()}}_setAttr(H,B){const $=this.attrs[H];$===B&&!a.Util.isObject(B)||(B==null?delete this.attrs[H]:this.attrs[H]=B,this._shouldFireChangeEvents&&this._fireChangeEvent(H,$,B),this._requestDraw())}_setComponentAttr(H,B,$){let V;$!==void 0&&(V=this.attrs[H],V||(this.attrs[H]=this.getAttr(H)),this.attrs[H][B]=$,this._fireChangeEvent(H,V,$))}_fireAndBubble(H,B,$){B&&this.nodeType===T&&(B.target=this);const V=[S,w,_,y,p,m];if(!(V.indexOf(H)!==-1&&($&&(this===$||this.isAncestorOf&&this.isAncestorOf($))||this.nodeType==="Stage"&&!$))){this._fire(H,B);const z=V.indexOf(H)!==-1&&$&&$.isAncestorOf&&$.isAncestorOf(this)&&!$.isAncestorOf(this.parent);(B&&!B.cancelBubble||!B)&&this.parent&&this.parent.isListening()&&!z&&($&&$.parent?this._fireAndBubble.call(this.parent,H,B,$):this._fireAndBubble.call(this.parent,H,B))}}_getProtoListeners(H){var B,$,V;const j=(B=this._cache.get(s))!==null&&B!==void 0?B:{};let z=j?.[H];if(z===void 0){z=[];let F=Object.getPrototypeOf(this);for(;F;){const Y=(V=($=F.eventListeners)===null||$===void 0?void 0:$[H])!==null&&V!==void 0?V:[];z.push(...Y),F=Object.getPrototypeOf(F)}j[H]=z,this._cache.set(s,j)}return z}_fire(H,B){B=B||{},B.currentTarget=this,B.type=H;const $=this._getProtoListeners(H);if($)for(let j=0;j<$.length;j++)$[j].handler.call(this,B);const V=this.eventListeners[H];if(V)for(let j=0;j<V.length;j++)V[j].handler.call(this,B)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(H){const B=H?H.pointerId:void 0,$=this.getStage(),V=this.getAbsolutePosition();if(!$)return;const j=$._getPointerById(B)||$._changedPointerPositions[0]||V;r.DD._dragElements.set(this._id,{node:this,startPointerPos:j,offset:{x:j.x-V.x,y:j.y-V.y},dragStatus:"ready",pointerId:B})}startDrag(H,B=!0){r.DD._dragElements.has(this._id)||this._createDragElement(H);const $=r.DD._dragElements.get(this._id);$.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:H&&H.evt},B)}_setDragPosition(H,B){const $=this.getStage()._getPointerById(B.pointerId);if(!$)return;let V={x:$.x-B.offset.x,y:$.y-B.offset.y};const j=this.dragBoundFunc();if(j!==void 0){const z=j.call(this,V,H);z?V=z:a.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==V.x||this._lastPos.y!==V.y)&&(this.setAbsolutePosition(V),this._requestDraw()),this._lastPos=V}stopDrag(H){const B=r.DD._dragElements.get(this._id);B&&(B.dragStatus="stopped"),r.DD._endDragBefore(H),r.DD._endDragAfter(H)}setDraggable(H){this._setAttr("draggable",H),this._dragChange()}isDragging(){const H=r.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 V=!1;r.DD._dragElements.forEach(j=>{this.isAncestorOf(j.node)&&(V=!0)}),V||this._createDragElement(H)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const B=r.DD._dragElements.get(this._id),$=B&&B.dragStatus==="dragging",V=B&&B.dragStatus==="ready";$?this.stopDrag():V&&r.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(H={x:0,y:0}){const B=this.getStage();if(!B)return!1;const $={x:-H.x,y:-H.y,width:B.width()+2*H.x,height:B.height()+2*H.y};return a.Util.haveIntersection($,this.getClientRect())}static create(H,B){return a.Util._isString(H)&&(H=JSON.parse(H)),this._createNode(H,B)}static _createNode(H,B){let $=q.prototype.getClassName.call(H),V=H.children,j,z,F;B&&(H.attrs.container=B),n.Konva[$]||(a.Util.warn('Can not find a node with class name "'+$+'". Fallback to "Shape".'),$="Shape");const Y=n.Konva[$];if(j=new Y(H.attrs),V)for(z=V.length,F=0;F<z;F++)j.add(q._createNode(V[F]));return j}}Qh.Node=q,q.prototype.nodeType="Node",q.prototype._attrsAffectingSize=[],q.prototype.eventListeners={},q.prototype.on.call(q.prototype,O,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(I),this._clearSelfAndDescendantCache(u)}),q.prototype.on.call(q.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(A)}),q.prototype.on.call(q.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(E)}),q.prototype.on.call(q.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(o)});const D=t.Factory.addGetterSetter;return D(q,"zIndex"),D(q,"absolutePosition"),D(q,"position"),D(q,"x",0,(0,i.getNumberValidator)()),D(q,"y",0,(0,i.getNumberValidator)()),D(q,"globalCompositeOperation","source-over",(0,i.getStringValidator)()),D(q,"opacity",1,(0,i.getNumberValidator)()),D(q,"name","",(0,i.getStringValidator)()),D(q,"id","",(0,i.getStringValidator)()),D(q,"rotation",0,(0,i.getNumberValidator)()),t.Factory.addComponentsGetterSetter(q,"scale",["x","y"]),D(q,"scaleX",1,(0,i.getNumberValidator)()),D(q,"scaleY",1,(0,i.getNumberValidator)()),t.Factory.addComponentsGetterSetter(q,"skew",["x","y"]),D(q,"skewX",0,(0,i.getNumberValidator)()),D(q,"skewY",0,(0,i.getNumberValidator)()),t.Factory.addComponentsGetterSetter(q,"offset",["x","y"]),D(q,"offsetX",0,(0,i.getNumberValidator)()),D(q,"offsetY",0,(0,i.getNumberValidator)()),D(q,"dragDistance",void 0,(0,i.getNumberValidator)()),D(q,"width",0,(0,i.getNumberValidator)()),D(q,"height",0,(0,i.getNumberValidator)()),D(q,"listening",!0,(0,i.getBooleanValidator)()),D(q,"preventDefault",!0,(0,i.getBooleanValidator)()),D(q,"filters",void 0,function(te){return this._filterUpToDate=!1,te}),D(q,"visible",!0,(0,i.getBooleanValidator)()),D(q,"transformsEnabled","all",(0,i.getStringValidator)()),D(q,"size"),D(q,"dragBoundFunc"),D(q,"draggable",!1,(0,i.getBooleanValidator)()),t.Factory.backCompat(q,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),Qh}var Jh={},Ky;function J1(){if(Ky)return Jh;Ky=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Container=void 0;const e=Gr(),r=Ji(),t=Yr();let n=class extends r.Node{constructor(){super(...arguments),this.children=[]}getChildren(i){const o=this.children||[];return i?o.filter(i):o}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.destroy()}),this.children=[],this._requestDraw(),this}add(...i){if(i.length===0)return this;if(i.length>1){for(let s=0;s<i.length;s++)this.add(i[s]);return this}const o=i[0];return o.getParent()?(o.moveTo(this),this):(this._validateAdd(o),o.index=this.getChildren().length,o.parent=this,o._clearCaches(),this.getChildren().push(o),this._fire("add",{child:o}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(i){return this._generalFind(i,!1)}findOne(i){const o=this._generalFind(i,!0);return o.length>0?o[0]:void 0}_generalFind(i,o){const s=[];return this._descendants(u=>{const c=u._isMatch(i);return c&&s.push(u),!!(c&&o)}),s}_descendants(i){let o=!1;const s=this.getChildren();for(const u of s){if(o=i(u),o)return!0;if(u.hasChildren()&&(o=u._descendants(i),o))return!0}return!1}toObject(){const i=r.Node.prototype.toObject.call(this);return i.children=[],this.getChildren().forEach(o=>{i.children.push(o.toObject())}),i}isAncestorOf(i){let o=i.getParent();for(;o;){if(o._id===this._id)return!0;o=o.getParent()}return!1}clone(i){const o=r.Node.prototype.clone.call(this,i);return this.getChildren().forEach(function(s){o.add(s.clone())}),o}getAllIntersections(i){const o=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(i)&&o.push(s)}),o}_clearSelfAndDescendantCache(i){var o;super._clearSelfAndDescendantCache(i),!this.isCached()&&((o=this.children)===null||o===void 0||o.forEach(function(s){s._clearSelfAndDescendantCache(i)}))}_setChildrenIndices(){var i;(i=this.children)===null||i===void 0||i.forEach(function(o,s){o.index=s}),this._requestDraw()}drawScene(i,o,s){const u=this.getLayer(),c=i||u&&u.getCanvas(),h=c&&c.getContext(),v=this._getCanvasCache(),g=v&&v.scene,f=c&&c.isCache;if(!this.isVisible()&&!f)return this;if(g){h.save();const E=this.getAbsoluteTransform(o).getMatrix();h.transform(E[0],E[1],E[2],E[3],E[4],E[5]),this._drawCachedSceneCanvas(h),h.restore()}else this._drawChildren("drawScene",c,o,s);return this}drawHit(i,o){if(!this.shouldDrawHit(o))return this;const s=this.getLayer(),u=i||s&&s.hitCanvas,c=u&&u.getContext(),h=this._getCanvasCache();if(h&&h.hit){c.save();const g=this.getAbsoluteTransform(o).getMatrix();c.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(c),c.restore()}else this._drawChildren("drawHit",u,o);return this}_drawChildren(i,o,s,u){var c;const h=o&&o.getContext(),v=this.clipWidth(),g=this.clipHeight(),f=this.clipFunc(),E=typeof v=="number"&&typeof g=="number"||f,S=s===this;if(E){h.save();const _=this.getAbsoluteTransform(s);let y=_.getMatrix();h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),h.beginPath();let p;if(f)p=f.call(this,h,this);else{const m=this.clipX(),P=this.clipY();h.rect(m||0,P||0,v,g)}h.clip.apply(h,p),y=_.copy().invert().getMatrix(),h.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const w=!S&&this.globalCompositeOperation()!=="source-over"&&i==="drawScene";w&&(h.save(),h._applyGlobalCompositeOperation(this)),(c=this.children)===null||c===void 0||c.forEach(function(_){_[i](o,s,u)}),w&&h.restore(),E&&h.restore()}getClientRect(i={}){var o;const s=i.skipTransform,u=i.relativeTo;let c,h,v,g,f={x:1/0,y:1/0,width:0,height:0};const E=this;(o=this.children)===null||o===void 0||o.forEach(function(_){if(!_.visible())return;const y=_.getClientRect({relativeTo:E,skipShadow:i.skipShadow,skipStroke:i.skipStroke});y.width===0&&y.height===0||(c===void 0?(c=y.x,h=y.y,v=y.x+y.width,g=y.y+y.height):(c=Math.min(c,y.x),h=Math.min(h,y.y),v=Math.max(v,y.x+y.width),g=Math.max(g,y.y+y.height)))});const S=this.find("Shape");let w=!1;for(let _=0;_<S.length;_++)if(S[_]._isVisible(this)){w=!0;break}return w&&c!==void 0?f={x:c,y:h,width:v-c,height:g-h}:f={x:0,y:0,width:0,height:0},s?f:this._transformedRect(f,u)}};return Jh.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),Jh}var rg={},Dc={},Zy;function A6(){if(Zy)return Dc;Zy=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.getCapturedShape=n,Dc.createEvent=a,Dc.hasPointerCapture=i,Dc.setPointerCapture=o,Dc.releaseCapture=s;const e=jr(),r=new Map,t=e.Konva._global.PointerEvent!==void 0;function n(u){return r.get(u)}function a(u){return{evt:u,pointerId:u.pointerId}}function i(u,c){return r.get(u)===c}function o(u,c){s(u),c.getStage()&&(r.set(u,c),t&&c._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function s(u,c){const h=r.get(u);if(!h)return;const v=h.getStage();v&&v.content,r.delete(u),t&&h._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Dc}var Qy;function BS(){return Qy||(Qy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const r=Li(),t=Gr(),n=J1(),a=jr(),i=Q1(),o=lm(),s=jr(),u=A6(),c="Stage",h="string",v="px",g="mouseout",f="mouseleave",E="mouseover",S="mouseenter",w="mousemove",_="mousedown",y="mouseup",p="pointermove",m="pointerdown",P="pointerup",T="pointercancel",k="lostpointercapture",L="pointerout",I="pointerleave",R="pointerover",A="pointerenter",O="contextmenu",M="touchstart",q="touchend",D="touchmove",te="touchcancel",H="wheel",B=5,$=[[S,"_pointerenter"],[_,"_pointerdown"],[w,"_pointermove"],[y,"_pointerup"],[f,"_pointerleave"],[M,"_pointerdown"],[D,"_pointermove"],[q,"_pointerup"],[te,"_pointercancel"],[E,"_pointerover"],[H,"_wheel"],[O,"_contextmenu"],[m,"_pointerdown"],[p,"_pointermove"],[P,"_pointerup"],[T,"_pointercancel"],[I,"_pointerleave"],[k,"_lostpointercapture"]],V={mouse:{[L]:g,[I]:f,[R]:E,[A]:S,[p]:w,[m]:_,[P]:y,[T]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[L]:"touchout",[I]:"touchleave",[R]:"touchover",[A]:"touchenter",[p]:D,[m]:M,[P]:q,[T]:te,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[L]:L,[I]:I,[R]:R,[A]:A,[p]:p,[m]:m,[P]:P,[T]:T,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},j=X=>X.indexOf("pointer")>=0?"pointer":X.indexOf("touch")>=0?"touch":"mouse",z=X=>{const Q=j(X);if(Q==="pointer")return a.Konva.pointerEventsEnabled&&V.pointer;if(Q==="touch")return V.touch;if(Q==="mouse")return V.mouse};function F(X={}){return(X.clipFunc||X.clipWidth||X.clipHeight)&&r.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),X}const Y="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class J extends n.Container{constructor(Q){super(F(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",()=>{F(this.attrs)}),this._checkVisibility()}_validateAdd(Q){const ae=Q.getType()==="Layer",se=Q.getType()==="FastLayer";ae||se||r.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===h){let ae;if(Q.charAt(0)==="."){const se=Q.slice(1);Q=document.getElementsByClassName(se)[0]}else Q.charAt(0)!=="#"?ae=Q:ae=Q.slice(1),Q=document.getElementById(ae);if(!Q)throw"Can not find container in document with id "+ae}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,ae=Q.length;for(let se=0;se<ae;se++)Q[se].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&&r.Util._isInDocument(Q)&&this.container().removeChild(Q);const ae=e.stages.indexOf(this);return ae>-1&&e.stages.splice(ae,1),r.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Q=this._pointerPositions[0]||this._changedPointerPositions[0];return Q?{x:Q.x,y:Q.y}:(r.Util.warn(Y),null)}_getPointerById(Q){return this._pointerPositions.find(ae=>ae.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 ae=new i.SceneCanvas({width:Q.width,height:Q.height,pixelRatio:Q.pixelRatio||1}),se=ae.getContext()._context,fe=this.children;return(Q.x||Q.y)&&se.translate(-1*Q.x,-1*Q.y),fe.forEach(function(be){if(!be.isVisible())return;const _e=be._toKonvaCanvas(Q);se.drawImage(_e._canvas,Q.x,Q.y,_e.getWidth()/_e.getPixelRatio(),_e.getHeight()/_e.getPixelRatio())}),ae}getIntersection(Q){if(!Q)return null;const ae=this.children,se=ae.length,fe=se-1;for(let be=fe;be>=0;be--){const _e=ae[be].getIntersection(Q);if(_e)return _e}return null}_resizeDOM(){const Q=this.width(),ae=this.height();this.content&&(this.content.style.width=Q+v,this.content.style.height=ae+v),this.bufferCanvas.setSize(Q,ae),this.bufferHitCanvas.setSize(Q,ae),this.children.forEach(se=>{se.setSize({width:Q,height:ae}),se.draw()})}add(Q,...ae){if(arguments.length>1){for(let fe=0;fe<arguments.length;fe++)this.add(arguments[fe]);return this}super.add(Q);const se=this.children.length;return se>B&&r.Util.warn("The stage has "+se+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),Q.setSize({width:this.width(),height:this.height()}),Q.draw(),a.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(){a.Konva.isBrowser&&$.forEach(([Q,ae])=>{this.content.addEventListener(Q,se=>{this[ae](se)},{passive:!1})})}_pointerenter(Q){this.setPointersPositions(Q);const ae=z(Q.type);ae&&this._fire(ae.pointerenter,{evt:Q,target:this,currentTarget:this})}_pointerover(Q){this.setPointersPositions(Q);const ae=z(Q.type);ae&&this._fire(ae.pointerover,{evt:Q,target:this,currentTarget:this})}_getTargetShape(Q){let ae=this[Q+"targetShape"];return ae&&!ae.getStage()&&(ae=null),ae}_pointerleave(Q){const ae=z(Q.type),se=j(Q.type);if(!ae)return;this.setPointersPositions(Q);const fe=this._getTargetShape(se),be=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;fe&&be?(fe._fireAndBubble(ae.pointerout,{evt:Q}),fe._fireAndBubble(ae.pointerleave,{evt:Q}),this._fire(ae.pointerleave,{evt:Q,target:this,currentTarget:this}),this[se+"targetShape"]=null):be&&(this._fire(ae.pointerleave,{evt:Q,target:this,currentTarget:this}),this._fire(ae.pointerout,{evt:Q,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Q){const ae=z(Q.type),se=j(Q.type);if(!ae)return;this.setPointersPositions(Q);let fe=!1;this._changedPointerPositions.forEach(be=>{const _e=this.getIntersection(be);if(o.DD.justDragged=!1,a.Konva["_"+se+"ListenClick"]=!0,!_e||!_e.isListening()){this[se+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&_e.setPointerCapture(be.id),this[se+"ClickStartShape"]=_e,_e._fireAndBubble(ae.pointerdown,{evt:Q,pointerId:be.id}),fe=!0;const Ae=Q.type.indexOf("touch")>=0;_e.preventDefault()&&Q.cancelable&&Ae&&Q.preventDefault()}),fe||this._fire(ae.pointerdown,{evt:Q,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Q){const ae=z(Q.type),se=j(Q.type);if(!ae||(a.Konva.isDragging()&&o.DD.node.preventDefault()&&Q.cancelable&&Q.preventDefault(),this.setPointersPositions(Q),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const be={};let _e=!1;const Ae=this._getTargetShape(se);this._changedPointerPositions.forEach(Re=>{const Pe=u.getCapturedShape(Re.id)||this.getIntersection(Re),ye=Re.id,nt={evt:Q,pointerId:ye},Ce=Ae!==Pe;if(Ce&&Ae&&(Ae._fireAndBubble(ae.pointerout,{...nt},Pe),Ae._fireAndBubble(ae.pointerleave,{...nt},Pe)),Pe){if(be[Pe._id])return;be[Pe._id]=!0}Pe&&Pe.isListening()?(_e=!0,Ce&&(Pe._fireAndBubble(ae.pointerover,{...nt},Ae),Pe._fireAndBubble(ae.pointerenter,{...nt},Ae),this[se+"targetShape"]=Pe),Pe._fireAndBubble(ae.pointermove,{...nt})):Ae&&(this._fire(ae.pointerover,{evt:Q,target:this,currentTarget:this,pointerId:ye}),this[se+"targetShape"]=null)}),_e||this._fire(ae.pointermove,{evt:Q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Q){const ae=z(Q.type),se=j(Q.type);if(!ae)return;this.setPointersPositions(Q);const fe=this[se+"ClickStartShape"],be=this[se+"ClickEndShape"],_e={};let Ae=!1;this._changedPointerPositions.forEach(Re=>{const Pe=u.getCapturedShape(Re.id)||this.getIntersection(Re);if(Pe){if(Pe.releaseCapture(Re.id),_e[Pe._id])return;_e[Pe._id]=!0}const ye=Re.id,nt={evt:Q,pointerId:ye};let Ce=!1;a.Konva["_"+se+"InDblClickWindow"]?(Ce=!0,clearTimeout(this[se+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+se+"InDblClickWindow"]=!0,clearTimeout(this[se+"DblTimeout"])),this[se+"DblTimeout"]=setTimeout(function(){a.Konva["_"+se+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Pe&&Pe.isListening()?(Ae=!0,this[se+"ClickEndShape"]=Pe,Pe._fireAndBubble(ae.pointerup,{...nt}),a.Konva["_"+se+"ListenClick"]&&fe&&fe===Pe&&(Pe._fireAndBubble(ae.pointerclick,{...nt}),Ce&&be&&be===Pe&&Pe._fireAndBubble(ae.pointerdblclick,{...nt}))):(this[se+"ClickEndShape"]=null,a.Konva["_"+se+"ListenClick"]&&this._fire(ae.pointerclick,{evt:Q,target:this,currentTarget:this,pointerId:ye}),Ce&&this._fire(ae.pointerdblclick,{evt:Q,target:this,currentTarget:this,pointerId:ye}))}),Ae||this._fire(ae.pointerup,{evt:Q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+se+"ListenClick"]=!1,Q.cancelable&&se!=="touch"&&se!=="pointer"&&Q.preventDefault()}_contextmenu(Q){this.setPointersPositions(Q);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(O,{evt:Q}):this._fire(O,{evt:Q,target:this,currentTarget:this})}_wheel(Q){this.setPointersPositions(Q);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(H,{evt:Q}):this._fire(H,{evt:Q,target:this,currentTarget:this})}_pointercancel(Q){this.setPointersPositions(Q);const ae=u.getCapturedShape(Q.pointerId)||this.getIntersection(this.getPointerPosition());ae&&ae._fireAndBubble(P,u.createEvent(Q)),u.releaseCapture(Q.pointerId)}_lostpointercapture(Q){u.releaseCapture(Q.pointerId)}setPointersPositions(Q){const ae=this._getContentPosition();let se=null,fe=null;Q=Q||window.event,Q.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Q.touches,be=>{this._pointerPositions.push({id:be.identifier,x:(be.clientX-ae.left)/ae.scaleX,y:(be.clientY-ae.top)/ae.scaleY})}),Array.prototype.forEach.call(Q.changedTouches||Q.touches,be=>{this._changedPointerPositions.push({id:be.identifier,x:(be.clientX-ae.left)/ae.scaleX,y:(be.clientY-ae.top)/ae.scaleY})})):(se=(Q.clientX-ae.left)/ae.scaleX,fe=(Q.clientY-ae.top)/ae.scaleY,this.pointerPos={x:se,y:fe},this._pointerPositions=[{x:se,y:fe,id:r.Util._getFirstPointerId(Q)}],this._changedPointerPositions=[{x:se,y:fe,id:r.Util._getFirstPointerId(Q)}])}_setPointerPosition(Q){r.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 i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const 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 r.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Q){Q.batchDraw()}),this}}e.Stage=J,J.prototype.nodeType=c,(0,s._registerNode)(J),t.Factory.addGetterSetter(J,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(X=>{X.batchDraw()})})}(rg)),rg}var ed={},ng={},Jy;function Ma(){return Jy||(Jy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const r=jr(),t=Li(),n=Gr(),a=Ji(),i=Yr(),o=jr(),s=A6(),u="hasShadow",c="shadowRGBA",h="patternImage",v="linearGradient",g="radialGradient";let f;function E(){return f||(f=t.Util.createCanvasElement().getContext("2d"),f)}e.shapes={};function S(I){const R=this.attrs.fillRule;R?I.fill(R):I.fill()}function w(I){I.stroke()}function _(I){const R=this.attrs.fillRule;R?I.fill(R):I.fill()}function y(I){I.stroke()}function p(){this._clearCache(u)}function m(){this._clearCache(c)}function P(){this._clearCache(h)}function T(){this._clearCache(v)}function k(){this._clearCache(g)}class L extends a.Node{constructor(R){super(R);let A;for(;A=t.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const A=E().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const O=new t.Transform;O.translate(this.fillPatternX(),this.fillPatternY()),O.rotate(r.Konva.getAngle(this.fillPatternRotation())),O.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),O.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const M=O.getMatrix(),q=typeof DOMMatrix>"u"?{a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]}:new DOMMatrix(M);A.setTransform(q)}return A}}_getLinearGradient(){return this._getCache(v,this.__getLinearGradient)}__getLinearGradient(){const R=this.fillLinearGradientColorStops();if(R){const A=E(),O=this.fillLinearGradientStartPoint(),M=this.fillLinearGradientEndPoint(),q=A.createLinearGradient(O.x,O.y,M.x,M.y);for(let D=0;D<R.length;D+=2)q.addColorStop(R[D],R[D+1]);return q}}_getRadialGradient(){return this._getCache(g,this.__getRadialGradient)}__getRadialGradient(){const R=this.fillRadialGradientColorStops();if(R){const A=E(),O=this.fillRadialGradientStartPoint(),M=this.fillRadialGradientEndPoint(),q=A.createRadialGradient(O.x,O.y,this.fillRadialGradientStartRadius(),M.x,M.y,this.fillRadialGradientEndRadius());for(let D=0;D<R.length;D+=2)q.addColorStop(R[D],R[D+1]);return q}}getShadowRGBA(){return this._getCache(c,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const R=t.Util.colorToRGBA(this.shadowColor());if(R)return"rgba("+R.r+","+R.g+","+R.b+","+R.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 R=this.hitStrokeWidth();return R==="auto"?this.hasStroke():this.strokeEnabled()&&!!R}intersects(R){const A=this.getStage();if(!A)return!1;const O=A.bufferHitCanvas;return O.getContext().clear(),this.drawHit(O,void 0,!0),O.context.getImageData(Math.round(R.x),Math.round(R.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(R){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const M=R||this.hasFill(),q=this.hasStroke(),D=this.getAbsoluteOpacity()!==1;if(M&&q&&D)return!0;const te=this.hasShadow(),H=this.shadowForStrokeEnabled();return!!(M&&q&&te&&H)}setStrokeHitEnabled(R){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),R?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const R=this.size();return{x:this._centroid?-R.width/2:0,y:this._centroid?-R.height/2:0,width:R.width,height:R.height}}getClientRect(R={}){let A=!1,O=this.getParent();for(;O;){if(O.isCached()){A=!0;break}O=O.getParent()}const M=R.skipTransform,q=R.relativeTo||A&&this.getStage()||void 0,D=this.getSelfRect(),H=!R.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,B=D.width+H,$=D.height+H,V=!R.skipShadow&&this.hasShadow(),j=V?this.shadowOffsetX():0,z=V?this.shadowOffsetY():0,F=B+Math.abs(j),Y=$+Math.abs(z),J=V&&this.shadowBlur()||0,X=F+J*2,Q=Y+J*2,ae={width:X,height:Q,x:-(H/2+J)+Math.min(j,0)+D.x,y:-(H/2+J)+Math.min(z,0)+D.y};return M?ae:this._transformedRect(ae,q)}drawScene(R,A,O){const M=this.getLayer(),q=R||M.getCanvas(),D=q.getContext(),te=this._getCanvasCache(),H=this.getSceneFunc(),B=this.hasShadow();let $;const V=A===this;if(!this.isVisible()&&!V)return this;if(te){D.save();const j=this.getAbsoluteTransform(A).getMatrix();return D.transform(j[0],j[1],j[2],j[3],j[4],j[5]),this._drawCachedSceneCanvas(D),D.restore(),this}if(!H)return this;if(D.save(),this._useBufferCanvas()){$=this.getStage();const j=O||$.bufferCanvas,z=j.getContext();z.clear(),z.save(),z._applyLineJoin(this);const F=this.getAbsoluteTransform(A).getMatrix();z.transform(F[0],F[1],F[2],F[3],F[4],F[5]),H.call(this,z,this),z.restore();const Y=j.pixelRatio;B&&D._applyShadow(this),D._applyOpacity(this),D._applyGlobalCompositeOperation(this),D.drawImage(j._canvas,j.x||0,j.y||0,j.width/Y,j.height/Y)}else{if(D._applyLineJoin(this),!V){const j=this.getAbsoluteTransform(A).getMatrix();D.transform(j[0],j[1],j[2],j[3],j[4],j[5]),D._applyOpacity(this),D._applyGlobalCompositeOperation(this)}B&&D._applyShadow(this),H.call(this,D,this)}return D.restore(),this}drawHit(R,A,O=!1){if(!this.shouldDrawHit(A,O))return this;const M=this.getLayer(),q=R||M.hitCanvas,D=q&&q.getContext(),te=this.hitFunc()||this.sceneFunc(),H=this._getCanvasCache(),B=H&&H.hit;if(this.colorKey||t.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),B){D.save();const V=this.getAbsoluteTransform(A).getMatrix();return D.transform(V[0],V[1],V[2],V[3],V[4],V[5]),this._drawCachedHitCanvas(D),D.restore(),this}if(!te)return this;if(D.save(),D._applyLineJoin(this),!(this===A)){const V=this.getAbsoluteTransform(A).getMatrix();D.transform(V[0],V[1],V[2],V[3],V[4],V[5])}return te.call(this,D,this),D.restore(),this}drawHitFromCache(R=0){const A=this._getCanvasCache(),O=this._getCachedSceneCanvas(),M=A.hit,q=M.getContext(),D=M.getWidth(),te=M.getHeight();q.clear(),q.drawImage(O._canvas,0,0,D,te);try{const H=q.getImageData(0,0,D,te),B=H.data,$=B.length,V=t.Util._hexToRgb(this.colorKey);for(let j=0;j<$;j+=4)B[j+3]>R?(B[j]=V.r,B[j+1]=V.g,B[j+2]=V.b,B[j+3]=255):B[j+3]=0;q.putImageData(H,0,0)}catch(H){t.Util.error("Unable to draw hit graph from cached scene canvas. "+H.message)}return this}hasPointerCapture(R){return s.hasPointerCapture(R,this)}setPointerCapture(R){s.setPointerCapture(R,this)}releaseCapture(R){s.releaseCapture(R,this)}}e.Shape=L,L.prototype._fillFunc=S,L.prototype._strokeFunc=w,L.prototype._fillFuncHit=_,L.prototype._strokeFuncHit=y,L.prototype._centroid=!1,L.prototype.nodeType="Shape",(0,o._registerNode)(L),L.prototype.eventListeners={},L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",p),L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),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",P),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",k),n.Factory.addGetterSetter(L,"stroke",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(L,"strokeWidth",2,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(L,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(L,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(L,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(L,"shadowForStrokeEnabled",!0,(0,i.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,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowColor",void 0,(0,i.getStringValidator)()),n.Factory.addGetterSetter(L,"shadowBlur",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowOpacity",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(L,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(L,"shadowOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternImage"),n.Factory.addGetterSetter(L,"fill",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(L,"fillPatternX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternY",0,(0,i.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,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(L,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(L,"fillPatternScaleX",1,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternScaleY",1,(0,i.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,i.getStringValidator)()),n.Factory.backCompat(L,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(ng)),ng}var e5;function C6(){if(e5)return ed;e5=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Layer=void 0;const e=Li(),r=J1(),t=Ji(),n=Gr(),a=Q1(),i=Yr(),o=Ma(),s=jr(),u="#",c="beforeDraw",h="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 f extends r.Container{constructor(S){super(S),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(S){return this.getContext().clear(S),this.getHitCanvas().getContext().clear(S),this}setZIndex(S){super.setZIndex(S);const w=this.getStage();return w&&w.content&&(w.content.removeChild(this.getNativeCanvasElement()),S<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[S+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const S=this.getStage();return S&&S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const w=this.getStage();return!w||!w.content?!1:(w.content.removeChild(this.getNativeCanvasElement()),this.index<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[this.index+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const S=this.getStage();if(S){const w=S.children;S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.insertBefore(this.getNativeCanvasElement(),w[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const S=this.getStage();if(S){const w=S.children;S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.insertBefore(this.getNativeCanvasElement(),w[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const S=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),S&&S.parentNode&&e.Util._isInDocument(S)&&S.parentNode.removeChild(S),this}getStage(){return this.parent}setSize({width:S,height:w}){return this.canvas.setSize(S,w),this.hitCanvas.setSize(S,w),this._setSmoothEnabled(),this}_validateAdd(S){const w=S.getType();w!=="Group"&&w!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(S){return S=S||{},S.width=S.width||this.getWidth(),S.height=S.height||this.getHeight(),S.x=S.x!==void 0?S.x:this.x(),S.y=S.y!==void 0?S.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,S)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(S){if(!this.isListening()||!this.isVisible())return null;let w=1,_=!1;for(;;){for(let y=0;y<g;y++){const p=v[y],m=this._getIntersection({x:S.x+p.x*w,y:S.y+p.y*w}),P=m.shape;if(P)return P;if(_=!!m.antialiased,!m.antialiased)break}if(_)w+=1;else return null}}_getIntersection(S){const w=this.hitCanvas.pixelRatio,_=this.hitCanvas.context.getImageData(Math.round(S.x*w),Math.round(S.y*w),1,1).data,y=_[3];if(y===255){const p=e.Util._rgbToHex(_[0],_[1],_[2]),m=o.shapes[u+p];return m?{shape:m}:{antialiased:!0}}else if(y>0)return{antialiased:!0};return{}}drawScene(S,w,_){const y=this.getLayer(),p=S||y&&y.getCanvas();return this._fire(c,{node:this}),this.clearBeforeDraw()&&p.getContext().clear(),r.Container.prototype.drawScene.call(this,p,w,_),this._fire(h,{node:this}),this}drawHit(S,w){const _=this.getLayer(),y=S||_&&_.hitCanvas;return _&&_.clearBeforeDraw()&&_.getHitCanvas().getContext().clear(),r.Container.prototype.drawHit.call(this,y,w),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(S){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(S)}getHitGraphEnabled(S){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const S=this.parent;!!this.hitCanvas._canvas.parentNode?S.content.removeChild(this.hitCanvas._canvas):S.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return ed.Layer=f,f.prototype.nodeType="Layer",(0,s._registerNode)(f),n.Factory.addGetterSetter(f,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(f,"clearBeforeDraw",!0),n.Factory.addGetterSetter(f,"hitGraphEnabled",!0,(0,i.getBooleanValidator)()),ed}var td={},t5;function qS(){if(t5)return td;t5=1,Object.defineProperty(td,"__esModule",{value:!0}),td.FastLayer=void 0;const e=Li(),r=C6(),t=jr();class n extends r.Layer{constructor(i){super(i),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return td.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),td}var rd={},r5;function um(){if(r5)return rd;r5=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Group=void 0;const e=Li(),r=J1(),t=jr();class n extends r.Container{_validateAdd(i){const o=i.getType();o!=="Group"&&o!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return rd.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),rd}var nd={},n5;function cm(){if(n5)return nd;n5=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Animation=void 0;const e=jr(),r=Li(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let n=class sh{constructor(i,o){this.id=sh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=i,this.setLayers(o)}setLayers(i){let o=[];return i&&(o=Array.isArray(i)?i:[i]),this.layers=o,this}getLayers(){return this.layers}addLayer(i){const o=this.layers,s=o.length;for(let u=0;u<s;u++)if(o[u]._id===i._id)return!1;return this.layers.push(i),!0}isRunning(){const o=sh.animations,s=o.length;for(let u=0;u<s;u++)if(o[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),sh._addAnimation(this),this}stop(){return sh._removeAnimation(this),this}_updateFrameObject(i){this.frame.timeDiff=i-this.frame.lastTime,this.frame.lastTime=i,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(i){this.animations.push(i),this._handleAnimation()}static _removeAnimation(i){const o=i.id,s=this.animations,u=s.length;for(let c=0;c<u;c++)if(s[c].id===o){this.animations.splice(c,1);break}}static _runFrames(){const i={},o=this.animations;for(let s=0;s<o.length;s++){const u=o[s],c=u.layers,h=u.func;u._updateFrameObject(t());const v=c.length;let g;if(h?g=h.call(u,u.frame)!==!1:g=!0,!!g)for(let f=0;f<v;f++){const E=c[f];E._id!==void 0&&(i[E._id]=E)}}for(const s in i)i.hasOwnProperty(s)&&i[s].batchDraw()}static _animationLoop(){const i=sh;i.animations.length?(i._runFrames(),r.Util.requestAnimFrame(i._animationLoop)):i.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,r.Util.requestAnimFrame(this._animationLoop))}};return nd.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,nd}var ig={},i5;function zS(){return i5||(i5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const r=Li(),t=cm(),n=Ji(),a=jr(),i={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,s=2,u=3,c=["fill","stroke","shadowColor"];let h=0;class v{constructor(E,S,w,_,y,p,m){this.prop=E,this.propFunc=S,this.begin=_,this._pos=_,this.duration=p,this._change=0,this.prevPos=0,this.yoyo=m,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=w,this._change=y-this.begin,this.pause()}fire(E){const S=this[E];S&&S()}setTime(E){E>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():E<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=E,this.update())}getTime(){return this._time}setPosition(E){this.prevPos=this._pos,this.propFunc(E),this._pos=E}getPosition(E){return E===void 0&&(E=this._time),this.func(E,this.begin,this._change,this.duration)}play(){this.state=s,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(E){this.pause(),this._time=E,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const E=this.getTimer()-this._startTime;this.state===s?this.setTime(E):this.state===u&&this.setTime(this.duration-E)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class g{constructor(E){const S=this,w=E.node,_=w._id,y=E.easing||e.Easings.Linear,p=!!E.yoyo;let m,P;typeof E.duration>"u"?m=.3:E.duration===0?m=.001:m=E.duration,this.node=w,this._id=h++;const T=w.getLayer()||(w instanceof a.Konva.Stage?w.getLayers():null);T||r.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){S.tween.onEnterFrame()},T),this.tween=new v(P,function(k){S._tweenFunc(k)},y,0,1,m*1e3,p),this._addListeners(),g.attrs[_]||(g.attrs[_]={}),g.attrs[_][this._id]||(g.attrs[_][this._id]={}),g.tweens[_]||(g.tweens[_]={});for(P in E)i[P]===void 0&&this._addAttr(P,E[P]);this.reset(),this.onFinish=E.onFinish,this.onReset=E.onReset,this.onUpdate=E.onUpdate}_addAttr(E,S){const w=this.node,_=w._id;let y,p,m,P,T;const k=g.tweens[_][E];k&&delete g.attrs[_][k][E];let L=w.getAttr(E);if(r.Util._isArray(S))if(y=[],p=Math.max(S.length,L.length),E==="points"&&S.length!==L.length&&(S.length>L.length?(P=L,L=r.Util._prepareArrayForTween(L,S,w.closed())):(m=S,S=r.Util._prepareArrayForTween(S,L,w.closed()))),E.indexOf("fill")===0)for(let I=0;I<p;I++)if(I%2===0)y.push(S[I]-L[I]);else{const R=r.Util.colorToRGBA(L[I]);T=r.Util.colorToRGBA(S[I]),L[I]=R,y.push({r:T.r-R.r,g:T.g-R.g,b:T.b-R.b,a:T.a-R.a})}else for(let I=0;I<p;I++)y.push(S[I]-L[I]);else c.indexOf(E)!==-1?(L=r.Util.colorToRGBA(L),T=r.Util.colorToRGBA(S),y={r:T.r-L.r,g:T.g-L.g,b:T.b-L.b,a:T.a-L.a}):y=S-L;g.attrs[_][this._id][E]={start:L,diff:y,end:S,trueEnd:m,trueStart:P},g.tweens[_][E]=this._id}_tweenFunc(E){const S=this.node,w=g.attrs[S._id][this._id];let _,y,p,m,P,T,k,L;for(_ in w){if(y=w[_],p=y.start,m=y.diff,L=y.end,r.Util._isArray(p))if(P=[],k=Math.max(p.length,L.length),_.indexOf("fill")===0)for(T=0;T<k;T++)T%2===0?P.push((p[T]||0)+m[T]*E):P.push("rgba("+Math.round(p[T].r+m[T].r*E)+","+Math.round(p[T].g+m[T].g*E)+","+Math.round(p[T].b+m[T].b*E)+","+(p[T].a+m[T].a*E)+")");else for(T=0;T<k;T++)P.push((p[T]||0)+m[T]*E);else c.indexOf(_)!==-1?P="rgba("+Math.round(p.r+m.r*E)+","+Math.round(p.g+m.g*E)+","+Math.round(p.b+m.b*E)+","+(p.a+m.a*E)+")":P=p+m*E;S.setAttr(_,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const E=this.node,S=g.attrs[E._id][this._id];S.points&&S.points.trueEnd&&E.setAttr("points",S.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const E=this.node,S=g.attrs[E._id][this._id];S.points&&S.points.trueStart&&E.points(S.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(E){return this.tween.seek(E*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const E=this.node._id,S=this._id,w=g.tweens[E];this.pause(),this.anim&&this.anim.stop();for(const _ in w)delete g.tweens[E][_];delete g.attrs[E][S],g.tweens[E]&&(Object.keys(g.tweens[E]).length===0&&delete g.tweens[E],Object.keys(g.attrs[E]).length===0&&delete g.attrs[E])}}e.Tween=g,g.attrs={},g.tweens={},n.Node.prototype.to=function(f){const E=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),E&&E()},new g(f).play()},e.Easings={BackEaseIn(f,E,S,w){return S*(f/=w)*f*((1.70158+1)*f-1.70158)+E},BackEaseOut(f,E,S,w){return S*((f=f/w-1)*f*((1.70158+1)*f+1.70158)+1)+E},BackEaseInOut(f,E,S,w){let _=1.70158;return(f/=w/2)<1?S/2*(f*f*(((_*=1.525)+1)*f-_))+E:S/2*((f-=2)*f*(((_*=1.525)+1)*f+_)+2)+E},ElasticEaseIn(f,E,S,w,_,y){let p=0;return f===0?E:(f/=w)===1?E+S:(y||(y=w*.3),!_||_<Math.abs(S)?(_=S,p=y/4):p=y/(2*Math.PI)*Math.asin(S/_),-(_*Math.pow(2,10*(f-=1))*Math.sin((f*w-p)*(2*Math.PI)/y))+E)},ElasticEaseOut(f,E,S,w,_,y){let p=0;return f===0?E:(f/=w)===1?E+S:(y||(y=w*.3),!_||_<Math.abs(S)?(_=S,p=y/4):p=y/(2*Math.PI)*Math.asin(S/_),_*Math.pow(2,-10*f)*Math.sin((f*w-p)*(2*Math.PI)/y)+S+E)},ElasticEaseInOut(f,E,S,w,_,y){let p=0;return f===0?E:(f/=w/2)===2?E+S:(y||(y=w*(.3*1.5)),!_||_<Math.abs(S)?(_=S,p=y/4):p=y/(2*Math.PI)*Math.asin(S/_),f<1?-.5*(_*Math.pow(2,10*(f-=1))*Math.sin((f*w-p)*(2*Math.PI)/y))+E:_*Math.pow(2,-10*(f-=1))*Math.sin((f*w-p)*(2*Math.PI)/y)*.5+S+E)},BounceEaseOut(f,E,S,w){return(f/=w)<1/2.75?S*(7.5625*f*f)+E:f<2/2.75?S*(7.5625*(f-=1.5/2.75)*f+.75)+E:f<2.5/2.75?S*(7.5625*(f-=2.25/2.75)*f+.9375)+E:S*(7.5625*(f-=2.625/2.75)*f+.984375)+E},BounceEaseIn(f,E,S,w){return S-e.Easings.BounceEaseOut(w-f,0,S,w)+E},BounceEaseInOut(f,E,S,w){return f<w/2?e.Easings.BounceEaseIn(f*2,0,S,w)*.5+E:e.Easings.BounceEaseOut(f*2-w,0,S,w)*.5+S*.5+E},EaseIn(f,E,S,w){return S*(f/=w)*f+E},EaseOut(f,E,S,w){return-S*(f/=w)*(f-2)+E},EaseInOut(f,E,S,w){return(f/=w/2)<1?S/2*f*f+E:-S/2*(--f*(f-2)-1)+E},StrongEaseIn(f,E,S,w){return S*(f/=w)*f*f*f*f+E},StrongEaseOut(f,E,S,w){return S*((f=f/w-1)*f*f*f*f+1)+E},StrongEaseInOut(f,E,S,w){return(f/=w/2)<1?S/2*f*f*f*f*f+E:S/2*((f-=2)*f*f*f*f+2)+E},Linear(f,E,S,w){return S*f/w+E}}}(ig)),ig}var a5;function E2(){return a5||(a5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const r=jr(),t=Li(),n=Ji(),a=J1(),i=BS(),o=C6(),s=qS(),u=um(),c=lm(),h=Ma(),v=cm(),g=zS(),f=O6(),E=Q1();e.Konva=t.Util._assign(r.Konva,{Util:t.Util,Transform:t.Transform,Node:n.Node,Container:a.Container,Stage:i.Stage,stages:i.stages,Layer:o.Layer,FastLayer:s.FastLayer,Group:u.Group,DD:c.DD,Shape:h.Shape,shapes:h.shapes,Animation:v.Animation,Tween:g.Tween,Easings:g.Easings,Context:f.Context,Canvas:E.Canvas}),e.default=e.Konva}(Z0)),Z0}var id={},o5;function US(){if(o5)return id;o5=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Arc=void 0;const e=Gr(),r=Ma(),t=jr(),n=Yr(),a=jr();class i extends r.Shape{_sceneFunc(s){const u=t.Konva.getAngle(this.angle()),c=this.clockwise();s.beginPath(),s.arc(0,0,this.outerRadius(),0,u,c),s.arc(0,0,this.innerRadius(),u,0,!c),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}getSelfRect(){const s=this.innerRadius(),u=this.outerRadius(),c=this.clockwise(),h=t.Konva.getAngle(c?360-this.angle():this.angle()),v=Math.cos(Math.min(h,Math.PI)),g=1,f=Math.sin(Math.min(Math.max(Math.PI,h),3*Math.PI/2)),E=Math.sin(Math.min(h,Math.PI/2)),S=v*(v>0?s:u),w=g*u,_=f*(f>0?s:u),y=E*(E>0?u:s);return{x:S,y:c?-1*y:_,width:w-S,height:y-_}}}return id.Arc=i,i.prototype._centroid=!0,i.prototype.className="Arc",i.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1,(0,n.getBooleanValidator)()),id}var ad={},od={},s5;function k6(){if(s5)return od;s5=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Line=void 0;const e=Gr(),r=jr(),t=Ma(),n=Yr();function a(s,u,c,h,v,g,f){const E=Math.sqrt(Math.pow(c-s,2)+Math.pow(h-u,2)),S=Math.sqrt(Math.pow(v-c,2)+Math.pow(g-h,2)),w=f*E/(E+S),_=f*S/(E+S),y=c-w*(v-s),p=h-w*(g-u),m=c+_*(v-s),P=h+_*(g-u);return[y,p,m,P]}function i(s,u){const c=s.length,h=[];for(let v=2;v<c-2;v+=2){const g=a(s[v-2],s[v-1],s[v],s[v+1],s[v+2],s[v+3],u);isNaN(g[0])||(h.push(g[0]),h.push(g[1]),h.push(s[v]),h.push(s[v+1]),h.push(g[2]),h.push(g[3]))}return h}class o extends t.Shape{constructor(u){super(u),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(u){const c=this.points(),h=c.length,v=this.tension(),g=this.closed(),f=this.bezier();if(!h)return;let E=0;if(u.beginPath(),u.moveTo(c[0],c[1]),v!==0&&h>4){const S=this.getTensionPoints(),w=S.length;for(E=g?0:4,g||u.quadraticCurveTo(S[0],S[1],S[2],S[3]);E<w-2;)u.bezierCurveTo(S[E++],S[E++],S[E++],S[E++],S[E++],S[E++]);g||u.quadraticCurveTo(S[w-2],S[w-1],c[h-2],c[h-1])}else if(f)for(E=2;E<h;)u.bezierCurveTo(c[E++],c[E++],c[E++],c[E++],c[E++],c[E++]);else for(E=2;E<h;E+=2)u.lineTo(c[E],c[E+1]);g?(u.closePath(),u.fillStrokeShape(this)):u.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():i(this.points(),this.tension())}_getTensionPointsClosed(){const u=this.points(),c=u.length,h=this.tension(),v=a(u[c-2],u[c-1],u[0],u[1],u[2],u[3],h),g=a(u[c-4],u[c-3],u[c-2],u[c-1],u[0],u[1],h),f=i(u,h);return[v[2],v[3]].concat(f).concat([g[0],g[1],u[c-2],u[c-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 c=u[0],h=u[0],v=u[1],g=u[1],f,E;for(let S=0;S<u.length/2;S++)f=u[S*2],E=u[S*2+1],c=Math.min(c,f),h=Math.max(h,f),v=Math.min(v,E),g=Math.max(g,E);return{x:c,y:v,width:h-c,height:g-v}}}return od.Line=o,o.prototype.className="Line",o.prototype._attrsAffectingSize=["points","bezier","tension"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"closed",!1),e.Factory.addGetterSetter(o,"bezier",!1),e.Factory.addGetterSetter(o,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(o,"points",[],(0,n.getNumberArrayValidator)()),od}var sd={},ag={},l5;function HS(){return l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const r=(o,s,u)=>{let c,h;const g=u/2;c=0;for(let f=0;f<20;f++)h=g*e.tValues[20][f]+g,c+=e.cValues[20][f]*n(o,s,h);return g*c};e.getCubicArcLength=r;const t=(o,s,u)=>{u===void 0&&(u=1);const c=o[0]-2*o[1]+o[2],h=s[0]-2*s[1]+s[2],v=2*o[1]-2*o[0],g=2*s[1]-2*s[0],f=4*(c*c+h*h),E=4*(c*v+h*g),S=v*v+g*g;if(f===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const w=E/(2*f),_=S/f,y=u+w,p=_-w*w,m=y*y+p>0?Math.sqrt(y*y+p):0,P=w*w+p>0?Math.sqrt(w*w+p):0,T=w+Math.sqrt(w*w+p)!==0?p*Math.log(Math.abs((y+m)/(w+P))):0;return Math.sqrt(f)/2*(y*m-w*P+T)};e.getQuadraticArcLength=t;function n(o,s,u){const c=a(1,u,o),h=a(1,u,s),v=c*c+h*h;return Math.sqrt(v)}const a=(o,s,u)=>{const c=u.length-1;let h,v;if(c===0)return 0;if(o===0){v=0;for(let g=0;g<=c;g++)v+=e.binomialCoefficients[c][g]*Math.pow(1-s,c-g)*Math.pow(s,g)*u[g];return v}else{h=new Array(c);for(let g=0;g<c;g++)h[g]=c*(u[g+1]-u[g]);return a(o-1,s,h)}},i=(o,s,u)=>{let c=1,h=o/s,v=(o-u(h))/s,g=0;for(;c>.001;){const f=u(h+v),E=Math.abs(o-f)/s;if(E<c)c=E,h+=v;else{const S=u(h-v),w=Math.abs(o-S)/s;w<c?(c=w,h-=v):v/=2}if(g++,g>500)break}return h};e.t2length=i}(ag)),ag}var u5;function fm(){if(u5)return sd;u5=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Path=void 0;const e=Gr(),r=jr(),t=Ma(),n=HS();class a extends t.Shape{constructor(o){super(o),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(o){const s=this.dataArray;o.beginPath();let u=!1;for(let c=0;c<s.length;c++){const h=s[c].command,v=s[c].points;switch(h){case"L":o.lineTo(v[0],v[1]);break;case"M":o.moveTo(v[0],v[1]);break;case"C":o.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]);break;case"Q":o.quadraticCurveTo(v[0],v[1],v[2],v[3]);break;case"A":const g=v[0],f=v[1],E=v[2],S=v[3],w=v[4],_=v[5],y=v[6],p=v[7],m=E>S?E:S,P=E>S?1:E/S,T=E>S?S/E:1;o.translate(g,f),o.rotate(y),o.scale(P,T),o.arc(0,0,m,w,w+_,1-p),o.scale(1/P,1/T),o.rotate(-y),o.translate(-g,-f);break;case"z":u=!0,o.closePath();break}}!u&&!this.hasFill()?o.strokeShape(this):o.fillStrokeShape(this)}getSelfRect(){let o=[];this.dataArray.forEach(function(f){if(f.command==="A"){const E=f.points[4],S=f.points[5],w=f.points[4]+S;let _=Math.PI/180;if(Math.abs(E-w)<_&&(_=Math.abs(E-w)),S<0)for(let y=E-_;y>w;y-=_){const p=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],y,0);o.push(p.x,p.y)}else for(let y=E+_;y<w;y+=_){const p=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],y,0);o.push(p.x,p.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const S=a.getPointOnCubicBezier(E,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);o.push(S.x,S.y)}else o=o.concat(f.points)});let s=o[0],u=o[0],c=o[1],h=o[1],v,g;for(let f=0;f<o.length/2;f++)v=o[f*2],g=o[f*2+1],isNaN(v)||(s=Math.min(s,v),u=Math.max(u,v)),isNaN(g)||(c=Math.min(c,g),h=Math.max(h,g));return{x:s,y:c,width:u-s,height:h-c}}getLength(){return this.pathLength}getPointAtLength(o){return a.getPointAtLengthOfDataArray(o,this.dataArray)}static getLineLength(o,s,u,c){return Math.sqrt((u-o)*(u-o)+(c-s)*(c-s))}static getPathLength(o){let s=0;for(let u=0;u<o.length;++u)s+=o[u].pathLength;return s}static getPointAtLengthOfDataArray(o,s){let u,c=0,h=s.length;if(!h)return null;for(;c<h&&o>s[c].pathLength;)o-=s[c].pathLength,++c;if(c===h)return u=s[c-1].points.slice(-2),{x:u[0],y:u[1]};if(o<.01)return s[c].command==="M"?(u=s[c].points.slice(0,2),{x:u[0],y:u[1]}):{x:s[c].start.x,y:s[c].start.y};const v=s[c],g=v.points;switch(v.command){case"L":return a.getPointOnLine(o,v.start.x,v.start.y,g[0],g[1]);case"C":return a.getPointOnCubicBezier((0,n.t2length)(o,a.getPathLength(s),m=>(0,n.getCubicArcLength)([v.start.x,g[0],g[2],g[4]],[v.start.y,g[1],g[3],g[5]],m)),v.start.x,v.start.y,g[0],g[1],g[2],g[3],g[4],g[5]);case"Q":return a.getPointOnQuadraticBezier((0,n.t2length)(o,a.getPathLength(s),m=>(0,n.getQuadraticArcLength)([v.start.x,g[0],g[2]],[v.start.y,g[1],g[3]],m)),v.start.x,v.start.y,g[0],g[1],g[2],g[3]);case"A":const f=g[0],E=g[1],S=g[2],w=g[3],_=g[5],y=g[6];let p=g[4];return p+=_*o/v.pathLength,a.getPointOnEllipticalArc(f,E,S,w,p,y)}return null}static getPointOnLine(o,s,u,c,h,v,g){v=v??s,g=g??u;const f=this.getLineLength(s,u,c,h);if(f<1e-10)return{x:s,y:u};if(c===s)return{x:v,y:g+(h>u?o:-o)};const E=(h-u)/(c-s),S=Math.sqrt(o*o/(1+E*E))*(c<s?-1:1),w=E*S;if(Math.abs(g-u-E*(v-s))<1e-10)return{x:v+S,y:g+w};const _=((v-s)*(c-s)+(g-u)*(h-u))/(f*f),y=s+_*(c-s),p=u+_*(h-u),m=this.getLineLength(v,g,y,p),P=Math.sqrt(o*o-m*m),T=Math.sqrt(P*P/(1+E*E))*(c<s?-1:1),k=E*T;return{x:y+T,y:p+k}}static getPointOnCubicBezier(o,s,u,c,h,v,g,f,E){function S(P){return P*P*P}function w(P){return 3*P*P*(1-P)}function _(P){return 3*P*(1-P)*(1-P)}function y(P){return(1-P)*(1-P)*(1-P)}const p=f*S(o)+v*w(o)+c*_(o)+s*y(o),m=E*S(o)+g*w(o)+h*_(o)+u*y(o);return{x:p,y:m}}static getPointOnQuadraticBezier(o,s,u,c,h,v,g){function f(y){return y*y}function E(y){return 2*y*(1-y)}function S(y){return(1-y)*(1-y)}const w=v*f(o)+c*E(o)+s*S(o),_=g*f(o)+h*E(o)+u*S(o);return{x:w,y:_}}static getPointOnEllipticalArc(o,s,u,c,h,v){const g=Math.cos(v),f=Math.sin(v),E={x:u*Math.cos(h),y:c*Math.sin(h)};return{x:o+(E.x*g-E.y*f),y:s+(E.x*f+E.y*g)}}static parsePathData(o){if(!o)return[];let s=o;const u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];s=s.replace(new RegExp(" ","g"),",");for(let w=0;w<u.length;w++)s=s.replace(new RegExp(u[w],"g"),"|"+u[w]);const c=s.split("|"),h=[],v=[];let g=0,f=0;const E=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let S;for(let w=1;w<c.length;w++){let _=c[w],y=_.charAt(0);for(_=_.slice(1),v.length=0;S=E.exec(_);)v.push(S[0]);const p=[];for(let m=0,P=v.length;m<P;m++){if(v[m]==="00"){p.push(0,0);continue}const T=parseFloat(v[m]);isNaN(T)?p.push(0):p.push(T)}for(;p.length>0&&!isNaN(p[0]);){let m="",P=[];const T=g,k=f;let L,I,R,A,O,M,q,D,te,H;switch(y){case"l":g+=p.shift(),f+=p.shift(),m="L",P.push(g,f);break;case"L":g=p.shift(),f=p.shift(),P.push(g,f);break;case"m":const B=p.shift(),$=p.shift();if(g+=B,f+=$,m="M",h.length>2&&h[h.length-1].command==="z"){for(let V=h.length-2;V>=0;V--)if(h[V].command==="M"){g=h[V].points[0]+B,f=h[V].points[1]+$;break}}P.push(g,f),y="l";break;case"M":g=p.shift(),f=p.shift(),m="M",P.push(g,f),y="L";break;case"h":g+=p.shift(),m="L",P.push(g,f);break;case"H":g=p.shift(),m="L",P.push(g,f);break;case"v":f+=p.shift(),m="L",P.push(g,f);break;case"V":f=p.shift(),m="L",P.push(g,f);break;case"C":P.push(p.shift(),p.shift(),p.shift(),p.shift()),g=p.shift(),f=p.shift(),P.push(g,f);break;case"c":P.push(g+p.shift(),f+p.shift(),g+p.shift(),f+p.shift()),g+=p.shift(),f+=p.shift(),m="C",P.push(g,f);break;case"S":I=g,R=f,L=h[h.length-1],L.command==="C"&&(I=g+(g-L.points[2]),R=f+(f-L.points[3])),P.push(I,R,p.shift(),p.shift()),g=p.shift(),f=p.shift(),m="C",P.push(g,f);break;case"s":I=g,R=f,L=h[h.length-1],L.command==="C"&&(I=g+(g-L.points[2]),R=f+(f-L.points[3])),P.push(I,R,g+p.shift(),f+p.shift()),g+=p.shift(),f+=p.shift(),m="C",P.push(g,f);break;case"Q":P.push(p.shift(),p.shift()),g=p.shift(),f=p.shift(),P.push(g,f);break;case"q":P.push(g+p.shift(),f+p.shift()),g+=p.shift(),f+=p.shift(),m="Q",P.push(g,f);break;case"T":I=g,R=f,L=h[h.length-1],L.command==="Q"&&(I=g+(g-L.points[0]),R=f+(f-L.points[1])),g=p.shift(),f=p.shift(),m="Q",P.push(I,R,g,f);break;case"t":I=g,R=f,L=h[h.length-1],L.command==="Q"&&(I=g+(g-L.points[0]),R=f+(f-L.points[1])),g+=p.shift(),f+=p.shift(),m="Q",P.push(I,R,g,f);break;case"A":A=p.shift(),O=p.shift(),M=p.shift(),q=p.shift(),D=p.shift(),te=g,H=f,g=p.shift(),f=p.shift(),m="A",P=this.convertEndpointToCenterParameterization(te,H,g,f,q,D,A,O,M);break;case"a":A=p.shift(),O=p.shift(),M=p.shift(),q=p.shift(),D=p.shift(),te=g,H=f,g+=p.shift(),f+=p.shift(),m="A",P=this.convertEndpointToCenterParameterization(te,H,g,f,q,D,A,O,M);break}h.push({command:m||y,points:P,start:{x:T,y:k},pathLength:this.calcLength(T,k,m||y,P)})}(y==="z"||y==="Z")&&h.push({command:"z",points:[],start:void 0,pathLength:0})}return h}static calcLength(o,s,u,c){let h,v,g,f;const E=a;switch(u){case"L":return E.getLineLength(o,s,c[0],c[1]);case"C":return(0,n.getCubicArcLength)([o,c[0],c[2],c[4]],[s,c[1],c[3],c[5]],1);case"Q":return(0,n.getQuadraticArcLength)([o,c[0],c[2]],[s,c[1],c[3]],1);case"A":h=0;const S=c[4],w=c[5],_=c[4]+w;let y=Math.PI/180;if(Math.abs(S-_)<y&&(y=Math.abs(S-_)),v=E.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],S,0),w<0)for(f=S-y;f>_;f-=y)g=E.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],f,0),h+=E.getLineLength(v.x,v.y,g.x,g.y),v=g;else for(f=S+y;f<_;f+=y)g=E.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],f,0),h+=E.getLineLength(v.x,v.y,g.x,g.y),v=g;return g=E.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],_,0),h+=E.getLineLength(v.x,v.y,g.x,g.y),h}return 0}static convertEndpointToCenterParameterization(o,s,u,c,h,v,g,f,E){const S=E*(Math.PI/180),w=Math.cos(S)*(o-u)/2+Math.sin(S)*(s-c)/2,_=-1*Math.sin(S)*(o-u)/2+Math.cos(S)*(s-c)/2,y=w*w/(g*g)+_*_/(f*f);y>1&&(g*=Math.sqrt(y),f*=Math.sqrt(y));let p=Math.sqrt((g*g*(f*f)-g*g*(_*_)-f*f*(w*w))/(g*g*(_*_)+f*f*(w*w)));h===v&&(p*=-1),isNaN(p)&&(p=0);const m=p*g*_/f,P=p*-f*w/g,T=(o+u)/2+Math.cos(S)*m-Math.sin(S)*P,k=(s+c)/2+Math.sin(S)*m+Math.cos(S)*P,L=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},I=function(D,te){return(D[0]*te[0]+D[1]*te[1])/(L(D)*L(te))},R=function(D,te){return(D[0]*te[1]<D[1]*te[0]?-1:1)*Math.acos(I(D,te))},A=R([1,0],[(w-m)/g,(_-P)/f]),O=[(w-m)/g,(_-P)/f],M=[(-1*w-m)/g,(-1*_-P)/f];let q=R(O,M);return I(O,M)<=-1&&(q=Math.PI),I(O,M)>=1&&(q=0),v===0&&q>0&&(q=q-2*Math.PI),v===1&&q<0&&(q=q+2*Math.PI),[T,k,g,f,A,q,S,v]}}return sd.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"data"),sd}var c5;function VS(){if(c5)return ad;c5=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Arrow=void 0;const e=Gr(),r=k6(),t=Yr(),n=jr(),a=fm();class i extends r.Line{_sceneFunc(s){super._sceneFunc(s);const u=Math.PI*2,c=this.points();let h=c;const v=this.tension()!==0&&c.length>4;v&&(h=this.getTensionPoints());const g=this.pointerLength(),f=c.length;let E,S;if(v){const y=[h[h.length-4],h[h.length-3],h[h.length-2],h[h.length-1],c[f-2],c[f-1]],p=a.Path.calcLength(h[h.length-4],h[h.length-3],"C",y),m=a.Path.getPointOnQuadraticBezier(Math.min(1,1-g/p),y[0],y[1],y[2],y[3],y[4],y[5]);E=c[f-2]-m.x,S=c[f-1]-m.y}else E=c[f-2]-c[f-4],S=c[f-1]-c[f-3];const w=(Math.atan2(S,E)+u)%u,_=this.pointerWidth();this.pointerAtEnding()&&(s.save(),s.beginPath(),s.translate(c[f-2],c[f-1]),s.rotate(w),s.moveTo(0,0),s.lineTo(-g,_/2),s.lineTo(-g,-_/2),s.closePath(),s.restore(),this.__fillStroke(s)),this.pointerAtBeginning()&&(s.save(),s.beginPath(),s.translate(c[0],c[1]),v?(E=(h[0]+h[2])/2-c[0],S=(h[1]+h[3])/2-c[1]):(E=c[2]-c[0],S=c[3]-c[1]),s.rotate((Math.atan2(-S,-E)+u)%u),s.moveTo(0,0),s.lineTo(-g,_/2),s.lineTo(-g,-_/2),s.closePath(),s.restore(),this.__fillStroke(s))}__fillStroke(s){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,s.setLineDash([])),s.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const s=super.getSelfRect(),u=this.pointerWidth()/2;return{x:s.x,y:s.y-u,width:s.width,height:s.height+u*2}}}return ad.Arrow=i,i.prototype.className="Arrow",(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerAtBeginning",!1),e.Factory.addGetterSetter(i,"pointerAtEnding",!0),ad}var ld={},f5;function GS(){if(f5)return ld;f5=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Circle=void 0;const e=Gr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius()!==o/2&&this.radius(o/2)}setHeight(o){this.radius()!==o/2&&this.radius(o/2)}}return ld.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),ld}var ud={},h5;function WS(){if(h5)return ud;h5=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Ellipse=void 0;const e=Gr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this.radiusX(),u=this.radiusY();o.beginPath(),o.save(),s!==u&&o.scale(1,u/s),o.arc(0,0,s,0,Math.PI*2,!1),o.restore(),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(o){this.radiusX(o/2)}setHeight(o){this.radiusY(o/2)}}return ud.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),ud}var cd={},d5;function $S(){if(d5)return cd;d5=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.Image=void 0;const e=Li(),r=Gr(),t=Ma(),n=jr(),a=Yr();class i extends t.Shape{constructor(s){super(s),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const s=this.image();s&&s.complete||s&&s.readyState===4||s&&s.addEventListener&&s.addEventListener("load",this._loadListener)}_removeImageLoad(s){s&&s.removeEventListener&&s.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const s=!!this.cornerRadius(),u=this.hasShadow();return s&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(s){const u=this.getWidth(),c=this.getHeight(),h=this.cornerRadius(),v=this.attrs.image;let g;if(v){const f=this.attrs.cropWidth,E=this.attrs.cropHeight;f&&E?g=[v,this.cropX(),this.cropY(),f,E,0,0,u,c]:g=[v,0,0,u,c]}(this.hasFill()||this.hasStroke()||h)&&(s.beginPath(),h?e.Util.drawRoundedRectPath(s,u,c,h):s.rect(0,0,u,c),s.closePath(),s.fillStrokeShape(this)),v&&(h&&s.clip(),s.drawImage.apply(s,g))}_hitFunc(s){const u=this.width(),c=this.height(),h=this.cornerRadius();s.beginPath(),h?e.Util.drawRoundedRectPath(s,u,c,h):s.rect(0,0,u,c),s.closePath(),s.fillStrokeShape(this)}getWidth(){var s,u;return(s=this.attrs.width)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.width}getHeight(){var s,u;return(s=this.attrs.height)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.height}static fromURL(s,u,c=null){const h=e.Util.createImageElement();h.onload=function(){const v=new i({image:h});u(v)},h.onerror=c,h.crossOrigin="Anonymous",h.src=s}}return cd.Image=i,i.prototype.className="Image",(0,n._registerNode)(i),r.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),r.Factory.addGetterSetter(i,"image"),r.Factory.addComponentsGetterSetter(i,"crop",["x","y","width","height"]),r.Factory.addGetterSetter(i,"cropX",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropY",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropWidth",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropHeight",0,(0,a.getNumberValidator)()),cd}var bf={},p5;function YS(){if(p5)return bf;p5=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Tag=bf.Label=void 0;const e=Gr(),r=Ma(),t=um(),n=Yr(),a=jr(),i=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],o="Change.konva",s="none",u="up",c="right",h="down",v="left",g=i.length;class f extends t.Group{constructor(w){super(w),this.on("add.konva",function(_){this._addListeners(_.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(w){let _=this,y;const p=function(){_._sync()};for(y=0;y<g;y++)w.on(i[y]+o,p)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let w=this.getText(),_=this.getTag(),y,p,m,P,T,k,L;if(w&&_){switch(y=w.width(),p=w.height(),m=_.pointerDirection(),P=_.pointerWidth(),L=_.pointerHeight(),T=0,k=0,m){case u:T=y/2,k=-1*L;break;case c:T=y+P,k=p/2;break;case h:T=y/2,k=p+L;break;case v:T=-1*P,k=p/2;break}_.setAttrs({x:-1*T,y:-1*k,width:y,height:p}),w.setAttrs({x:-1*T,y:-1*k})}}}bf.Label=f,f.prototype.className="Label",(0,a._registerNode)(f);class E extends r.Shape{_sceneFunc(w){const _=this.width(),y=this.height(),p=this.pointerDirection(),m=this.pointerWidth(),P=this.pointerHeight(),T=this.cornerRadius();let k=0,L=0,I=0,R=0;typeof T=="number"?k=L=I=R=Math.min(T,_/2,y/2):(k=Math.min(T[0]||0,_/2,y/2),L=Math.min(T[1]||0,_/2,y/2),R=Math.min(T[2]||0,_/2,y/2),I=Math.min(T[3]||0,_/2,y/2)),w.beginPath(),w.moveTo(k,0),p===u&&(w.lineTo((_-m)/2,0),w.lineTo(_/2,-1*P),w.lineTo((_+m)/2,0)),w.lineTo(_-L,0),w.arc(_-L,L,L,Math.PI*3/2,0,!1),p===c&&(w.lineTo(_,(y-P)/2),w.lineTo(_+m,y/2),w.lineTo(_,(y+P)/2)),w.lineTo(_,y-R),w.arc(_-R,y-R,R,0,Math.PI/2,!1),p===h&&(w.lineTo((_+m)/2,y),w.lineTo(_/2,y+P),w.lineTo((_-m)/2,y)),w.lineTo(I,y),w.arc(I,y-I,I,Math.PI/2,Math.PI,!1),p===v&&(w.lineTo(0,(y+P)/2),w.lineTo(-1*m,y/2),w.lineTo(0,(y-P)/2)),w.lineTo(0,k),w.arc(k,k,k,Math.PI,Math.PI*3/2,!1),w.closePath(),w.fillStrokeShape(this)}getSelfRect(){let w=0,_=0,y=this.pointerWidth(),p=this.pointerHeight(),m=this.pointerDirection(),P=this.width(),T=this.height();return m===u?(_-=p,T+=p):m===h?T+=p:m===v?(w-=y*1.5,P+=y):m===c&&(P+=y*1.5),{x:w,y:_,width:P,height:T}}}return bf.Tag=E,E.prototype.className="Tag",(0,a._registerNode)(E),e.Factory.addGetterSetter(E,"pointerDirection",s),e.Factory.addGetterSetter(E,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(E,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(E,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),bf}var fd={},g5;function L6(){if(g5)return fd;g5=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.Rect=void 0;const e=Gr(),r=Ma(),t=jr(),n=Li(),a=Yr();class i extends r.Shape{_sceneFunc(s){const u=this.cornerRadius(),c=this.width(),h=this.height();s.beginPath(),u?n.Util.drawRoundedRectPath(s,c,h,u):s.rect(0,0,c,h),s.closePath(),s.fillStrokeShape(this)}}return fd.Rect=i,i.prototype.className="Rect",(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),fd}var hd={},v5;function XS(){if(v5)return hd;v5=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.RegularPolygon=void 0;const e=Gr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this._getPoints();o.beginPath(),o.moveTo(s[0].x,s[0].y);for(let u=1;u<s.length;u++)o.lineTo(s[u].x,s[u].y);o.closePath(),o.fillStrokeShape(this)}_getPoints(){const o=this.attrs.sides,s=this.attrs.radius||0,u=[];for(let c=0;c<o;c++)u.push({x:s*Math.sin(c*2*Math.PI/o),y:-1*s*Math.cos(c*2*Math.PI/o)});return u}getSelfRect(){const o=this._getPoints();let s=o[0].x,u=o[0].y,c=o[0].x,h=o[0].y;return o.forEach(v=>{s=Math.min(s,v.x),u=Math.max(u,v.x),c=Math.min(c,v.y),h=Math.max(h,v.y)}),{x:s,y:c,width:u-s,height:h-c}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius(o/2)}setHeight(o){this.radius(o/2)}}return hd.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),hd}var dd={},m5;function KS(){if(m5)return dd;m5=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Ring=void 0;const e=Gr(),r=Ma(),t=Yr(),n=jr(),a=Math.PI*2;class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.innerRadius(),0,a,!1),s.moveTo(this.outerRadius(),0),s.arc(0,0,this.outerRadius(),a,0,!0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return dd.Ring=i,i.prototype.className="Ring",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,t.getNumberValidator)()),dd}var pd={},y5;function ZS(){if(y5)return pd;y5=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.Sprite=void 0;const e=Gr(),r=Ma(),t=cm(),n=Yr(),a=jr();class i extends r.Shape{constructor(s){super(s),this._updated=!0,this.anim=new t.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(s){const u=this.animation(),c=this.frameIndex(),h=c*4,v=this.animations()[u],g=this.frameOffsets(),f=v[h+0],E=v[h+1],S=v[h+2],w=v[h+3],_=this.image();if((this.hasFill()||this.hasStroke())&&(s.beginPath(),s.rect(0,0,S,w),s.closePath(),s.fillStrokeShape(this)),_)if(g){const y=g[u],p=c*2;s.drawImage(_,f,E,S,w,y[p+0],y[p+1],S,w)}else s.drawImage(_,f,E,S,w,0,0,S,w)}_hitFunc(s){const u=this.animation(),c=this.frameIndex(),h=c*4,v=this.animations()[u],g=this.frameOffsets(),f=v[h+2],E=v[h+3];if(s.beginPath(),g){const S=g[u],w=c*2;s.rect(S[w+0],S[w+1],f,E)}else s.rect(0,0,f,E);s.closePath(),s.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const s=this;this.interval=setInterval(function(){s._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const s=this.getLayer();this.anim.setLayers(s),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const s=this.frameIndex(),u=this.animation(),c=this.animations(),h=c[u],v=h.length/4;s<v-1?this.frameIndex(s+1):this.frameIndex(0)}}return pd.Sprite=i,i.prototype.className="Sprite",(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"animation"),e.Factory.addGetterSetter(i,"animations"),e.Factory.addGetterSetter(i,"frameOffsets"),e.Factory.addGetterSetter(i,"image"),e.Factory.addGetterSetter(i,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(i,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),pd}var gd={},b5;function QS(){if(b5)return gd;b5=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.Star=void 0;const e=Gr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this.innerRadius(),u=this.outerRadius(),c=this.numPoints();o.beginPath(),o.moveTo(0,0-u);for(let h=1;h<c*2;h++){const v=h%2===0?u:s,g=v*Math.sin(h*Math.PI/c),f=-1*v*Math.cos(h*Math.PI/c);o.lineTo(g,f)}o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}}return gd.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),gd}var rh={},w5;function N6(){if(w5)return rh;w5=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.Text=void 0,rh.stringToArray=o;const e=Li(),r=Gr(),t=Ma(),n=jr(),a=Yr(),i=jr();function o(z){return[...z].reduce((F,Y,J,X)=>{if(new RegExp("\\p{Emoji}","u").test(Y)){const Q=X[J+1];Q&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Q)?(F.push(Y+Q),X[J+1]=""):F.push(Y)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(Y+(X[J+1]||""))?F.push(Y+X[J+1]):J>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(Y)?F[F.length-1]+=Y:Y&&F.push(Y);return F},[])}const s="auto",u="center",c="inherit",h="justify",v="Change.konva",g="2d",f="-",E="left",S="text",w="Text",_="top",y="bottom",p="middle",m="normal",P="px ",T=" ",k="right",L="rtl",I="word",R="char",A="none",O="…",M=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],q=M.length;function D(z){return z.split(",").map(F=>{F=F.trim();const Y=F.indexOf(" ")>=0,J=F.indexOf('"')>=0||F.indexOf("'")>=0;return Y&&!J&&(F=`"${F}"`),F}).join(", ")}let te;function H(){return te||(te=e.Util.createCanvasElement().getContext(g),te)}function B(z){z.fillText(this._partialText,this._partialTextX,this._partialTextY)}function $(z){z.setAttr("miterLimit",2),z.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function V(z){return z=z||{},!z.fillLinearGradientColorStops&&!z.fillRadialGradientColorStops&&!z.fillPatternImage&&(z.fill=z.fill||"black"),z}class j extends t.Shape{constructor(F){super(V(F)),this._partialTextX=0,this._partialTextY=0;for(let Y=0;Y<q;Y++)this.on(M[Y]+v,this._setTextData);this._setTextData()}_sceneFunc(F){const Y=this.textArr,J=Y.length;if(!this.text())return;let X=this.padding(),Q=this.fontSize(),ae=this.lineHeight()*Q,se=this.verticalAlign(),fe=this.direction(),be=0,_e=this.align(),Ae=this.getWidth(),Re=this.letterSpacing(),Pe=this.fill(),ye=this.textDecoration(),nt=ye.indexOf("underline")!==-1,Ce=ye.indexOf("line-through")!==-1,he;fe=fe===c?F.direction:fe;let ke=ae/2,Te=p;if(n.Konva._fixTextRendering){const ve=this.measureSize("M");Te="alphabetic",ke=(ve.fontBoundingBoxAscent-ve.fontBoundingBoxDescent)/2+ae/2}for(fe===L&&F.setAttr("direction",fe),F.setAttr("font",this._getContextFont()),F.setAttr("textBaseline",Te),F.setAttr("textAlign",E),se===p?be=(this.getHeight()-J*ae-X*2)/2:se===y&&(be=this.getHeight()-J*ae-X*2),F.translate(X,be+X),he=0;he<J;he++){let ve=0,Se=0;const je=Y[he],Ue=je.text,ct=je.width,mt=je.lastInParagraph;if(F.save(),_e===k?ve+=Ae-ct-X*2:_e===u&&(ve+=(Ae-ct-X*2)/2),nt){F.save(),F.beginPath();const yt=n.Konva._fixTextRendering?Math.round(Q/4):Math.round(Q/2),Je=ve,lt=ke+Se+yt;F.moveTo(Je,lt);const ze=_e===h&&!mt?Ae-X*2:ct;F.lineTo(Je+Math.round(ze),lt),F.lineWidth=Q/15;const kt=this._getLinearGradient();F.strokeStyle=kt||Pe,F.stroke(),F.restore()}if(Ce){F.save(),F.beginPath();const yt=n.Konva._fixTextRendering?-Math.round(Q/4):0;F.moveTo(ve,ke+Se+yt);const Je=_e===h&&!mt?Ae-X*2:ct;F.lineTo(ve+Math.round(Je),ke+Se+yt),F.lineWidth=Q/15;const lt=this._getLinearGradient();F.strokeStyle=lt||Pe,F.stroke(),F.restore()}if(fe!==L&&(Re!==0||_e===h)){const yt=Ue.split(" ").length-1,Je=o(Ue);for(let lt=0;lt<Je.length;lt++){const ze=Je[lt];ze===" "&&!mt&&_e===h&&(ve+=(Ae-X*2-ct)/yt),this._partialTextX=ve,this._partialTextY=ke+Se,this._partialText=ze,F.fillStrokeShape(this),ve+=this.measureSize(ze).width+Re}}else Re!==0&&F.setAttr("letterSpacing",`${Re}px`),this._partialTextX=ve,this._partialTextY=ke+Se,this._partialText=Ue,F.fillStrokeShape(this);F.restore(),J>1&&(ke+=ae)}}_hitFunc(F){const Y=this.getWidth(),J=this.getHeight();F.beginPath(),F.rect(0,0,Y,J),F.closePath(),F.fillStrokeShape(this)}setText(F){const Y=e.Util._isString(F)?F:F==null?"":F+"";return this._setAttr(S,Y),this}getWidth(){return this.attrs.width===s||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===s||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(F){var Y,J,X,Q,ae,se,fe,be,_e,Ae,Re;let Pe=H(),ye=this.fontSize(),nt;Pe.save(),Pe.font=this._getContextFont(),nt=Pe.measureText(F),Pe.restore();const Ce=ye/100;return{actualBoundingBoxAscent:(Y=nt.actualBoundingBoxAscent)!==null&&Y!==void 0?Y:71.58203125*Ce,actualBoundingBoxDescent:(J=nt.actualBoundingBoxDescent)!==null&&J!==void 0?J:0,actualBoundingBoxLeft:(X=nt.actualBoundingBoxLeft)!==null&&X!==void 0?X:-7.421875*Ce,actualBoundingBoxRight:(Q=nt.actualBoundingBoxRight)!==null&&Q!==void 0?Q:75.732421875*Ce,alphabeticBaseline:(ae=nt.alphabeticBaseline)!==null&&ae!==void 0?ae:0,emHeightAscent:(se=nt.emHeightAscent)!==null&&se!==void 0?se:100*Ce,emHeightDescent:(fe=nt.emHeightDescent)!==null&&fe!==void 0?fe:-20*Ce,fontBoundingBoxAscent:(be=nt.fontBoundingBoxAscent)!==null&&be!==void 0?be:91*Ce,fontBoundingBoxDescent:(_e=nt.fontBoundingBoxDescent)!==null&&_e!==void 0?_e:21*Ce,hangingBaseline:(Ae=nt.hangingBaseline)!==null&&Ae!==void 0?Ae:72.80000305175781*Ce,ideographicBaseline:(Re=nt.ideographicBaseline)!==null&&Re!==void 0?Re:-21*Ce,width:nt.width,height:ye}}_getContextFont(){return this.fontStyle()+T+this.fontVariant()+T+(this.fontSize()+P)+D(this.fontFamily())}_addTextLine(F){this.align()===h&&(F=F.trim());const J=this._getTextWidth(F);return this.textArr.push({text:F,width:J,lastInParagraph:!1})}_getTextWidth(F){const Y=this.letterSpacing(),J=F.length;return H().measureText(F).width+Y*J}_setTextData(){let F=this.text().split(`
|
|
43
|
+
`),Y=+this.fontSize(),J=0,X=this.lineHeight()*Y,Q=this.attrs.width,ae=this.attrs.height,se=Q!==s&&Q!==void 0,fe=ae!==s&&ae!==void 0,be=this.padding(),_e=Q-be*2,Ae=ae-be*2,Re=0,Pe=this.wrap(),ye=Pe!==A,nt=Pe!==R&&ye,Ce=this.ellipsis();this.textArr=[],H().font=this._getContextFont();const he=Ce?this._getTextWidth(O):0;for(let ke=0,Te=F.length;ke<Te;++ke){let ve=F[ke],Se=this._getTextWidth(ve);if(se&&Se>_e)for(;ve.length>0;){let je=0,Ue=o(ve).length,ct="",mt=0;for(;je<Ue;){const yt=je+Ue>>>1,Je=o(ve),lt=Je.slice(0,yt+1).join(""),ze=this._getTextWidth(lt);(Ce&&fe&&Re+X>Ae?ze+he:ze)<=_e?(je=yt+1,ct=lt,mt=ze):Ue=yt}if(ct){if(nt){const lt=o(ve),ze=o(ct),kt=lt[ze.length],pt=kt===T||kt===f;let Ut;if(pt&&mt<=_e)Ut=ze.length;else{const Ht=ze.lastIndexOf(T),Me=ze.lastIndexOf(f);Ut=Math.max(Ht,Me)+1}Ut>0&&(je=Ut,ct=lt.slice(0,je).join(""),mt=this._getTextWidth(ct))}if(ct=ct.trimRight(),this._addTextLine(ct),J=Math.max(J,mt),Re+=X,this._shouldHandleEllipsis(Re)){this._tryToAddEllipsisToLastLine();break}if(ve=o(ve).slice(je).join("").trimLeft(),ve.length>0&&(Se=this._getTextWidth(ve),Se<=_e)){this._addTextLine(ve),Re+=X,J=Math.max(J,Se);break}}else break}else this._addTextLine(ve),Re+=X,J=Math.max(J,Se),this._shouldHandleEllipsis(Re)&&ke<Te-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),fe&&Re+X>Ae)break}this.textHeight=Y,this.textWidth=J}_shouldHandleEllipsis(F){const Y=+this.fontSize(),J=this.lineHeight()*Y,X=this.attrs.height,Q=X!==s&&X!==void 0,ae=this.padding(),se=X-ae*2;return!(this.wrap()!==A)||Q&&F+J>se}_tryToAddEllipsisToLastLine(){const F=this.attrs.width,Y=F!==s&&F!==void 0,J=this.padding(),X=F-J*2,Q=this.ellipsis(),ae=this.textArr[this.textArr.length-1];!ae||!Q||(Y&&(this._getTextWidth(ae.text+O)<X||(ae.text=ae.text.slice(0,ae.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(ae.text+O))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const F=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,Y=this.hasShadow();return F&&Y?!0:super._useBufferCanvas()}}return rh.Text=j,j.prototype._fillFunc=B,j.prototype._strokeFunc=$,j.prototype.className=w,j.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,i._registerNode)(j),r.Factory.overWriteSetter(j,"width",(0,a.getNumberOrAutoValidator)()),r.Factory.overWriteSetter(j,"height",(0,a.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(j,"direction",c),r.Factory.addGetterSetter(j,"fontFamily","Arial"),r.Factory.addGetterSetter(j,"fontSize",12,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(j,"fontStyle",m),r.Factory.addGetterSetter(j,"fontVariant",m),r.Factory.addGetterSetter(j,"padding",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(j,"align",E),r.Factory.addGetterSetter(j,"verticalAlign",_),r.Factory.addGetterSetter(j,"lineHeight",1,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(j,"wrap",I),r.Factory.addGetterSetter(j,"ellipsis",!1,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(j,"letterSpacing",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(j,"text","",(0,a.getStringValidator)()),r.Factory.addGetterSetter(j,"textDecoration",""),rh}var vd={},_5;function JS(){if(_5)return vd;_5=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.TextPath=void 0;const e=Li(),r=Gr(),t=Ma(),n=fm(),a=N6(),i=Yr(),o=jr(),s="",u="normal";function c(g){g.fillText(this.partialText,0,0)}function h(g){g.strokeText(this.partialText,0,0)}class v extends t.Shape{constructor(f){super(f),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return n.Path.getPathLength(this.dataArray)}_getPointAtLength(f){if(!this.attrs.data)return null;const E=this.pathLength;return f-1>E?null:n.Path.getPointAtLengthOfDataArray(f,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(f){f.setAttr("font",this._getContextFont()),f.setAttr("textBaseline",this.textBaseline()),f.setAttr("textAlign","left"),f.save();const E=this.textDecoration(),S=this.fill(),w=this.fontSize(),_=this.glyphInfo;E==="underline"&&f.beginPath();for(let y=0;y<_.length;y++){f.save();const p=_[y].p0;f.translate(p.x,p.y),f.rotate(_[y].rotation),this.partialText=_[y].text,f.fillStrokeShape(this),E==="underline"&&(y===0&&f.moveTo(0,w/2+1),f.lineTo(w,w/2+1)),f.restore()}E==="underline"&&(f.strokeStyle=S,f.lineWidth=w/20,f.stroke()),f.restore()}_hitFunc(f){f.beginPath();const E=this.glyphInfo;if(E.length>=1){const S=E[0].p0;f.moveTo(S.x,S.y)}for(let S=0;S<E.length;S++){const w=E[S].p1;f.lineTo(w.x,w.y)}f.setAttr("lineWidth",this.fontSize()),f.setAttr("strokeStyle",this.colorKey),f.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(f){return a.Text.prototype.setText.call(this,f)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(f){const S=this.dummyCanvas.getContext("2d");S.save(),S.font=this._getContextFont();const w=S.measureText(f);return S.restore(),{width:w.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:f,height:E}=this._getTextSize(this.attrs.text);if(this.textWidth=f,this.textHeight=E,this.glyphInfo=[],!this.attrs.data)return null;const S=this.letterSpacing(),w=this.align(),_=this.kerningFunc(),y=Math.max(this.textWidth+((this.attrs.text||"").length-1)*S,0);let p=0;w==="center"&&(p=Math.max(0,this.pathLength/2-y/2)),w==="right"&&(p=Math.max(0,this.pathLength-y));const m=(0,a.stringToArray)(this.text());let P=p;for(let T=0;T<m.length;T++){const k=this._getPointAtLength(P);if(!k)return;let L=this._getTextSize(m[T]).width+S;if(m[T]===" "&&w==="justify"){const q=this.text().split(" ").length-1;L+=(this.pathLength-y)/q}const I=this._getPointAtLength(P+L);if(!I)return;const R=n.Path.getLineLength(k.x,k.y,I.x,I.y);let A=0;if(_)try{A=_(m[T-1],m[T])*this.fontSize()}catch{A=0}k.x+=A,I.x+=A,this.textWidth+=A;const O=n.Path.getPointOnLine(A+R/2,k.x,k.y,I.x,I.y),M=Math.atan2(I.y-k.y,I.x-k.x);this.glyphInfo.push({transposeX:O.x,transposeY:O.y,text:m[T],rotation:M,p0:k,p1:I}),P+=L}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const f=[];this.glyphInfo.forEach(function(P){f.push(P.p0.x),f.push(P.p0.y),f.push(P.p1.x),f.push(P.p1.y)});let E=f[0]||0,S=f[0]||0,w=f[1]||0,_=f[1]||0,y,p;for(let P=0;P<f.length/2;P++)y=f[P*2],p=f[P*2+1],E=Math.min(E,y),S=Math.max(S,y),w=Math.min(w,p),_=Math.max(_,p);const m=this.fontSize();return{x:E-m/2,y:w-m/2,width:S-E+m,height:_-w+m}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return vd.TextPath=v,v.prototype._fillFunc=c,v.prototype._strokeFunc=h,v.prototype._fillFuncHit=c,v.prototype._strokeFuncHit=h,v.prototype.className="TextPath",v.prototype._attrsAffectingSize=["text","fontSize","data"],(0,o._registerNode)(v),r.Factory.addGetterSetter(v,"data"),r.Factory.addGetterSetter(v,"fontFamily","Arial"),r.Factory.addGetterSetter(v,"fontSize",12,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(v,"fontStyle",u),r.Factory.addGetterSetter(v,"align","left"),r.Factory.addGetterSetter(v,"letterSpacing",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(v,"textBaseline","middle"),r.Factory.addGetterSetter(v,"fontVariant",u),r.Factory.addGetterSetter(v,"text",s),r.Factory.addGetterSetter(v,"textDecoration",""),r.Factory.addGetterSetter(v,"kerningFunc",void 0),vd}var md={},S5;function ex(){if(S5)return md;S5=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Transformer=void 0;const e=Li(),r=Gr(),t=Ji(),n=Ma(),a=L6(),i=um(),o=jr(),s=Yr(),u=jr(),c="tr-konva",h=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(L=>L+`.${c}`).join(" "),v="nodesRect",g=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],f={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},E="ontouchstart"in o.Konva._global;function S(L,I,R){if(L==="rotater")return R;I+=e.Util.degToRad(f[L]||0);const A=(e.Util.radToDeg(I)%360+360)%360;return e.Util._inRange(A,315+22.5,360)||e.Util._inRange(A,0,22.5)?"ns-resize":e.Util._inRange(A,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(A,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(A,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(A,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(A,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(A,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(A,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+A),"pointer")}const w=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function _(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 y(L,I,R){const A=R.x+(L.x-R.x)*Math.cos(I)-(L.y-R.y)*Math.sin(I),O=R.y+(L.x-R.x)*Math.sin(I)+(L.y-R.y)*Math.cos(I);return{...L,rotation:L.rotation+I,x:A,y:O}}function p(L,I){const R=_(L);return y(L,I,R)}function m(L,I,R){let A=I;for(let O=0;O<L.length;O++){const M=o.Konva.getAngle(L[O]),q=Math.abs(M-I)%(Math.PI*2);Math.min(q,Math.PI*2-q)<R&&(A=M)}return A}let P=0;class T extends i.Group{constructor(I){super(I),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(h,this.update),this.getNode()&&this.update()}attachTo(I){return this.setNode(I),this}setNode(I){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([I])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return c+this._id}setNodes(I=[]){this._nodes&&this._nodes.length&&this.detach();const R=I.filter(O=>O.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=I=R,I.length===1&&this.useSingleNodeRotation()?this.rotation(I[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(O=>{const M=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(O._attrsAffectingSize.length){const q=O._attrsAffectingSize.map(D=>D+"Change."+this._getEventNamespace()).join(" ");O.on(q,M)}O.on(g.map(q=>q+`.${this._getEventNamespace()}`).join(" "),M),O.on(`absoluteTransformChange.${this._getEventNamespace()}`,M),this._proxyDrag(O)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(I){let R;I.on(`dragstart.${this._getEventNamespace()}`,A=>{R=I.getAbsolutePosition(),!this.isDragging()&&I!==this.findOne(".back")&&this.startDrag(A,!1)}),I.on(`dragmove.${this._getEventNamespace()}`,A=>{if(!R)return;const O=I.getAbsolutePosition(),M=O.x-R.x,q=O.y-R.y;this.nodes().forEach(D=>{if(D===I||D.isDragging())return;const te=D.getAbsolutePosition();D.setAbsolutePosition({x:te.x+M,y:te.y+q}),D.startDrag(A)}),R=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(I=>{I.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(I,R=this.rotation(),A){const O=I.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),M=I.getAbsoluteScale(A),q=I.getAbsolutePosition(A),D=O.x*M.x-I.offsetX()*M.x,te=O.y*M.y-I.offsetY()*M.y,H=(o.Konva.getAngle(I.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),B={x:q.x+D*Math.cos(H)+te*Math.sin(-H),y:q.y+te*Math.cos(H)+D*Math.sin(H),width:O.width*M.x,height:O.height*M.y,rotation:H};return y(B,-o.Konva.getAngle(R),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const R=[];this.nodes().map(H=>{const B=H.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),$=[{x:B.x,y:B.y},{x:B.x+B.width,y:B.y},{x:B.x+B.width,y:B.y+B.height},{x:B.x,y:B.y+B.height}],V=H.getAbsoluteTransform();$.forEach(function(j){const z=V.point(j);R.push(z)})});const A=new e.Transform;A.rotate(-o.Konva.getAngle(this.rotation()));let O=1/0,M=1/0,q=-1/0,D=-1/0;R.forEach(function(H){const B=A.point(H);O===void 0&&(O=q=B.x,M=D=B.y),O=Math.min(O,B.x),M=Math.min(M,B.y),q=Math.max(q,B.x),D=Math.max(D,B.y)}),A.invert();const te=A.point({x:O,y:M});return{x:te.x,y:te.y,width:q-O,height:D-M,rotation:o.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),w.forEach(I=>{this._createAnchor(I)}),this._createAnchor("rotater")}_createAnchor(I){const R=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:I+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:E?10:"auto"}),A=this;R.on("mousedown touchstart",function(O){A._handleMouseDown(O)}),R.on("dragstart",O=>{R.stopDrag(),O.cancelBubble=!0}),R.on("dragend",O=>{O.cancelBubble=!0}),R.on("mouseenter",()=>{const O=o.Konva.getAngle(this.rotation()),M=this.rotateAnchorCursor(),q=S(I,O,M);R.getStage().content&&(R.getStage().content.style.cursor=q),this._cursorChange=!0}),R.on("mouseout",()=>{R.getStage().content&&(R.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(R)}_createBack(){const I=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(R,A){const O=A.getParent(),M=O.padding();R.beginPath(),R.rect(-M,-M,A.width()+M*2,A.height()+M*2),R.moveTo(A.width()/2,-M),O.rotateEnabled()&&O.rotateLineVisible()&&R.lineTo(A.width()/2,-O.rotateAnchorOffset()*e.Util._sign(A.height())-M),R.fillStrokeShape(A)},hitFunc:(R,A)=>{if(!this.shouldOverdrawWholeArea())return;const O=this.padding();R.beginPath(),R.rect(-O,-O,A.width()+O*2,A.height()+O*2),R.fillStrokeShape(A)}});this.add(I),this._proxyDrag(I),I.on("dragstart",R=>{R.cancelBubble=!0}),I.on("dragmove",R=>{R.cancelBubble=!0}),I.on("dragend",R=>{R.cancelBubble=!0}),this.on("dragmove",R=>{this.update()})}_handleMouseDown(I){if(this._transforming)return;this._movingAnchorName=I.target.name().split(" ")[0];const R=this._getNodeRect(),A=R.width,O=R.height,M=Math.sqrt(Math.pow(A,2)+Math.pow(O,2));this.sin=Math.abs(O/M),this.cos=Math.abs(A/M),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 q=I.target.getAbsolutePosition(),D=I.target.getStage().getPointerPosition();this._anchorDragOffset={x:D.x-q.x,y:D.y-q.y},P++,this._fire("transformstart",{evt:I.evt,target:this.getNode()}),this._nodes.forEach(te=>{te._fire("transformstart",{evt:I.evt,target:te})})}_handleMouseMove(I){let R,A,O;const M=this.findOne("."+this._movingAnchorName),q=M.getStage();q.setPointersPositions(I);const D=q.getPointerPosition();let te={x:D.x-this._anchorDragOffset.x,y:D.y-this._anchorDragOffset.y};const H=M.getAbsolutePosition();this.anchorDragBoundFunc()&&(te=this.anchorDragBoundFunc()(H,te,I)),M.setAbsolutePosition(te);const B=M.getAbsolutePosition();if(H.x===B.x&&H.y===B.y)return;if(this._movingAnchorName==="rotater"){const X=this._getNodeRect();R=M.x()-X.width/2,A=-M.y()+X.height/2;let Q=Math.atan2(-A,R)+Math.PI/2;X.height<0&&(Q-=Math.PI);const se=o.Konva.getAngle(this.rotation())+Q,fe=o.Konva.getAngle(this.rotationSnapTolerance()),_e=m(this.rotationSnaps(),se,fe)-X.rotation,Ae=p(X,_e);this._fitNodesInto(Ae,I);return}const $=this.shiftBehavior();let V;$==="inverted"?V=this.keepRatio()&&!I.shiftKey:$==="none"?V=this.keepRatio():V=this.keepRatio()||I.shiftKey;let j=this.centeredScaling()||I.altKey;if(this._movingAnchorName==="top-left"){if(V){const X=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};O=Math.sqrt(Math.pow(X.x-M.x(),2)+Math.pow(X.y-M.y(),2));const Q=this.findOne(".top-left").x()>X.x?-1:1,ae=this.findOne(".top-left").y()>X.y?-1:1;R=O*this.cos*Q,A=O*this.sin*ae,this.findOne(".top-left").x(X.x-R),this.findOne(".top-left").y(X.y-A)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(M.y());else if(this._movingAnchorName==="top-right"){if(V){const X=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};O=Math.sqrt(Math.pow(M.x()-X.x,2)+Math.pow(X.y-M.y(),2));const Q=this.findOne(".top-right").x()<X.x?-1:1,ae=this.findOne(".top-right").y()>X.y?-1:1;R=O*this.cos*Q,A=O*this.sin*ae,this.findOne(".top-right").x(X.x+R),this.findOne(".top-right").y(X.y-A)}var z=M.position();this.findOne(".top-left").y(z.y),this.findOne(".bottom-right").x(z.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(M.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(M.x());else if(this._movingAnchorName==="bottom-left"){if(V){const X=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};O=Math.sqrt(Math.pow(X.x-M.x(),2)+Math.pow(M.y()-X.y,2));const Q=X.x<M.x()?-1:1,ae=M.y()<X.y?-1:1;R=O*this.cos*Q,A=O*this.sin*ae,M.x(X.x-R),M.y(X.y+A)}z=M.position(),this.findOne(".top-left").x(z.x),this.findOne(".bottom-right").y(z.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(M.y());else if(this._movingAnchorName==="bottom-right"){if(V){const X=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};O=Math.sqrt(Math.pow(M.x()-X.x,2)+Math.pow(M.y()-X.y,2));const Q=this.findOne(".bottom-right").x()<X.x?-1:1,ae=this.findOne(".bottom-right").y()<X.y?-1:1;R=O*this.cos*Q,A=O*this.sin*ae,this.findOne(".bottom-right").x(X.x+R),this.findOne(".bottom-right").y(X.y+A)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(j=this.centeredScaling()||I.altKey,j){const X=this.findOne(".top-left"),Q=this.findOne(".bottom-right"),ae=X.x(),se=X.y(),fe=this.getWidth()-Q.x(),be=this.getHeight()-Q.y();Q.move({x:-ae,y:-se}),X.move({x:fe,y:be})}const F=this.findOne(".top-left").getAbsolutePosition();R=F.x,A=F.y;const Y=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),J=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:R,y:A,width:Y,height:J,rotation:o.Konva.getAngle(this.rotation())},I)}_handleMouseUp(I){this._removeEvents(I)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(I){var R;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const A=this.getNode();P--,this._fire("transformend",{evt:I,target:A}),(R=this.getLayer())===null||R===void 0||R.batchDraw(),A&&this._nodes.forEach(O=>{var M;O._fire("transformend",{evt:I,target:O}),(M=O.getLayer())===null||M===void 0||M.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(I,R){const A=this._getNodeRect(),O=1;if(e.Util._inRange(I.width,-this.padding()*2-O,O)){this.update();return}if(e.Util._inRange(I.height,-this.padding()*2-O,O)){this.update();return}const M=new e.Transform;if(M.rotate(o.Konva.getAngle(this.rotation())),this._movingAnchorName&&I.width<0&&this._movingAnchorName.indexOf("left")>=0){const V=M.point({x:-this.padding()*2,y:0});I.x+=V.x,I.y+=V.y,I.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y}else if(this._movingAnchorName&&I.width<0&&this._movingAnchorName.indexOf("right")>=0){const V=M.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,I.width+=this.padding()*2}if(this._movingAnchorName&&I.height<0&&this._movingAnchorName.indexOf("top")>=0){const V=M.point({x:0,y:-this.padding()*2});I.x+=V.x,I.y+=V.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,I.height+=this.padding()*2}else if(this._movingAnchorName&&I.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const V=M.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,I.height+=this.padding()*2}if(this.boundBoxFunc()){const V=this.boundBoxFunc()(A,I);V?I=V:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const q=1e7,D=new e.Transform;D.translate(A.x,A.y),D.rotate(A.rotation),D.scale(A.width/q,A.height/q);const te=new e.Transform,H=I.width/q,B=I.height/q;this.flipEnabled()===!1?(te.translate(I.x,I.y),te.rotate(I.rotation),te.translate(I.width<0?I.width:0,I.height<0?I.height:0),te.scale(Math.abs(H),Math.abs(B))):(te.translate(I.x,I.y),te.rotate(I.rotation),te.scale(H,B));const $=te.multiply(D.invert());this._nodes.forEach(V=>{var j;const z=V.getParent().getAbsoluteTransform(),F=V.getTransform().copy();F.translate(V.offsetX(),V.offsetY());const Y=new e.Transform;Y.multiply(z.copy().invert()).multiply($).multiply(z).multiply(F);const J=Y.decompose();V.setAttrs(J),(j=V.getLayer())===null||j===void 0||j.batchDraw()}),this.rotation(e.Util._getRotation(I.rotation)),this._nodes.forEach(V=>{this._fire("transform",{evt:R,target:V}),V._fire("transform",{evt:R,target:V})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(I,R){this.findOne(I).setAttrs(R)}update(){var I;const R=this._getNodeRect();this.rotation(e.Util._getRotation(R.rotation));const A=R.width,O=R.height,M=this.enabledAnchors(),q=this.resizeEnabled(),D=this.padding(),te=this.anchorSize(),H=this.find("._anchor");H.forEach($=>{$.setAttrs({width:te,height:te,offsetX:te/2,offsetY:te/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:te/2+D,offsetY:te/2+D,visible:q&&M.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:A/2,y:0,offsetY:te/2+D,visible:q&&M.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:A,y:0,offsetX:te/2-D,offsetY:te/2+D,visible:q&&M.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:O/2,offsetX:te/2+D,visible:q&&M.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:A,y:O/2,offsetX:te/2-D,visible:q&&M.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:O,offsetX:te/2+D,offsetY:te/2-D,visible:q&&M.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:A/2,y:O,offsetY:te/2-D,visible:q&&M.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:A,y:O,offsetX:te/2-D,offsetY:te/2-D,visible:q&&M.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:A/2,y:-this.rotateAnchorOffset()*e.Util._sign(O)-D,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:A,height:O,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const B=this.anchorStyleFunc();B&&H.forEach($=>{B($)}),(I=this.getLayer())===null||I===void 0||I.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const I=this.findOne("."+this._movingAnchorName);I&&I.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(I){return t.Node.prototype.clone.call(this,I)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}md.Transformer=T,T.isTransforming=()=>P>0;function k(L){return L instanceof Array||e.Util.warn("enabledAnchors value should be an array"),L instanceof Array&&L.forEach(function(I){w.indexOf(I)===-1&&e.Util.warn("Unknown anchor name: "+I+". Available names are: "+w.join(", "))}),L||[]}return T.prototype.className="Transformer",(0,u._registerNode)(T),r.Factory.addGetterSetter(T,"enabledAnchors",w,k),r.Factory.addGetterSetter(T,"flipEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(T,"resizeEnabled",!0),r.Factory.addGetterSetter(T,"anchorSize",10,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"rotateEnabled",!0),r.Factory.addGetterSetter(T,"rotateLineVisible",!0),r.Factory.addGetterSetter(T,"rotationSnaps",[]),r.Factory.addGetterSetter(T,"rotateAnchorOffset",50,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"rotateAnchorCursor","crosshair"),r.Factory.addGetterSetter(T,"rotationSnapTolerance",5,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"borderEnabled",!0),r.Factory.addGetterSetter(T,"anchorStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(T,"anchorStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"anchorFill","white"),r.Factory.addGetterSetter(T,"anchorCornerRadius",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"borderStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(T,"borderStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"borderDash"),r.Factory.addGetterSetter(T,"keepRatio",!0),r.Factory.addGetterSetter(T,"shiftBehavior","default"),r.Factory.addGetterSetter(T,"centeredScaling",!1),r.Factory.addGetterSetter(T,"ignoreStroke",!1),r.Factory.addGetterSetter(T,"padding",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(T,"nodes"),r.Factory.addGetterSetter(T,"node"),r.Factory.addGetterSetter(T,"boundBoxFunc"),r.Factory.addGetterSetter(T,"anchorDragBoundFunc"),r.Factory.addGetterSetter(T,"anchorStyleFunc"),r.Factory.addGetterSetter(T,"shouldOverdrawWholeArea",!1),r.Factory.addGetterSetter(T,"useSingleNodeRotation",!0),r.Factory.backCompat(T,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),md}var yd={},x5;function tx(){if(x5)return yd;x5=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.Wedge=void 0;const e=Gr(),r=Ma(),t=jr(),n=Yr(),a=jr();class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),s.lineTo(0,0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return yd.Wedge=i,i.prototype.className="Wedge",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1),e.Factory.backCompat(i,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),yd}var bd={},E5;function rx(){if(E5)return bd;E5=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.Blur=void 0;const e=Gr(),r=Ji(),t=Yr();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],i=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function o(u,c){const h=u.data,v=u.width,g=u.height;let f,E,S,w,_,y,p,m,P,T,k,L,I,R,A,O,M,q,D,te;const H=c+c+1,B=v-1,$=g-1,V=c+1,j=V*(V+1)/2,z=new n,F=a[c],Y=i[c];let J=null,X=z,Q=null,ae=null;for(let se=1;se<H;se++)X=X.next=new n,se===V&&(J=X);X.next=z,S=E=0;for(let se=0;se<g;se++){L=I=R=A=w=_=y=p=0,m=V*(O=h[E]),P=V*(M=h[E+1]),T=V*(q=h[E+2]),k=V*(D=h[E+3]),w+=j*O,_+=j*M,y+=j*q,p+=j*D,X=z;for(let fe=0;fe<V;fe++)X.r=O,X.g=M,X.b=q,X.a=D,X=X.next;for(let fe=1;fe<V;fe++)f=E+((B<fe?B:fe)<<2),w+=(X.r=O=h[f])*(te=V-fe),_+=(X.g=M=h[f+1])*te,y+=(X.b=q=h[f+2])*te,p+=(X.a=D=h[f+3])*te,L+=O,I+=M,R+=q,A+=D,X=X.next;Q=z,ae=J;for(let fe=0;fe<v;fe++)h[E+3]=D=p*F>>Y,D!==0?(D=255/D,h[E]=(w*F>>Y)*D,h[E+1]=(_*F>>Y)*D,h[E+2]=(y*F>>Y)*D):h[E]=h[E+1]=h[E+2]=0,w-=m,_-=P,y-=T,p-=k,m-=Q.r,P-=Q.g,T-=Q.b,k-=Q.a,f=S+((f=fe+c+1)<B?f:B)<<2,L+=Q.r=h[f],I+=Q.g=h[f+1],R+=Q.b=h[f+2],A+=Q.a=h[f+3],w+=L,_+=I,y+=R,p+=A,Q=Q.next,m+=O=ae.r,P+=M=ae.g,T+=q=ae.b,k+=D=ae.a,L-=O,I-=M,R-=q,A-=D,ae=ae.next,E+=4;S+=v}for(let se=0;se<v;se++){I=R=A=L=_=y=p=w=0,E=se<<2,m=V*(O=h[E]),P=V*(M=h[E+1]),T=V*(q=h[E+2]),k=V*(D=h[E+3]),w+=j*O,_+=j*M,y+=j*q,p+=j*D,X=z;for(let be=0;be<V;be++)X.r=O,X.g=M,X.b=q,X.a=D,X=X.next;let fe=v;for(let be=1;be<=c;be++)E=fe+se<<2,w+=(X.r=O=h[E])*(te=V-be),_+=(X.g=M=h[E+1])*te,y+=(X.b=q=h[E+2])*te,p+=(X.a=D=h[E+3])*te,L+=O,I+=M,R+=q,A+=D,X=X.next,be<$&&(fe+=v);E=se,Q=z,ae=J;for(let be=0;be<g;be++)f=E<<2,h[f+3]=D=p*F>>Y,D>0?(D=255/D,h[f]=(w*F>>Y)*D,h[f+1]=(_*F>>Y)*D,h[f+2]=(y*F>>Y)*D):h[f]=h[f+1]=h[f+2]=0,w-=m,_-=P,y-=T,p-=k,m-=Q.r,P-=Q.g,T-=Q.b,k-=Q.a,f=se+((f=be+V)<$?f:$)*v<<2,w+=L+=Q.r=h[f],_+=I+=Q.g=h[f+1],y+=R+=Q.b=h[f+2],p+=A+=Q.a=h[f+3],Q=Q.next,m+=O=ae.r,P+=M=ae.g,T+=q=ae.b,k+=D=ae.a,L-=O,I-=M,R-=q,A-=D,ae=ae.next,E+=v}}const s=function(c){const h=Math.round(this.blurRadius());h>0&&o(c,h)};return bd.Blur=s,e.Factory.addGetterSetter(r.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),bd}var wd={},P5;function nx(){if(P5)return wd;P5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.Brighten=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=this.brightness()*255,o=a.data,s=o.length;for(let u=0;u<s;u+=4)o[u]+=i,o[u+1]+=i,o[u+2]+=i};return wd.Brighten=n,e.Factory.addGetterSetter(r.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),wd}var _d={},O5;function ix(){if(O5)return _d;O5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Contrast=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=Math.pow((this.contrast()+100)/100,2),o=a.data,s=o.length;let u=150,c=150,h=150;for(let v=0;v<s;v+=4)u=o[v],c=o[v+1],h=o[v+2],u/=255,u-=.5,u*=i,u+=.5,u*=255,c/=255,c-=.5,c*=i,c+=.5,c*=255,h/=255,h-=.5,h*=i,h+=.5,h*=255,u=u<0?0:u>255?255:u,c=c<0?0:c>255?255:c,h=h<0?0:h>255?255:h,o[v]=u,o[v+1]=c,o[v+2]=h};return _d.Contrast=n,e.Factory.addGetterSetter(r.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),_d}var Sd={},A5;function ax(){if(A5)return Sd;A5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Emboss=void 0;const e=Gr(),r=Ji(),t=Li(),n=Yr(),a=function(i){const o=this.embossStrength()*10,s=this.embossWhiteLevel()*255,u=this.embossDirection(),c=this.embossBlend(),h=i.data,v=i.width,g=i.height,f=v*4;let E=0,S=0,w=g;switch(u){case"top-left":E=-1,S=-1;break;case"top":E=-1,S=0;break;case"top-right":E=-1,S=1;break;case"right":E=0,S=1;break;case"bottom-right":E=1,S=1;break;case"bottom":E=1,S=0;break;case"bottom-left":E=1,S=-1;break;case"left":E=0,S=-1;break;default:t.Util.error("Unknown emboss direction: "+u)}do{const _=(w-1)*f;let y=E;w+y<1&&(y=0),w+y>g&&(y=0);const p=(w-1+y)*v*4;let m=v;do{const P=_+(m-1)*4;let T=S;m+T<1&&(T=0),m+T>v&&(T=0);const k=p+(m-1+T)*4,L=h[P]-h[k],I=h[P+1]-h[k+1],R=h[P+2]-h[k+2];let A=L;const O=A>0?A:-A,M=I>0?I:-I,q=R>0?R:-R;if(M>O&&(A=I),q>O&&(A=R),A*=o,c){const D=h[P]+A,te=h[P+1]+A,H=h[P+2]+A;h[P]=D>255?255:D<0?0:D,h[P+1]=te>255?255:te<0?0:te,h[P+2]=H>255?255:H<0?0:H}else{let D=s-A;D<0?D=0:D>255&&(D=255),h[P]=h[P+1]=h[P+2]=D}}while(--m)}while(--w)};return Sd.Emboss=a,e.Factory.addGetterSetter(r.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Sd}var xd={},C5;function ox(){if(C5)return xd;C5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Enhance=void 0;const e=Gr(),r=Ji(),t=Yr();function n(i,o,s,u,c){const h=s-o,v=c-u;if(h===0)return u+v/2;if(v===0)return u;let g=(i-o)/h;return g=v*g+u,g}const a=function(i){const o=i.data,s=o.length;let u=o[0],c=u,h,v=o[1],g=v,f,E=o[2],S=E,w;const _=this.enhance();if(_===0)return;for(let L=0;L<s;L+=4)h=o[L+0],h<u?u=h:h>c&&(c=h),f=o[L+1],f<v?v=f:f>g&&(g=f),w=o[L+2],w<E?E=w:w>S&&(S=w);c===u&&(c=255,u=0),g===v&&(g=255,v=0),S===E&&(S=255,E=0);let y,p,m,P,T,k;if(_>0)y=c+_*(255-c),p=u-_*(u-0),m=g+_*(255-g),P=v-_*(v-0),T=S+_*(255-S),k=E-_*(E-0);else{const L=(c+u)*.5;y=c+_*(c-L),p=u+_*(u-L);const I=(g+v)*.5;m=g+_*(g-I),P=v+_*(v-I);const R=(S+E)*.5;T=S+_*(S-R),k=E+_*(E-R)}for(let L=0;L<s;L+=4)o[L+0]=n(o[L+0],u,c,p,y),o[L+1]=n(o[L+1],v,g,P,m),o[L+2]=n(o[L+2],E,S,k,T)};return xd.Enhance=a,e.Factory.addGetterSetter(r.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),xd}var Ed={},k5;function sx(){if(k5)return Ed;k5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.Grayscale=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=i,t[a+1]=i,t[a+2]=i}};return Ed.Grayscale=e,Ed}var Pd={},L5;function lx(){if(L5)return Pd;L5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.HSL=void 0;const e=Gr(),r=Ji(),t=Yr();e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(a){const i=a.data,o=i.length,s=1,u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=this.luminance()*127,v=s*u*Math.cos(c*Math.PI/180),g=s*u*Math.sin(c*Math.PI/180),f=.299*s+.701*v+.167*g,E=.587*s-.587*v+.33*g,S=.114*s-.114*v-.497*g,w=.299*s-.299*v-.328*g,_=.587*s+.413*v+.035*g,y=.114*s-.114*v+.293*g,p=.299*s-.3*v+1.25*g,m=.587*s-.586*v-1.05*g,P=.114*s+.886*v-.2*g;let T,k,L,I;for(let R=0;R<o;R+=4)T=i[R+0],k=i[R+1],L=i[R+2],I=i[R+3],i[R+0]=f*T+E*k+S*L+h,i[R+1]=w*T+_*k+y*L+h,i[R+2]=p*T+m*k+P*L+h,i[R+3]=I};return Pd.HSL=n,Pd}var Od={},N5;function ux(){if(N5)return Od;N5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.HSV=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=s*u*Math.cos(c*Math.PI/180),v=s*u*Math.sin(c*Math.PI/180),g=.299*s+.701*h+.167*v,f=.587*s-.587*h+.33*v,E=.114*s-.114*h-.497*v,S=.299*s-.299*h-.328*v,w=.587*s+.413*h+.035*v,_=.114*s-.114*h+.293*v,y=.299*s-.3*h+1.25*v,p=.587*s-.586*h-1.05*v,m=.114*s+.886*h-.2*v;for(let P=0;P<o;P+=4){const T=i[P+0],k=i[P+1],L=i[P+2],I=i[P+3];i[P+0]=g*T+f*k+E*L,i[P+1]=S*T+w*k+_*L,i[P+2]=y*T+p*k+m*L,i[P+3]=I}};return Od.HSV=n,e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Od}var Ad={},T5;function cx(){if(T5)return Ad;T5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Invert=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Ad.Invert=e,Ad}var Cd={},R5;function fx(){if(R5)return Cd;R5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.Kaleidoscope=void 0;const e=Gr(),r=Ji(),t=Li(),n=Yr(),a=function(s,u,c){const h=s.data,v=u.data,g=s.width,f=s.height,E=c.polarCenterX||g/2,S=c.polarCenterY||f/2;let w=Math.sqrt(E*E+S*S),_=g-E,y=f-S;const p=Math.sqrt(_*_+y*y);w=p>w?p:w;const m=f,P=g,T=360/P*Math.PI/180;for(let k=0;k<P;k+=1){const L=Math.sin(k*T),I=Math.cos(k*T);for(let R=0;R<m;R+=1){_=Math.floor(E+w*R/m*I),y=Math.floor(S+w*R/m*L);let A=(y*g+_)*4;const O=h[A+0],M=h[A+1],q=h[A+2],D=h[A+3];A=(k+R*g)*4,v[A+0]=O,v[A+1]=M,v[A+2]=q,v[A+3]=D}}},i=function(s,u,c){const h=s.data,v=u.data,g=s.width,f=s.height,E=c.polarCenterX||g/2,S=c.polarCenterY||f/2;let w=Math.sqrt(E*E+S*S),_=g-E,y=f-S;const p=Math.sqrt(_*_+y*y);w=p>w?p:w;const m=f,P=g,T=0;let k,L;for(_=0;_<g;_+=1)for(y=0;y<f;y+=1){const I=_-E,R=y-S,A=Math.sqrt(I*I+R*R)*m/w;let O=(Math.atan2(R,I)*180/Math.PI+360+T)%360;O=O*P/360,k=Math.floor(O),L=Math.floor(A);let M=(L*g+k)*4;const q=h[M+0],D=h[M+1],te=h[M+2],H=h[M+3];M=(y*g+_)*4,v[M+0]=q,v[M+1]=D,v[M+2]=te,v[M+3]=H}},o=function(s){const u=s.width,c=s.height;let h,v,g,f,E,S,w,_,y,p,m=Math.round(this.kaleidoscopePower());const P=Math.round(this.kaleidoscopeAngle()),T=Math.floor(u*(P%360)/360);if(m<1)return;const k=t.Util.createCanvasElement();k.width=u,k.height=c;const L=k.getContext("2d").getImageData(0,0,u,c);t.Util.releaseCanvas(k),a(s,L,{polarCenterX:u/2,polarCenterY:c/2});let I=u/Math.pow(2,m);for(;I<=8;)I=I*2,m-=1;I=Math.ceil(I);let R=I,A=0,O=R,M=1;for(T+I>u&&(A=R,O=0,M=-1),v=0;v<c;v+=1)for(h=A;h!==O;h+=M)g=Math.round(h+T)%u,y=(u*v+g)*4,E=L.data[y+0],S=L.data[y+1],w=L.data[y+2],_=L.data[y+3],p=(u*v+h)*4,L.data[p+0]=E,L.data[p+1]=S,L.data[p+2]=w,L.data[p+3]=_;for(v=0;v<c;v+=1)for(R=Math.floor(I),f=0;f<m;f+=1){for(h=0;h<R+1;h+=1)y=(u*v+h)*4,E=L.data[y+0],S=L.data[y+1],w=L.data[y+2],_=L.data[y+3],p=(u*v+R*2-h-1)*4,L.data[p+0]=E,L.data[p+1]=S,L.data[p+2]=w,L.data[p+3]=_;R*=2}i(L,s,{})};return Cd.Kaleidoscope=o,e.Factory.addGetterSetter(r.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Cd}var kd={},M5;function hx(){if(M5)return kd;M5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.Mask=void 0;const e=Gr(),r=Ji(),t=Yr();function n(g,f,E){let S=(E*g.width+f)*4;const w=[];return w.push(g.data[S++],g.data[S++],g.data[S++],g.data[S++]),w}function a(g,f){return Math.sqrt(Math.pow(g[0]-f[0],2)+Math.pow(g[1]-f[1],2)+Math.pow(g[2]-f[2],2))}function i(g){const f=[0,0,0];for(let E=0;E<g.length;E++)f[0]+=g[E][0],f[1]+=g[E][1],f[2]+=g[E][2];return f[0]/=g.length,f[1]/=g.length,f[2]/=g.length,f}function o(g,f){const E=n(g,0,0),S=n(g,g.width-1,0),w=n(g,0,g.height-1),_=n(g,g.width-1,g.height-1),y=f||10;if(a(E,S)<y&&a(S,_)<y&&a(_,w)<y&&a(w,E)<y){const p=i([S,E,_,w]),m=[];for(let P=0;P<g.width*g.height;P++){const T=a(p,[g.data[P*4],g.data[P*4+1],g.data[P*4+2]]);m[P]=T<y?0:255}return m}}function s(g,f){for(let E=0;E<g.width*g.height;E++)g.data[4*E+3]=f[E]}function u(g,f,E){const S=[1,1,1,1,0,1,1,1,1],w=Math.round(Math.sqrt(S.length)),_=Math.floor(w/2),y=[];for(let p=0;p<E;p++)for(let m=0;m<f;m++){const P=p*f+m;let T=0;for(let k=0;k<w;k++)for(let L=0;L<w;L++){const I=p+k-_,R=m+L-_;if(I>=0&&I<E&&R>=0&&R<f){const A=I*f+R,O=S[k*w+L];T+=g[A]*O}}y[P]=T===255*8?255:0}return y}function c(g,f,E){const S=[1,1,1,1,1,1,1,1,1],w=Math.round(Math.sqrt(S.length)),_=Math.floor(w/2),y=[];for(let p=0;p<E;p++)for(let m=0;m<f;m++){const P=p*f+m;let T=0;for(let k=0;k<w;k++)for(let L=0;L<w;L++){const I=p+k-_,R=m+L-_;if(I>=0&&I<E&&R>=0&&R<f){const A=I*f+R,O=S[k*w+L];T+=g[A]*O}}y[P]=T>=255*4?255:0}return y}function h(g,f,E){const S=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],w=Math.round(Math.sqrt(S.length)),_=Math.floor(w/2),y=[];for(let p=0;p<E;p++)for(let m=0;m<f;m++){const P=p*f+m;let T=0;for(let k=0;k<w;k++)for(let L=0;L<w;L++){const I=p+k-_,R=m+L-_;if(I>=0&&I<E&&R>=0&&R<f){const A=I*f+R,O=S[k*w+L];T+=g[A]*O}}y[P]=T}return y}const v=function(g){const f=this.threshold();let E=o(g,f);return E&&(E=u(E,g.width,g.height),E=c(E,g.width,g.height),E=h(E,g.width,g.height),s(g,E)),g};return kd.Mask=v,e.Factory.addGetterSetter(r.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),kd}var Ld={},I5;function dx(){if(I5)return Ld;I5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Noise=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=this.noise()*255,o=a.data,s=o.length,u=i/2;for(let c=0;c<s;c+=4)o[c+0]+=u-2*u*Math.random(),o[c+1]+=u-2*u*Math.random(),o[c+2]+=u-2*u*Math.random()};return Ld.Noise=n,e.Factory.addGetterSetter(r.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var Nd={},j5;function px(){if(j5)return Nd;j5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Pixelate=void 0;const e=Gr(),r=Li(),t=Ji(),n=Yr(),a=function(i){let o=Math.ceil(this.pixelSize()),s=i.width,u=i.height,c=Math.ceil(s/o),h=Math.ceil(u/o),v=i.data;if(o<=0){r.Util.error("pixelSize value can not be <= 0");return}for(let g=0;g<c;g+=1)for(let f=0;f<h;f+=1){let E=0,S=0,w=0,_=0;const y=g*o,p=y+o,m=f*o,P=m+o;let T=0;for(let k=y;k<p;k+=1)if(!(k>=s))for(let L=m;L<P;L+=1){if(L>=u)continue;const I=(s*L+k)*4;E+=v[I+0],S+=v[I+1],w+=v[I+2],_+=v[I+3],T+=1}E=E/T,S=S/T,w=w/T,_=_/T;for(let k=y;k<p;k+=1)if(!(k>=s))for(let L=m;L<P;L+=1){if(L>=u)continue;const I=(s*L+k)*4;v[I+0]=E,v[I+1]=S,v[I+2]=w,v[I+3]=_}}};return Nd.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Nd}var Td={},F5;function gx(){if(F5)return Td;F5=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.Posterize=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=Math.round(this.levels()*254)+1,o=a.data,s=o.length,u=255/i;for(let c=0;c<s;c+=1)o[c]=Math.floor(o[c]/u)*u};return Td.Posterize=n,e.Factory.addGetterSetter(r.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Td}var Rd={},D5;function vx(){if(D5)return Rd;D5=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.RGB=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=this.red(),u=this.green(),c=this.blue();for(let h=0;h<o;h+=4){const v=(.34*i[h]+.5*i[h+1]+.16*i[h+2])/255;i[h]=v*s,i[h+1]=v*u,i[h+2]=v*c,i[h+3]=i[h+3]}};return Rd.RGB=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),Rd}var Md={},B5;function mx(){if(B5)return Md;B5=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.RGBA=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=this.red(),u=this.green(),c=this.blue(),h=this.alpha();for(let v=0;v<o;v+=4){const g=1-h;i[v]=s*h+i[v]*g,i[v+1]=u*h+i[v+1]*g,i[v+2]=c*h+i[v+2]*g}};return Md.RGBA=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),Md}var Id={},q5;function yx(){if(q5)return Id;q5=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.Sepia=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=t[a+0],o=t[a+1],s=t[a+2];t[a+0]=Math.min(255,i*.393+o*.769+s*.189),t[a+1]=Math.min(255,i*.349+o*.686+s*.168),t[a+2]=Math.min(255,i*.272+o*.534+s*.131)}};return Id.Sepia=e,Id}var jd={},z5;function bx(){if(z5)return jd;z5=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.Solarize=void 0;const e=function(r){const t=r.data,n=r.width,a=r.height,i=n*4;let o=a;do{const s=(o-1)*i;let u=n;do{const c=s+(u-1)*4;let h=t[c],v=t[c+1],g=t[c+2];h>127&&(h=255-h),v>127&&(v=255-v),g>127&&(g=255-g),t[c]=h,t[c+1]=v,t[c+2]=g}while(--u)}while(--o)};return jd.Solarize=e,jd}var Fd={},U5;function wx(){if(U5)return Fd;U5=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.Threshold=void 0;const e=Gr(),r=Ji(),t=Yr(),n=function(a){const i=this.threshold()*255,o=a.data,s=o.length;for(let u=0;u<s;u+=1)o[u]=o[u]<i?0:255};return Fd.Threshold=n,e.Factory.addGetterSetter(r.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Fd}var H5;function _x(){if(H5)return Zh;H5=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.Konva=void 0;const e=E2(),r=US(),t=VS(),n=GS(),a=WS(),i=$S(),o=YS(),s=k6(),u=fm(),c=L6(),h=XS(),v=KS(),g=ZS(),f=QS(),E=N6(),S=JS(),w=ex(),_=tx(),y=rx(),p=nx(),m=ix(),P=ax(),T=ox(),k=sx(),L=lx(),I=ux(),R=cx(),A=fx(),O=hx(),M=dx(),q=px(),D=gx(),te=vx(),H=mx(),B=yx(),$=bx(),V=wx();return Zh.Konva=e.Konva.Util._assign(e.Konva,{Arc:r.Arc,Arrow:t.Arrow,Circle:n.Circle,Ellipse:a.Ellipse,Image:i.Image,Label:o.Label,Tag:o.Tag,Line:s.Line,Path:u.Path,Rect:c.Rect,RegularPolygon:h.RegularPolygon,Ring:v.Ring,Sprite:g.Sprite,Star:f.Star,Text:E.Text,TextPath:S.TextPath,Transformer:w.Transformer,Wedge:_.Wedge,Filters:{Blur:y.Blur,Brighten:p.Brighten,Contrast:m.Contrast,Emboss:P.Emboss,Enhance:T.Enhance,Grayscale:k.Grayscale,HSL:L.HSL,HSV:I.HSV,Invert:R.Invert,Kaleidoscope:A.Kaleidoscope,Mask:O.Mask,Noise:M.Noise,Pixelate:q.Pixelate,Posterize:D.Posterize,RGB:te.RGB,RGBA:H.RGBA,Sepia:B.Sepia,Solarize:$.Solarize,Threshold:V.Threshold}}),Zh}var Sx=m1.exports,V5;function Hs(){if(V5)return m1.exports;V5=1,Object.defineProperty(Sx,"__esModule",{value:!0});const e=_x();return m1.exports=e.Konva,m1.exports}Hs();var s1={exports:{}},G5;function xx(){return G5||(G5=1,function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Konva=void 0;var t=E2();Object.defineProperty(r,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=E2();e.exports=n.Konva}(s1,s1.exports)),s1.exports}var Ex=xx();const dp=yp(Ex);var og={exports:{}};/**
|
|
44
|
+
* @license React
|
|
45
|
+
* react-reconciler.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var sg,W5;function Px(){return W5||(W5=1,sg=function(r){var t={},n=ai(),a=q2(),i=Object.assign;function o(b){for(var x="https://reactjs.org/docs/error-decoder.html?invariant="+b,U=1;U<arguments.length;U++)x+="&args[]="+encodeURIComponent(arguments[U]);return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),c=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),E=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),P=Symbol.iterator;function T(b){return b===null||typeof b!="object"?null:(b=P&&b[P]||b["@@iterator"],typeof b=="function"?b:null)}function k(b){if(b==null)return null;if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case h:return"Fragment";case c:return"Portal";case g:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case _:return"SuspenseList"}if(typeof b=="object")switch(b.$$typeof){case E:return(b.displayName||"Context")+".Consumer";case f:return(b._context.displayName||"Context")+".Provider";case S:var x=b.render;return b=b.displayName,b||(b=x.displayName||x.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case y:return x=b.displayName||null,x!==null?x:k(b.type)||"Memo";case p:x=b._payload,b=b._init;try{return k(b(x))}catch{}}return null}function L(b){var x=b.type;switch(b.tag){case 24:return"Cache";case 9:return(x.displayName||"Context")+".Consumer";case 10:return(x._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return b=x.render,b=b.displayName||b.name||"",x.displayName||(b!==""?"ForwardRef("+b+")":"ForwardRef");case 7:return"Fragment";case 5:return x;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return k(x);case 8:return x===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 x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x}return null}function I(b){var x=b,U=b;if(b.alternate)for(;x.return;)x=x.return;else{b=x;do x=b,(x.flags&4098)!==0&&(U=x.return),b=x.return;while(b)}return x.tag===3?U:null}function R(b){if(I(b)!==b)throw Error(o(188))}function A(b){var x=b.alternate;if(!x){if(x=I(b),x===null)throw Error(o(188));return x!==b?null:b}for(var U=b,Z=x;;){var ne=U.return;if(ne===null)break;var le=ne.alternate;if(le===null){if(Z=ne.return,Z!==null){U=Z;continue}break}if(ne.child===le.child){for(le=ne.child;le;){if(le===U)return R(ne),b;if(le===Z)return R(ne),x;le=le.sibling}throw Error(o(188))}if(U.return!==Z.return)U=ne,Z=le;else{for(var xe=!1,$e=ne.child;$e;){if($e===U){xe=!0,U=ne,Z=le;break}if($e===Z){xe=!0,Z=ne,U=le;break}$e=$e.sibling}if(!xe){for($e=le.child;$e;){if($e===U){xe=!0,U=le,Z=ne;break}if($e===Z){xe=!0,Z=le,U=ne;break}$e=$e.sibling}if(!xe)throw Error(o(189))}}if(U.alternate!==Z)throw Error(o(190))}if(U.tag!==3)throw Error(o(188));return U.stateNode.current===U?b:x}function O(b){return b=A(b),b!==null?M(b):null}function M(b){if(b.tag===5||b.tag===6)return b;for(b=b.child;b!==null;){var x=M(b);if(x!==null)return x;b=b.sibling}return null}function q(b){if(b.tag===5||b.tag===6)return b;for(b=b.child;b!==null;){if(b.tag!==4){var x=q(b);if(x!==null)return x}b=b.sibling}return null}var D=Array.isArray,te=r.getPublicInstance,H=r.getRootHostContext,B=r.getChildHostContext,$=r.prepareForCommit,V=r.resetAfterCommit,j=r.createInstance,z=r.appendInitialChild,F=r.finalizeInitialChildren,Y=r.prepareUpdate,J=r.shouldSetTextContent,X=r.createTextInstance,Q=r.scheduleTimeout,ae=r.cancelTimeout,se=r.noTimeout,fe=r.isPrimaryRenderer,be=r.supportsMutation,_e=r.supportsPersistence,Ae=r.supportsHydration,Re=r.getInstanceFromNode,Pe=r.preparePortalMount,ye=r.getCurrentEventPriority,nt=r.detachDeletedInstance,Ce=r.supportsMicrotasks,he=r.scheduleMicrotask,ke=r.supportsTestSelectors,Te=r.findFiberRoot,ve=r.getBoundingRect,Se=r.getTextContent,je=r.isHiddenSubtree,Ue=r.matchAccessibilityRole,ct=r.setFocusIfFocusable,mt=r.setupIntersectionObserver,yt=r.appendChild,Je=r.appendChildToContainer,lt=r.commitTextUpdate,ze=r.commitMount,kt=r.commitUpdate,pt=r.insertBefore,Ut=r.insertInContainerBefore,Ht=r.removeChild,Me=r.removeChildFromContainer,Oe=r.resetTextContent,it=r.hideInstance,Lt=r.hideTextInstance,At=r.unhideInstance,xt=r.unhideTextInstance,Jt=r.clearContainer,nr=r.cloneInstance,Rt=r.createContainerChildSet,Xt=r.appendChildToContainerChildSet,Rr=r.finalizeContainerChildren,Ze=r.replaceContainerChildren,bt=r.cloneHiddenInstance,Vt=r.cloneHiddenTextInstance,wt=r.canHydrateInstance,Kt=r.canHydrateTextInstance,Yt=r.canHydrateSuspenseInstance,ut=r.isSuspenseInstancePending,St=r.isSuspenseInstanceFallback,Et=r.getSuspenseInstanceFallbackErrorDetails,et=r.registerSuspenseInstanceRetry,qt=r.getNextHydratableSibling,gt=r.getFirstHydratableChild,Ft=r.getFirstHydratableChildWithinContainer,br=r.getFirstHydratableChildWithinSuspenseInstance,hr=r.hydrateInstance,Qr=r.hydrateTextInstance,Sn=r.hydrateSuspenseInstance,Ni=r.getNextHydratableInstanceAfterSuspenseInstance,Si=r.commitHydratedContainer,fa=r.commitHydratedSuspenseInstance,_s=r.clearSuspenseBoundary,Go=r.clearSuspenseBoundaryFromContainer,tu=r.shouldDeleteUnhydratedTailInstances,mc=r.didNotMatchHydratedContainerTextInstance,Fn=r.didNotMatchHydratedTextInstance,Bu;function oo(b){if(Bu===void 0)try{throw Error()}catch(U){var x=U.stack.trim().match(/\n( *(at )?)/);Bu=x&&x[1]||""}return`
|
|
52
|
+
`+Bu+b}var dl=!1;function Vs(b,x){if(!b||dl)return"";dl=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(x)if(x=function(){throw Error()},Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(Tt){var Z=Tt}Reflect.construct(b,[],x)}else{try{x.call()}catch(Tt){Z=Tt}b.call(x.prototype)}else{try{throw Error()}catch(Tt){Z=Tt}b()}}catch(Tt){if(Tt&&Z&&typeof Tt.stack=="string"){for(var ne=Tt.stack.split(`
|
|
53
|
+
`),le=Z.stack.split(`
|
|
54
|
+
`),xe=ne.length-1,$e=le.length-1;1<=xe&&0<=$e&&ne[xe]!==le[$e];)$e--;for(;1<=xe&&0<=$e;xe--,$e--)if(ne[xe]!==le[$e]){if(xe!==1||$e!==1)do if(xe--,$e--,0>$e||ne[xe]!==le[$e]){var st=`
|
|
55
|
+
`+ne[xe].replace(" at new "," at ");return b.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",b.displayName)),st}while(1<=xe&&0<=$e);break}}}finally{dl=!1,Error.prepareStackTrace=U}return(b=b?b.displayName||b.name:"")?oo(b):""}var qu=Object.prototype.hasOwnProperty,ru=[],so=-1;function gi(b){return{current:b}}function Jr(b){0>so||(b.current=ru[so],ru[so]=null,so--)}function Nr(b,x){so++,ru[so]=b.current,b.current=x}var cn={},vi=gi(cn),Ti=gi(!1),Ia=cn;function ja(b,x){var U=b.type.contextTypes;if(!U)return cn;var Z=b.stateNode;if(Z&&Z.__reactInternalMemoizedUnmaskedChildContext===x)return Z.__reactInternalMemoizedMaskedChildContext;var ne={},le;for(le in U)ne[le]=x[le];return Z&&(b=b.stateNode,b.__reactInternalMemoizedUnmaskedChildContext=x,b.__reactInternalMemoizedMaskedChildContext=ne),ne}function oi(b){return b=b.childContextTypes,b!=null}function Ri(){Jr(Ti),Jr(vi)}function pl(b,x,U){if(vi.current!==cn)throw Error(o(168));Nr(vi,x),Nr(Ti,U)}function ha(b,x,U){var Z=b.stateNode;if(x=x.childContextTypes,typeof Z.getChildContext!="function")return U;Z=Z.getChildContext();for(var ne in Z)if(!(ne in x))throw Error(o(108,L(b)||"Unknown",ne));return i({},U,Z)}function Wo(b){return b=(b=b.stateNode)&&b.__reactInternalMemoizedMergedChildContext||cn,Ia=vi.current,Nr(vi,b),Nr(Ti,Ti.current),!0}function nu(b,x,U){var Z=b.stateNode;if(!Z)throw Error(o(169));U?(b=ha(b,x,Ia),Z.__reactInternalMemoizedMergedChildContext=b,Jr(Ti),Jr(vi),Nr(vi,b)):Jr(Ti),Nr(Ti,U)}var da=Math.clz32?Math.clz32:iu,Gs=Math.log,af=Math.LN2;function iu(b){return b>>>=0,b===0?32:31-(Gs(b)/af|0)|0}var Fr=64,Ss=4194304;function Ws(b){switch(b&-b){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 b&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return b&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return b}}function $s(b,x){var U=b.pendingLanes;if(U===0)return 0;var Z=0,ne=b.suspendedLanes,le=b.pingedLanes,xe=U&268435455;if(xe!==0){var $e=xe&~ne;$e!==0?Z=Ws($e):(le&=xe,le!==0&&(Z=Ws(le)))}else xe=U&~ne,xe!==0?Z=Ws(xe):le!==0&&(Z=Ws(le));if(Z===0)return 0;if(x!==0&&x!==Z&&(x&ne)===0&&(ne=Z&-Z,le=x&-x,ne>=le||ne===16&&(le&4194240)!==0))return x;if((Z&4)!==0&&(Z|=U&16),x=b.entangledLanes,x!==0)for(b=b.entanglements,x&=Z;0<x;)U=31-da(x),ne=1<<U,Z|=b[U],x&=~ne;return Z}function yc(b,x){switch(b){case 1:case 2:case 4:return x+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 x+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $o(b,x){for(var U=b.suspendedLanes,Z=b.pingedLanes,ne=b.expirationTimes,le=b.pendingLanes;0<le;){var xe=31-da(le),$e=1<<xe,st=ne[xe];st===-1?(($e&U)===0||($e&Z)!==0)&&(ne[xe]=yc($e,x)):st<=x&&(b.expiredLanes|=$e),le&=~$e}}function xs(b){return b=b.pendingLanes&-1073741825,b!==0?b:b&1073741824?1073741824:0}function Es(){var b=Fr;return Fr<<=1,(Fr&4194240)===0&&(Fr=64),b}function Ps(b){for(var x=[],U=0;31>U;U++)x.push(b);return x}function mn(b,x,U){b.pendingLanes|=x,x!==536870912&&(b.suspendedLanes=0,b.pingedLanes=0),b=b.eventTimes,x=31-da(x),b[x]=U}function Yo(b,x){var U=b.pendingLanes&~x;b.pendingLanes=x,b.suspendedLanes=0,b.pingedLanes=0,b.expiredLanes&=x,b.mutableReadLanes&=x,b.entangledLanes&=x,x=b.entanglements;var Z=b.eventTimes;for(b=b.expirationTimes;0<U;){var ne=31-da(U),le=1<<ne;x[ne]=0,Z[ne]=-1,b[ne]=-1,U&=~le}}function Fa(b,x){var U=b.entangledLanes|=x;for(b=b.entanglements;U;){var Z=31-da(U),ne=1<<Z;ne&x|b[Z]&x&&(b[Z]|=x),U&=~ne}}var Dt=0;function Ys(b){return b&=-b,1<b?4<b?(b&268435455)!==0?16:536870912:4:1}var lo=a.unstable_scheduleCallback,Oo=a.unstable_cancelCallback,zu=a.unstable_shouldYield,Xs=a.unstable_requestPaint,Dn=a.unstable_now,Ks=a.unstable_ImmediatePriority,au=a.unstable_UserBlockingPriority,ou=a.unstable_NormalPriority,of=a.unstable_IdlePriority,uo=null,si=null;function Da(b){if(si&&typeof si.onCommitFiberRoot=="function")try{si.onCommitFiberRoot(uo,b,void 0,(b.current.flags&128)===128)}catch{}}function su(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var Mi=typeof Object.is=="function"?Object.is:su,Ba=null,Ao=!1,Os=!1;function gl(b){Ba===null?Ba=[b]:Ba.push(b)}function Uu(b){Ao=!0,gl(b)}function li(){if(!Os&&Ba!==null){Os=!0;var b=0,x=Dt;try{var U=Ba;for(Dt=1;b<U.length;b++){var Z=U[b];do Z=Z(!0);while(Z!==null)}Ba=null,Ao=!1}catch(ne){throw Ba!==null&&(Ba=Ba.slice(b+1)),lo(Ks,li),ne}finally{Dt=x,Os=!1}}return null}var Ii=[],ji=0,vl=null,xa=0,xn=[],Fi=0,En=null,ea=1,ta="";function qa(b,x){Ii[ji++]=xa,Ii[ji++]=vl,vl=b,xa=x}function lu(b,x,U){xn[Fi++]=ea,xn[Fi++]=ta,xn[Fi++]=En,En=b;var Z=ea;b=ta;var ne=32-da(Z)-1;Z&=~(1<<ne),U+=1;var le=32-da(x)+ne;if(30<le){var xe=ne-ne%5;le=(Z&(1<<xe)-1).toString(32),Z>>=xe,ne-=xe,ea=1<<32-da(x)+ne|U<<ne|Z,ta=le+b}else ea=1<<le|U<<ne|Z,ta=b}function As(b){b.return!==null&&(qa(b,1),lu(b,1,0))}function Zs(b){for(;b===vl;)vl=Ii[--ji],Ii[ji]=null,xa=Ii[--ji],Ii[ji]=null;for(;b===En;)En=xn[--Fi],xn[Fi]=null,ta=xn[--Fi],xn[Fi]=null,ea=xn[--Fi],xn[Fi]=null}var Xn=null,mi=null,nn=!1,Qs=!1,za=null;function ml(b,x){var U=Uo(5,null,null,0);U.elementType="DELETED",U.stateNode=x,U.return=b,x=b.deletions,x===null?(b.deletions=[U],b.flags|=16):x.push(U)}function Xo(b,x){switch(b.tag){case 5:return x=wt(x,b.type,b.pendingProps),x!==null?(b.stateNode=x,Xn=b,mi=gt(x),!0):!1;case 6:return x=Kt(x,b.pendingProps),x!==null?(b.stateNode=x,Xn=b,mi=null,!0):!1;case 13:if(x=Yt(x),x!==null){var U=En!==null?{id:ea,overflow:ta}:null;return b.memoizedState={dehydrated:x,treeContext:U,retryLane:1073741824},U=Uo(18,null,null,0),U.stateNode=x,U.return=b,b.child=U,Xn=b,mi=null,!0}return!1;default:return!1}}function yl(b){return(b.mode&1)!==0&&(b.flags&128)===0}function Ko(b){if(nn){var x=mi;if(x){var U=x;if(!Xo(b,x)){if(yl(b))throw Error(o(418));x=qt(U);var Z=Xn;x&&Xo(b,x)?ml(Z,U):(b.flags=b.flags&-4097|2,nn=!1,Xn=b)}}else{if(yl(b))throw Error(o(418));b.flags=b.flags&-4097|2,nn=!1,Xn=b}}}function uu(b){for(b=b.return;b!==null&&b.tag!==5&&b.tag!==3&&b.tag!==13;)b=b.return;Xn=b}function K(b){if(!Ae||b!==Xn)return!1;if(!nn)return uu(b),nn=!0,!1;if(b.tag!==3&&(b.tag!==5||tu(b.type)&&!J(b.type,b.memoizedProps))){var x=mi;if(x){if(yl(b))throw ce(),Error(o(418));for(;x;)ml(b,x),x=qt(x)}}if(uu(b),b.tag===13){if(!Ae)throw Error(o(316));if(b=b.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(o(317));mi=Ni(b)}else mi=Xn?qt(b.stateNode):null;return!0}function ce(){for(var b=mi;b;)b=qt(b)}function Le(){Ae&&(mi=Xn=null,Qs=nn=!1)}function Fe(b){za===null?za=[b]:za.push(b)}var Ke=s.ReactCurrentBatchConfig;function ht(b,x){if(Mi(b,x))return!0;if(typeof b!="object"||b===null||typeof x!="object"||x===null)return!1;var U=Object.keys(b),Z=Object.keys(x);if(U.length!==Z.length)return!1;for(Z=0;Z<U.length;Z++){var ne=U[Z];if(!qu.call(x,ne)||!Mi(b[ne],x[ne]))return!1}return!0}function Pt(b){switch(b.tag){case 5:return oo(b.type);case 16:return oo("Lazy");case 13:return oo("Suspense");case 19:return oo("SuspenseList");case 0:case 2:case 15:return b=Vs(b.type,!1),b;case 11:return b=Vs(b.type.render,!1),b;case 1:return b=Vs(b.type,!0),b;default:return""}}function zt(b,x,U){if(b=U.ref,b!==null&&typeof b!="function"&&typeof b!="object"){if(U._owner){if(U=U._owner,U){if(U.tag!==1)throw Error(o(309));var Z=U.stateNode}if(!Z)throw Error(o(147,b));var ne=Z,le=""+b;return x!==null&&x.ref!==null&&typeof x.ref=="function"&&x.ref._stringRef===le?x.ref:(x=function(xe){var $e=ne.refs;xe===null?delete $e[le]:$e[le]=xe},x._stringRef=le,x)}if(typeof b!="string")throw Error(o(284));if(!U._owner)throw Error(o(290,b))}return b}function sr(b,x){throw b=Object.prototype.toString.call(x),Error(o(31,b==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":b))}function wr(b){var x=b._init;return x(b._payload)}function mr(b){function x(rt,Ye){if(b){var dt=rt.deletions;dt===null?(rt.deletions=[Ye],rt.flags|=16):dt.push(Ye)}}function U(rt,Ye){if(!b)return null;for(;Ye!==null;)x(rt,Ye),Ye=Ye.sibling;return null}function Z(rt,Ye){for(rt=new Map;Ye!==null;)Ye.key!==null?rt.set(Ye.key,Ye):rt.set(Ye.index,Ye),Ye=Ye.sibling;return rt}function ne(rt,Ye){return rt=Eu(rt,Ye),rt.index=0,rt.sibling=null,rt}function le(rt,Ye,dt){return rt.index=dt,b?(dt=rt.alternate,dt!==null?(dt=dt.index,dt<Ye?(rt.flags|=2,Ye):dt):(rt.flags|=2,Ye)):(rt.flags|=1048576,Ye)}function xe(rt){return b&&rt.alternate===null&&(rt.flags|=2),rt}function $e(rt,Ye,dt,$t){return Ye===null||Ye.tag!==6?(Ye=kc(dt,rt.mode,$t),Ye.return=rt,Ye):(Ye=ne(Ye,dt),Ye.return=rt,Ye)}function st(rt,Ye,dt,$t){var dr=dt.type;return dr===h?er(rt,Ye,dt.props.children,$t,dt.key):Ye!==null&&(Ye.elementType===dr||typeof dr=="object"&&dr!==null&&dr.$$typeof===p&&wr(dr)===Ye.type)?($t=ne(Ye,dt.props),$t.ref=zt(rt,Ye,dt),$t.return=rt,$t):($t=$f(dt.type,dt.key,dt.props,null,rt.mode,$t),$t.ref=zt(rt,Ye,dt),$t.return=rt,$t)}function Tt(rt,Ye,dt,$t){return Ye===null||Ye.tag!==4||Ye.stateNode.containerInfo!==dt.containerInfo||Ye.stateNode.implementation!==dt.implementation?(Ye=Yf(dt,rt.mode,$t),Ye.return=rt,Ye):(Ye=ne(Ye,dt.children||[]),Ye.return=rt,Ye)}function er(rt,Ye,dt,$t,dr){return Ye===null||Ye.tag!==7?(Ye=ma(dt,rt.mode,$t,dr),Ye.return=rt,Ye):(Ye=ne(Ye,dt),Ye.return=rt,Ye)}function Er(rt,Ye,dt){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return Ye=kc(""+Ye,rt.mode,dt),Ye.return=rt,Ye;if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case u:return dt=$f(Ye.type,Ye.key,Ye.props,null,rt.mode,dt),dt.ref=zt(rt,null,Ye),dt.return=rt,dt;case c:return Ye=Yf(Ye,rt.mode,dt),Ye.return=rt,Ye;case p:var $t=Ye._init;return Er(rt,$t(Ye._payload),dt)}if(D(Ye)||T(Ye))return Ye=ma(Ye,rt.mode,dt,null),Ye.return=rt,Ye;sr(rt,Ye)}return null}function Wt(rt,Ye,dt,$t){var dr=Ye!==null?Ye.key:null;if(typeof dt=="string"&&dt!==""||typeof dt=="number")return dr!==null?null:$e(rt,Ye,""+dt,$t);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case u:return dt.key===dr?st(rt,Ye,dt,$t):null;case c:return dt.key===dr?Tt(rt,Ye,dt,$t):null;case p:return dr=dt._init,Wt(rt,Ye,dr(dt._payload),$t)}if(D(dt)||T(dt))return dr!==null?null:er(rt,Ye,dt,$t,null);sr(rt,dt)}return null}function In(rt,Ye,dt,$t,dr){if(typeof $t=="string"&&$t!==""||typeof $t=="number")return rt=rt.get(dt)||null,$e(Ye,rt,""+$t,dr);if(typeof $t=="object"&&$t!==null){switch($t.$$typeof){case u:return rt=rt.get($t.key===null?dt:$t.key)||null,st(Ye,rt,$t,dr);case c:return rt=rt.get($t.key===null?dt:$t.key)||null,Tt(Ye,rt,$t,dr);case p:var Tr=$t._init;return In(rt,Ye,dt,Tr($t._payload),dr)}if(D($t)||T($t))return rt=rt.get(dt)||null,er(Ye,rt,$t,dr,null);sr(Ye,$t)}return null}function bn(rt,Ye,dt,$t){for(var dr=null,Tr=null,Pr=Ye,Wr=Ye=0,$i=null;Pr!==null&&Wr<dt.length;Wr++){Pr.index>Wr?($i=Pr,Pr=null):$i=Pr.sibling;var Vr=Wt(rt,Pr,dt[Wr],$t);if(Vr===null){Pr===null&&(Pr=$i);break}b&&Pr&&Vr.alternate===null&&x(rt,Pr),Ye=le(Vr,Ye,Wr),Tr===null?dr=Vr:Tr.sibling=Vr,Tr=Vr,Pr=$i}if(Wr===dt.length)return U(rt,Pr),nn&&qa(rt,Wr),dr;if(Pr===null){for(;Wr<dt.length;Wr++)Pr=Er(rt,dt[Wr],$t),Pr!==null&&(Ye=le(Pr,Ye,Wr),Tr===null?dr=Pr:Tr.sibling=Pr,Tr=Pr);return nn&&qa(rt,Wr),dr}for(Pr=Z(rt,Pr);Wr<dt.length;Wr++)$i=In(Pr,rt,Wr,dt[Wr],$t),$i!==null&&(b&&$i.alternate!==null&&Pr.delete($i.key===null?Wr:$i.key),Ye=le($i,Ye,Wr),Tr===null?dr=$i:Tr.sibling=$i,Tr=$i);return b&&Pr.forEach(function(ka){return x(rt,ka)}),nn&&qa(rt,Wr),dr}function to(rt,Ye,dt,$t){var dr=T(dt);if(typeof dr!="function")throw Error(o(150));if(dt=dr.call(dt),dt==null)throw Error(o(151));for(var Tr=dr=null,Pr=Ye,Wr=Ye=0,$i=null,Vr=dt.next();Pr!==null&&!Vr.done;Wr++,Vr=dt.next()){Pr.index>Wr?($i=Pr,Pr=null):$i=Pr.sibling;var ka=Wt(rt,Pr,Vr.value,$t);if(ka===null){Pr===null&&(Pr=$i);break}b&&Pr&&ka.alternate===null&&x(rt,Pr),Ye=le(ka,Ye,Wr),Tr===null?dr=ka:Tr.sibling=ka,Tr=ka,Pr=$i}if(Vr.done)return U(rt,Pr),nn&&qa(rt,Wr),dr;if(Pr===null){for(;!Vr.done;Wr++,Vr=dt.next())Vr=Er(rt,Vr.value,$t),Vr!==null&&(Ye=le(Vr,Ye,Wr),Tr===null?dr=Vr:Tr.sibling=Vr,Tr=Vr);return nn&&qa(rt,Wr),dr}for(Pr=Z(rt,Pr);!Vr.done;Wr++,Vr=dt.next())Vr=In(Pr,rt,Wr,Vr.value,$t),Vr!==null&&(b&&Vr.alternate!==null&&Pr.delete(Vr.key===null?Wr:Vr.key),Ye=le(Vr,Ye,Wr),Tr===null?dr=Vr:Tr.sibling=Vr,Tr=Vr);return b&&Pr.forEach(function(v0){return x(rt,v0)}),nn&&qa(rt,Wr),dr}function sl(rt,Ye,dt,$t){if(typeof dt=="object"&&dt!==null&&dt.type===h&&dt.key===null&&(dt=dt.props.children),typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case u:e:{for(var dr=dt.key,Tr=Ye;Tr!==null;){if(Tr.key===dr){if(dr=dt.type,dr===h){if(Tr.tag===7){U(rt,Tr.sibling),Ye=ne(Tr,dt.props.children),Ye.return=rt,rt=Ye;break e}}else if(Tr.elementType===dr||typeof dr=="object"&&dr!==null&&dr.$$typeof===p&&wr(dr)===Tr.type){U(rt,Tr.sibling),Ye=ne(Tr,dt.props),Ye.ref=zt(rt,Tr,dt),Ye.return=rt,rt=Ye;break e}U(rt,Tr);break}else x(rt,Tr);Tr=Tr.sibling}dt.type===h?(Ye=ma(dt.props.children,rt.mode,$t,dt.key),Ye.return=rt,rt=Ye):($t=$f(dt.type,dt.key,dt.props,null,rt.mode,$t),$t.ref=zt(rt,Ye,dt),$t.return=rt,rt=$t)}return xe(rt);case c:e:{for(Tr=dt.key;Ye!==null;){if(Ye.key===Tr)if(Ye.tag===4&&Ye.stateNode.containerInfo===dt.containerInfo&&Ye.stateNode.implementation===dt.implementation){U(rt,Ye.sibling),Ye=ne(Ye,dt.children||[]),Ye.return=rt,rt=Ye;break e}else{U(rt,Ye);break}else x(rt,Ye);Ye=Ye.sibling}Ye=Yf(dt,rt.mode,$t),Ye.return=rt,rt=Ye}return xe(rt);case p:return Tr=dt._init,sl(rt,Ye,Tr(dt._payload),$t)}if(D(dt))return bn(rt,Ye,dt,$t);if(T(dt))return to(rt,Ye,dt,$t);sr(rt,dt)}return typeof dt=="string"&&dt!==""||typeof dt=="number"?(dt=""+dt,Ye!==null&&Ye.tag===6?(U(rt,Ye.sibling),Ye=ne(Ye,dt),Ye.return=rt,rt=Ye):(U(rt,Ye),Ye=kc(dt,rt.mode,$t),Ye.return=rt,rt=Ye),xe(rt)):U(rt,Ye)}return sl}var Or=mr(!0),Nn=mr(!1),Pn=gi(null),Bn=null,ei=null,ui=null;function Ua(){ui=ei=Bn=null}function Ea(b,x,U){fe?(Nr(Pn,x._currentValue),x._currentValue=U):(Nr(Pn,x._currentValue2),x._currentValue2=U)}function Pa(b){var x=Pn.current;Jr(Pn),fe?b._currentValue=x:b._currentValue2=x}function Zo(b,x,U){for(;b!==null;){var Z=b.alternate;if((b.childLanes&x)!==x?(b.childLanes|=x,Z!==null&&(Z.childLanes|=x)):Z!==null&&(Z.childLanes&x)!==x&&(Z.childLanes|=x),b===U)break;b=b.return}}function Qo(b,x){Bn=b,ui=ei=null,b=b.dependencies,b!==null&&b.firstContext!==null&&((b.lanes&x)!==0&&(fi=!0),b.firstContext=null)}function Di(b){var x=fe?b._currentValue:b._currentValue2;if(ui!==b)if(b={context:b,memoizedValue:x,next:null},ei===null){if(Bn===null)throw Error(o(308));ei=b,Bn.dependencies={lanes:0,firstContext:b}}else ei=ei.next=b;return x}var Ha=null;function Js(b){Ha===null?Ha=[b]:Ha.push(b)}function bl(b,x,U,Z){var ne=x.interleaved;return ne===null?(U.next=U,Js(x)):(U.next=ne.next,ne.next=U),x.interleaved=U,ra(b,Z)}function ra(b,x){b.lanes|=x;var U=b.alternate;for(U!==null&&(U.lanes|=x),U=b,b=b.return;b!==null;)b.childLanes|=x,U=b.alternate,U!==null&&(U.childLanes|=x),U=b,b=b.return;return U.tag===3?U.stateNode:null}var an=!1;function el(b){b.updateQueue={baseState:b.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wl(b,x){b=b.updateQueue,x.updateQueue===b&&(x.updateQueue={baseState:b.baseState,firstBaseUpdate:b.firstBaseUpdate,lastBaseUpdate:b.lastBaseUpdate,shared:b.shared,effects:b.effects})}function Oa(b,x){return{eventTime:b,lane:x,tag:0,payload:null,callback:null,next:null}}function Va(b,x,U){var Z=b.updateQueue;if(Z===null)return null;if(Z=Z.shared,(_r&2)!==0){var ne=Z.pending;return ne===null?x.next=x:(x.next=ne.next,ne.next=x),Z.pending=x,ra(b,U)}return ne=Z.interleaved,ne===null?(x.next=x,Js(Z)):(x.next=ne.next,ne.next=x),Z.interleaved=x,ra(b,U)}function xi(b,x,U){if(x=x.updateQueue,x!==null&&(x=x.shared,(U&4194240)!==0)){var Z=x.lanes;Z&=b.pendingLanes,U|=Z,x.lanes=U,Fa(b,U)}}function tl(b,x){var U=b.updateQueue,Z=b.alternate;if(Z!==null&&(Z=Z.updateQueue,U===Z)){var ne=null,le=null;if(U=U.firstBaseUpdate,U!==null){do{var xe={eventTime:U.eventTime,lane:U.lane,tag:U.tag,payload:U.payload,callback:U.callback,next:null};le===null?ne=le=xe:le=le.next=xe,U=U.next}while(U!==null);le===null?ne=le=x:le=le.next=x}else ne=le=x;U={baseState:Z.baseState,firstBaseUpdate:ne,lastBaseUpdate:le,shared:Z.shared,effects:Z.effects},b.updateQueue=U;return}b=U.lastBaseUpdate,b===null?U.firstBaseUpdate=x:b.next=x,U.lastBaseUpdate=x}function co(b,x,U,Z){var ne=b.updateQueue;an=!1;var le=ne.firstBaseUpdate,xe=ne.lastBaseUpdate,$e=ne.shared.pending;if($e!==null){ne.shared.pending=null;var st=$e,Tt=st.next;st.next=null,xe===null?le=Tt:xe.next=Tt,xe=st;var er=b.alternate;er!==null&&(er=er.updateQueue,$e=er.lastBaseUpdate,$e!==xe&&($e===null?er.firstBaseUpdate=Tt:$e.next=Tt,er.lastBaseUpdate=st))}if(le!==null){var Er=ne.baseState;xe=0,er=Tt=st=null,$e=le;do{var Wt=$e.lane,In=$e.eventTime;if((Z&Wt)===Wt){er!==null&&(er=er.next={eventTime:In,lane:0,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null});e:{var bn=b,to=$e;switch(Wt=x,In=U,to.tag){case 1:if(bn=to.payload,typeof bn=="function"){Er=bn.call(In,Er,Wt);break e}Er=bn;break e;case 3:bn.flags=bn.flags&-65537|128;case 0:if(bn=to.payload,Wt=typeof bn=="function"?bn.call(In,Er,Wt):bn,Wt==null)break e;Er=i({},Er,Wt);break e;case 2:an=!0}}$e.callback!==null&&$e.lane!==0&&(b.flags|=64,Wt=ne.effects,Wt===null?ne.effects=[$e]:Wt.push($e))}else In={eventTime:In,lane:Wt,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null},er===null?(Tt=er=In,st=Er):er=er.next=In,xe|=Wt;if($e=$e.next,$e===null){if($e=ne.shared.pending,$e===null)break;Wt=$e,$e=Wt.next,Wt.next=null,ne.lastBaseUpdate=Wt,ne.shared.pending=null}}while(!0);if(er===null&&(st=Er),ne.baseState=st,ne.firstBaseUpdate=Tt,ne.lastBaseUpdate=er,x=ne.shared.interleaved,x!==null){ne=x;do xe|=ne.lane,ne=ne.next;while(ne!==x)}else le===null&&(ne.shared.lanes=0);Ts|=xe,b.lanes=xe,b.memoizedState=Er}}function Hu(b,x,U){if(b=x.effects,x.effects=null,b!==null)for(x=0;x<b.length;x++){var Z=b[x],ne=Z.callback;if(ne!==null){if(Z.callback=null,Z=U,typeof ne!="function")throw Error(o(191,ne));ne.call(Z)}}}var yi={},Bi=gi(yi),Cs=gi(yi),Co=gi(yi);function bi(b){if(b===yi)throw Error(o(174));return b}function Jo(b,x){Nr(Co,x),Nr(Cs,b),Nr(Bi,yi),b=H(x),Jr(Bi),Nr(Bi,b)}function ci(){Jr(Bi),Jr(Cs),Jr(Co)}function qi(b){var x=bi(Co.current),U=bi(Bi.current);x=B(U,b.type,x),U!==x&&(Nr(Cs,b),Nr(Bi,x))}function es(b){Cs.current===b&&(Jr(Bi),Jr(Cs))}var Xr=gi(0);function fo(b){for(var x=b;x!==null;){if(x.tag===13){var U=x.memoizedState;if(U!==null&&(U=U.dehydrated,U===null||ut(U)||St(U)))return x}else if(x.tag===19&&x.memoizedProps.revealOrder!==void 0){if((x.flags&128)!==0)return x}else if(x.child!==null){x.child.return=x,x=x.child;continue}if(x===b)break;for(;x.sibling===null;){if(x.return===null||x.return===b)return null;x=x.return}x.sibling.return=x.return,x=x.sibling}return null}var rl=[];function ko(){for(var b=0;b<rl.length;b++){var x=rl[b];fe?x._workInProgressVersionPrimary=null:x._workInProgressVersionSecondary=null}rl.length=0}var Dr=s.ReactCurrentDispatcher,Lo=s.ReactCurrentBatchConfig,Kn=0,Mr=null,On=null,Zn=null,ts=!1,No=!1,To=0,Ga=0;function Tn(){throw Error(o(321))}function ho(b,x){if(x===null)return!1;for(var U=0;U<x.length&&U<b.length;U++)if(!Mi(b[U],x[U]))return!1;return!0}function Ro(b,x,U,Z,ne,le){if(Kn=le,Mr=x,x.memoizedState=null,x.updateQueue=null,x.lanes=0,Dr.current=b===null||b.memoizedState===null?Wu:Ol,b=U(Z,ne),No){le=0;do{if(No=!1,To=0,25<=le)throw Error(o(301));le+=1,Zn=On=null,x.updateQueue=null,Dr.current=uf,b=U(Z,ne)}while(No)}if(Dr.current=Ls,x=On!==null&&On.next!==null,Kn=0,Zn=On=Mr=null,ts=!1,x)throw Error(o(300));return b}function Mo(){var b=To!==0;return To=0,b}function zi(){var b={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zn===null?Mr.memoizedState=Zn=b:Zn=Zn.next=b,Zn}function fn(){if(On===null){var b=Mr.alternate;b=b!==null?b.memoizedState:null}else b=On.next;var x=Zn===null?Mr.memoizedState:Zn.next;if(x!==null)Zn=x,On=b;else{if(b===null)throw Error(o(310));On=b,b={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},Zn===null?Mr.memoizedState=Zn=b:Zn=Zn.next=b}return Zn}function Ei(b,x){return typeof x=="function"?x(b):x}function on(b){var x=fn(),U=x.queue;if(U===null)throw Error(o(311));U.lastRenderedReducer=b;var Z=On,ne=Z.baseQueue,le=U.pending;if(le!==null){if(ne!==null){var xe=ne.next;ne.next=le.next,le.next=xe}Z.baseQueue=ne=le,U.pending=null}if(ne!==null){le=ne.next,Z=Z.baseState;var $e=xe=null,st=null,Tt=le;do{var er=Tt.lane;if((Kn&er)===er)st!==null&&(st=st.next={lane:0,action:Tt.action,hasEagerState:Tt.hasEagerState,eagerState:Tt.eagerState,next:null}),Z=Tt.hasEagerState?Tt.eagerState:b(Z,Tt.action);else{var Er={lane:er,action:Tt.action,hasEagerState:Tt.hasEagerState,eagerState:Tt.eagerState,next:null};st===null?($e=st=Er,xe=Z):st=st.next=Er,Mr.lanes|=er,Ts|=er}Tt=Tt.next}while(Tt!==null&&Tt!==le);st===null?xe=Z:st.next=$e,Mi(Z,x.memoizedState)||(fi=!0),x.memoizedState=Z,x.baseState=xe,x.baseQueue=st,U.lastRenderedState=Z}if(b=U.interleaved,b!==null){ne=b;do le=ne.lane,Mr.lanes|=le,Ts|=le,ne=ne.next;while(ne!==b)}else ne===null&&(U.lanes=0);return[x.memoizedState,U.dispatch]}function Kr(b){var x=fn(),U=x.queue;if(U===null)throw Error(o(311));U.lastRenderedReducer=b;var Z=U.dispatch,ne=U.pending,le=x.memoizedState;if(ne!==null){U.pending=null;var xe=ne=ne.next;do le=b(le,xe.action),xe=xe.next;while(xe!==ne);Mi(le,x.memoizedState)||(fi=!0),x.memoizedState=le,x.baseQueue===null&&(x.baseState=le),U.lastRenderedState=le}return[le,Z]}function qn(){}function ti(b,x){var U=Mr,Z=fn(),ne=x(),le=!Mi(Z.memoizedState,ne);if(le&&(Z.memoizedState=ne,fi=!0),Z=Z.queue,El(nl.bind(null,U,Z,b),[b]),Z.getSnapshot!==x||le||Zn!==null&&Zn.memoizedState.tag&1){if(U.flags|=2048,wi(9,_l.bind(null,U,Z,ne,x),void 0,null),rn===null)throw Error(o(349));(Kn&30)!==0||Io(U,x,ne)}return ne}function Io(b,x,U){b.flags|=16384,b={getSnapshot:x,value:U},x=Mr.updateQueue,x===null?(x={lastEffect:null,stores:null},Mr.updateQueue=x,x.stores=[b]):(U=x.stores,U===null?x.stores=[b]:U.push(b))}function _l(b,x,U,Z){x.value=U,x.getSnapshot=Z,cu(x)&&jo(b)}function nl(b,x,U){return U(function(){cu(x)&&jo(b)})}function cu(b){var x=b.getSnapshot;b=b.value;try{var U=x();return!Mi(b,U)}catch{return!0}}function jo(b){var x=ra(b,1);x!==null&&la(x,b,1,-1)}function Sl(b){var x=zi();return typeof b=="function"&&(b=b()),x.memoizedState=x.baseState=b,b={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:b},x.queue=b,b=b.dispatch=qh.bind(null,Mr,b),[x.memoizedState,b]}function wi(b,x,U,Z){return b={tag:b,create:x,destroy:U,deps:Z,next:null},x=Mr.updateQueue,x===null?(x={lastEffect:null,stores:null},Mr.updateQueue=x,x.lastEffect=b.next=b):(U=x.lastEffect,U===null?x.lastEffect=b.next=b:(Z=U.next,U.next=b,b.next=Z,x.lastEffect=b)),b}function Wa(){return fn().memoizedState}function xl(b,x,U,Z){var ne=zi();Mr.flags|=b,ne.memoizedState=wi(1|x,U,void 0,Z===void 0?null:Z)}function Fo(b,x,U,Z){var ne=fn();Z=Z===void 0?null:Z;var le=void 0;if(On!==null){var xe=On.memoizedState;if(le=xe.destroy,Z!==null&&ho(Z,xe.deps)){ne.memoizedState=wi(x,U,le,Z);return}}Mr.flags|=b,ne.memoizedState=wi(1|x,U,le,Z)}function sf(b,x){return xl(8390656,8,b,x)}function El(b,x){return Fo(2048,8,b,x)}function fu(b,x){return Fo(4,2,b,x)}function hn(b,x){return Fo(4,4,b,x)}function Vu(b,x){if(typeof x=="function")return b=b(),x(b),function(){x(null)};if(x!=null)return b=b(),x.current=b,function(){x.current=null}}function Pl(b,x,U){return U=U!=null?U.concat([b]):null,Fo(4,4,Vu.bind(null,x,b),U)}function ks(){}function hu(b,x){var U=fn();x=x===void 0?null:x;var Z=U.memoizedState;return Z!==null&&x!==null&&ho(x,Z[1])?Z[0]:(U.memoizedState=[b,x],b)}function du(b,x){var U=fn();x=x===void 0?null:x;var Z=U.memoizedState;return Z!==null&&x!==null&&ho(x,Z[1])?Z[0]:(b=b(),U.memoizedState=[b,x],b)}function pu(b,x,U){return(Kn&21)===0?(b.baseState&&(b.baseState=!1,fi=!0),b.memoizedState=U):(Mi(U,x)||(U=Es(),Mr.lanes|=U,Ts|=U,b.baseState=!0),x)}function bc(b,x){var U=Dt;Dt=U!==0&&4>U?U:4,b(!0);var Z=Lo.transition;Lo.transition={};try{b(!1),x()}finally{Dt=U,Lo.transition=Z}}function il(){return fn().memoizedState}function Bf(b,x,U){var Z=pi(b);if(U={lane:Z,action:U,hasEagerState:!1,eagerState:null,next:null},qf(b))lf(x,U);else if(U=bl(b,x,U,Z),U!==null){var ne=_n();la(U,b,Z,ne),Gu(U,x,Z)}}function qh(b,x,U){var Z=pi(b),ne={lane:Z,action:U,hasEagerState:!1,eagerState:null,next:null};if(qf(b))lf(x,ne);else{var le=b.alternate;if(b.lanes===0&&(le===null||le.lanes===0)&&(le=x.lastRenderedReducer,le!==null))try{var xe=x.lastRenderedState,$e=le(xe,U);if(ne.hasEagerState=!0,ne.eagerState=$e,Mi($e,xe)){var st=x.interleaved;st===null?(ne.next=ne,Js(x)):(ne.next=st.next,st.next=ne),x.interleaved=ne;return}}catch{}finally{}U=bl(b,x,ne,Z),U!==null&&(ne=_n(),la(U,b,Z,ne),Gu(U,x,Z))}}function qf(b){var x=b.alternate;return b===Mr||x!==null&&x===Mr}function lf(b,x){No=ts=!0;var U=b.pending;U===null?x.next=x:(x.next=U.next,U.next=x),b.pending=x}function Gu(b,x,U){if((U&4194240)!==0){var Z=x.lanes;Z&=b.pendingLanes,U|=Z,x.lanes=U,Fa(b,U)}}var Ls={readContext:Di,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useInsertionEffect:Tn,useLayoutEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useMutableSource:Tn,useSyncExternalStore:Tn,useId:Tn,unstable_isNewReconciler:!1},Wu={readContext:Di,useCallback:function(b,x){return zi().memoizedState=[b,x===void 0?null:x],b},useContext:Di,useEffect:sf,useImperativeHandle:function(b,x,U){return U=U!=null?U.concat([b]):null,xl(4194308,4,Vu.bind(null,x,b),U)},useLayoutEffect:function(b,x){return xl(4194308,4,b,x)},useInsertionEffect:function(b,x){return xl(4,2,b,x)},useMemo:function(b,x){var U=zi();return x=x===void 0?null:x,b=b(),U.memoizedState=[b,x],b},useReducer:function(b,x,U){var Z=zi();return x=U!==void 0?U(x):x,Z.memoizedState=Z.baseState=x,b={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:b,lastRenderedState:x},Z.queue=b,b=b.dispatch=Bf.bind(null,Mr,b),[Z.memoizedState,b]},useRef:function(b){var x=zi();return b={current:b},x.memoizedState=b},useState:Sl,useDebugValue:ks,useDeferredValue:function(b){return zi().memoizedState=b},useTransition:function(){var b=Sl(!1),x=b[0];return b=bc.bind(null,b[1]),zi().memoizedState=b,[x,b]},useMutableSource:function(){},useSyncExternalStore:function(b,x,U){var Z=Mr,ne=zi();if(nn){if(U===void 0)throw Error(o(407));U=U()}else{if(U=x(),rn===null)throw Error(o(349));(Kn&30)!==0||Io(Z,x,U)}ne.memoizedState=U;var le={value:U,getSnapshot:x};return ne.queue=le,sf(nl.bind(null,Z,le,b),[b]),Z.flags|=2048,wi(9,_l.bind(null,Z,le,U,x),void 0,null),U},useId:function(){var b=zi(),x=rn.identifierPrefix;if(nn){var U=ta,Z=ea;U=(Z&~(1<<32-da(Z)-1)).toString(32)+U,x=":"+x+"R"+U,U=To++,0<U&&(x+="H"+U.toString(32)),x+=":"}else U=Ga++,x=":"+x+"r"+U.toString(32)+":";return b.memoizedState=x},unstable_isNewReconciler:!1},Ol={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:hn,useMemo:du,useReducer:on,useRef:Wa,useState:function(){return on(Ei)},useDebugValue:ks,useDeferredValue:function(b){var x=fn();return pu(x,On.memoizedState,b)},useTransition:function(){var b=on(Ei)[0],x=fn().memoizedState;return[b,x]},useMutableSource:qn,useSyncExternalStore:ti,useId:il,unstable_isNewReconciler:!1},uf={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:hn,useMemo:du,useReducer:Kr,useRef:Wa,useState:function(){return Kr(Ei)},useDebugValue:ks,useDeferredValue:function(b){var x=fn();return On===null?x.memoizedState=b:pu(x,On.memoizedState,b)},useTransition:function(){var b=Kr(Ei)[0],x=fn().memoizedState;return[b,x]},useMutableSource:qn,useSyncExternalStore:ti,useId:il,unstable_isNewReconciler:!1};function $a(b,x){if(b&&b.defaultProps){x=i({},x),b=b.defaultProps;for(var U in b)x[U]===void 0&&(x[U]=b[U]);return x}return x}function wc(b,x,U,Z){x=b.memoizedState,U=U(Z,x),U=U==null?x:i({},x,U),b.memoizedState=U,b.lanes===0&&(b.updateQueue.baseState=U)}var $u={isMounted:function(b){return(b=b._reactInternals)?I(b)===b:!1},enqueueSetState:function(b,x,U){b=b._reactInternals;var Z=_n(),ne=pi(b),le=Oa(Z,ne);le.payload=x,U!=null&&(le.callback=U),x=Va(b,le,ne),x!==null&&(la(x,b,ne,Z),xi(x,b,ne))},enqueueReplaceState:function(b,x,U){b=b._reactInternals;var Z=_n(),ne=pi(b),le=Oa(Z,ne);le.tag=1,le.payload=x,U!=null&&(le.callback=U),x=Va(b,le,ne),x!==null&&(la(x,b,ne,Z),xi(x,b,ne))},enqueueForceUpdate:function(b,x){b=b._reactInternals;var U=_n(),Z=pi(b),ne=Oa(U,Z);ne.tag=2,x!=null&&(ne.callback=x),x=Va(b,ne,Z),x!==null&&(la(x,b,Z,U),xi(x,b,Z))}};function zf(b,x,U,Z,ne,le,xe){return b=b.stateNode,typeof b.shouldComponentUpdate=="function"?b.shouldComponentUpdate(Z,le,xe):x.prototype&&x.prototype.isPureReactComponent?!ht(U,Z)||!ht(ne,le):!0}function Uf(b,x,U){var Z=!1,ne=cn,le=x.contextType;return typeof le=="object"&&le!==null?le=Di(le):(ne=oi(x)?Ia:vi.current,Z=x.contextTypes,le=(Z=Z!=null)?ja(b,ne):cn),x=new x(U,le),b.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=$u,b.stateNode=x,x._reactInternals=b,Z&&(b=b.stateNode,b.__reactInternalMemoizedUnmaskedChildContext=ne,b.__reactInternalMemoizedMaskedChildContext=le),x}function _c(b,x,U,Z){b=x.state,typeof x.componentWillReceiveProps=="function"&&x.componentWillReceiveProps(U,Z),typeof x.UNSAFE_componentWillReceiveProps=="function"&&x.UNSAFE_componentWillReceiveProps(U,Z),x.state!==b&&$u.enqueueReplaceState(x,x.state,null)}function Ui(b,x,U,Z){var ne=b.stateNode;ne.props=U,ne.state=b.memoizedState,ne.refs={},el(b);var le=x.contextType;typeof le=="object"&&le!==null?ne.context=Di(le):(le=oi(x)?Ia:vi.current,ne.context=ja(b,le)),ne.state=b.memoizedState,le=x.getDerivedStateFromProps,typeof le=="function"&&(wc(b,x,le,U),ne.state=b.memoizedState),typeof x.getDerivedStateFromProps=="function"||typeof ne.getSnapshotBeforeUpdate=="function"||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(x=ne.state,typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount(),x!==ne.state&&$u.enqueueReplaceState(ne,ne.state,null),co(b,U,ne,Z),ne.state=b.memoizedState),typeof ne.componentDidMount=="function"&&(b.flags|=4194308)}function Hi(b,x){try{var U="",Z=x;do U+=Pt(Z),Z=Z.return;while(Z);var ne=U}catch(le){ne=`
|
|
56
|
+
Error generating stack: `+le.message+`
|
|
57
|
+
`+le.stack}return{value:b,source:x,stack:ne,digest:null}}function na(b,x,U){return{value:b,source:null,stack:U??null,digest:x??null}}function po(b,x){try{console.error(x.value)}catch(U){setTimeout(function(){throw U})}}var gu=typeof WeakMap=="function"?WeakMap:Map;function Vi(b,x,U){U=Oa(-1,U),U.tag=3,U.payload={element:null};var Z=x.value;return U.callback=function(){Vn||(Vn=!0,Gn=Z),po(b,x)},U}function pa(b,x,U){U=Oa(-1,U),U.tag=3;var Z=b.type.getDerivedStateFromError;if(typeof Z=="function"){var ne=x.value;U.payload=function(){return Z(ne)},U.callback=function(){po(b,x)}}var le=b.stateNode;return le!==null&&typeof le.componentDidCatch=="function"&&(U.callback=function(){po(b,x),typeof Z!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var xe=x.stack;this.componentDidCatch(x.value,{componentStack:xe!==null?xe:""})}),U}function Hf(b,x,U){var Z=b.pingCache;if(Z===null){Z=b.pingCache=new gu;var ne=new Set;Z.set(x,ne)}else ne=Z.get(x),ne===void 0&&(ne=new Set,Z.set(x,ne));ne.has(U)||(ne.add(U),b=Np.bind(null,b,x,U),x.then(b,b))}function Vf(b){do{var x;if((x=b.tag===13)&&(x=b.memoizedState,x=x!==null?x.dehydrated!==null:!0),x)return b;b=b.return}while(b!==null);return null}function Ns(b,x,U,Z,ne){return(b.mode&1)===0?(b===x?b.flags|=65536:(b.flags|=128,U.flags|=131072,U.flags&=-52805,U.tag===1&&(U.alternate===null?U.tag=17:(x=Oa(-1,1),x.tag=2,Va(U,x,1))),U.lanes|=1),b):(b.flags|=65536,b.lanes=ne,b)}var vu=s.ReactCurrentOwner,fi=!1;function _i(b,x,U,Z){x.child=b===null?Nn(x,null,U,Z):Or(x,b.child,U,Z)}function Sc(b,x,U,Z,ne){U=U.render;var le=x.ref;return Qo(x,ne),Z=Ro(b,x,U,Z,le,ne),U=Mo(),b!==null&&!fi?(x.updateQueue=b.updateQueue,x.flags&=-2053,b.lanes&=~ne,re(b,x,ne)):(nn&&U&&As(x),x.flags|=1,_i(b,x,Z,ne),x.child)}function rs(b,x,U,Z,ne){if(b===null){var le=U.type;return typeof le=="function"&&!Ac(le)&&le.defaultProps===void 0&&U.compare===null&&U.defaultProps===void 0?(x.tag=15,x.type=le,go(b,x,le,Z,ne)):(b=$f(U.type,null,Z,x,x.mode,ne),b.ref=x.ref,b.return=x,x.child=b)}if(le=b.child,(b.lanes&ne)===0){var xe=le.memoizedProps;if(U=U.compare,U=U!==null?U:ht,U(xe,Z)&&b.ref===x.ref)return re(b,x,ne)}return x.flags|=1,b=Eu(le,Z),b.ref=x.ref,b.return=x,x.child=b}function go(b,x,U,Z,ne){if(b!==null){var le=b.memoizedProps;if(ht(le,Z)&&b.ref===x.ref)if(fi=!1,x.pendingProps=Z=le,(b.lanes&ne)!==0)(b.flags&131072)!==0&&(fi=!0);else return x.lanes=b.lanes,re(b,x,ne)}return ns(b,x,U,Z,ne)}function en(b,x,U){var Z=x.pendingProps,ne=Z.children,le=b!==null?b.memoizedState:null;if(Z.mode==="hidden")if((x.mode&1)===0)x.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nr(qo,ri),ri|=U;else{if((U&1073741824)===0)return b=le!==null?le.baseLanes|U:U,x.lanes=x.childLanes=1073741824,x.memoizedState={baseLanes:b,cachePool:null,transitions:null},x.updateQueue=null,Nr(qo,ri),ri|=b,null;x.memoizedState={baseLanes:0,cachePool:null,transitions:null},Z=le!==null?le.baseLanes:U,Nr(qo,ri),ri|=Z}else le!==null?(Z=le.baseLanes|U,x.memoizedState=null):Z=U,Nr(qo,ri),ri|=Z;return _i(b,x,ne,U),x.child}function sn(b,x){var U=x.ref;(b===null&&U!==null||b!==null&&b.ref!==U)&&(x.flags|=512,x.flags|=2097152)}function ns(b,x,U,Z,ne){var le=oi(U)?Ia:vi.current;return le=ja(x,le),Qo(x,ne),U=Ro(b,x,U,Z,le,ne),Z=Mo(),b!==null&&!fi?(x.updateQueue=b.updateQueue,x.flags&=-2053,b.lanes&=~ne,re(b,x,ne)):(nn&&Z&&As(x),x.flags|=1,_i(b,x,U,ne),x.child)}function Pi(b,x,U,Z,ne){if(oi(U)){var le=!0;Wo(x)}else le=!1;if(Qo(x,ne),x.stateNode===null)W(b,x),Uf(x,U,Z),Ui(x,U,Z,ne),Z=!0;else if(b===null){var xe=x.stateNode,$e=x.memoizedProps;xe.props=$e;var st=xe.context,Tt=U.contextType;typeof Tt=="object"&&Tt!==null?Tt=Di(Tt):(Tt=oi(U)?Ia:vi.current,Tt=ja(x,Tt));var er=U.getDerivedStateFromProps,Er=typeof er=="function"||typeof xe.getSnapshotBeforeUpdate=="function";Er||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||($e!==Z||st!==Tt)&&_c(x,xe,Z,Tt),an=!1;var Wt=x.memoizedState;xe.state=Wt,co(x,Z,xe,ne),st=x.memoizedState,$e!==Z||Wt!==st||Ti.current||an?(typeof er=="function"&&(wc(x,U,er,Z),st=x.memoizedState),($e=an||zf(x,U,$e,Z,Wt,st,Tt))?(Er||typeof xe.UNSAFE_componentWillMount!="function"&&typeof xe.componentWillMount!="function"||(typeof xe.componentWillMount=="function"&&xe.componentWillMount(),typeof xe.UNSAFE_componentWillMount=="function"&&xe.UNSAFE_componentWillMount()),typeof xe.componentDidMount=="function"&&(x.flags|=4194308)):(typeof xe.componentDidMount=="function"&&(x.flags|=4194308),x.memoizedProps=Z,x.memoizedState=st),xe.props=Z,xe.state=st,xe.context=Tt,Z=$e):(typeof xe.componentDidMount=="function"&&(x.flags|=4194308),Z=!1)}else{xe=x.stateNode,wl(b,x),$e=x.memoizedProps,Tt=x.type===x.elementType?$e:$a(x.type,$e),xe.props=Tt,Er=x.pendingProps,Wt=xe.context,st=U.contextType,typeof st=="object"&&st!==null?st=Di(st):(st=oi(U)?Ia:vi.current,st=ja(x,st));var In=U.getDerivedStateFromProps;(er=typeof In=="function"||typeof xe.getSnapshotBeforeUpdate=="function")||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||($e!==Er||Wt!==st)&&_c(x,xe,Z,st),an=!1,Wt=x.memoizedState,xe.state=Wt,co(x,Z,xe,ne);var bn=x.memoizedState;$e!==Er||Wt!==bn||Ti.current||an?(typeof In=="function"&&(wc(x,U,In,Z),bn=x.memoizedState),(Tt=an||zf(x,U,Tt,Z,Wt,bn,st)||!1)?(er||typeof xe.UNSAFE_componentWillUpdate!="function"&&typeof xe.componentWillUpdate!="function"||(typeof xe.componentWillUpdate=="function"&&xe.componentWillUpdate(Z,bn,st),typeof xe.UNSAFE_componentWillUpdate=="function"&&xe.UNSAFE_componentWillUpdate(Z,bn,st)),typeof xe.componentDidUpdate=="function"&&(x.flags|=4),typeof xe.getSnapshotBeforeUpdate=="function"&&(x.flags|=1024)):(typeof xe.componentDidUpdate!="function"||$e===b.memoizedProps&&Wt===b.memoizedState||(x.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||$e===b.memoizedProps&&Wt===b.memoizedState||(x.flags|=1024),x.memoizedProps=Z,x.memoizedState=bn),xe.props=Z,xe.state=bn,xe.context=st,Z=Tt):(typeof xe.componentDidUpdate!="function"||$e===b.memoizedProps&&Wt===b.memoizedState||(x.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||$e===b.memoizedProps&&Wt===b.memoizedState||(x.flags|=1024),Z=!1)}return ia(b,x,U,Z,le,ne)}function ia(b,x,U,Z,ne,le){sn(b,x);var xe=(x.flags&128)!==0;if(!Z&&!xe)return ne&&nu(x,U,!1),re(b,x,le);Z=x.stateNode,vu.current=x;var $e=xe&&typeof U.getDerivedStateFromError!="function"?null:Z.render();return x.flags|=1,b!==null&&xe?(x.child=Or(x,b.child,null,le),x.child=Or(x,null,$e,le)):_i(b,x,$e,le),x.memoizedState=Z.state,ne&&nu(x,U,!0),x.child}function al(b){var x=b.stateNode;x.pendingContext?pl(b,x.pendingContext,x.pendingContext!==x.context):x.context&&pl(b,x.context,!1),Jo(b,x.containerInfo)}function Al(b,x,U,Z,ne){return Le(),Fe(ne),x.flags|=256,_i(b,x,U,Z),x.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function mu(b){return{baseLanes:b,cachePool:null,transitions:null}}function cf(b,x,U){var Z=x.pendingProps,ne=Xr.current,le=!1,xe=(x.flags&128)!==0,$e;if(($e=xe)||($e=b!==null&&b.memoizedState===null?!1:(ne&2)!==0),$e?(le=!0,x.flags&=-129):(b===null||b.memoizedState!==null)&&(ne|=1),Nr(Xr,ne&1),b===null)return Ko(x),b=x.memoizedState,b!==null&&(b=b.dehydrated,b!==null)?((x.mode&1)===0?x.lanes=1:St(b)?x.lanes=8:x.lanes=1073741824,null):(xe=Z.children,b=Z.fallback,le?(Z=x.mode,le=x.child,xe={mode:"hidden",children:xe},(Z&1)===0&&le!==null?(le.childLanes=0,le.pendingProps=xe):le=Cc(xe,Z,0,null),b=ma(b,Z,U,null),le.return=x,b.return=x,le.sibling=b,x.child=le,x.child.memoizedState=mu(U),x.memoizedState=aa,b):Yu(x,xe));if(ne=b.memoizedState,ne!==null&&($e=ne.dehydrated,$e!==null))return Gf(b,x,xe,Z,$e,ne,U);if(le){le=Z.fallback,xe=x.mode,ne=b.child,$e=ne.sibling;var st={mode:"hidden",children:Z.children};return(xe&1)===0&&x.child!==ne?(Z=x.child,Z.childLanes=0,Z.pendingProps=st,x.deletions=null):(Z=Eu(ne,st),Z.subtreeFlags=ne.subtreeFlags&14680064),$e!==null?le=Eu($e,le):(le=ma(le,xe,U,null),le.flags|=2),le.return=x,Z.return=x,Z.sibling=le,x.child=Z,Z=le,le=x.child,xe=b.child.memoizedState,xe=xe===null?mu(U):{baseLanes:xe.baseLanes|U,cachePool:null,transitions:xe.transitions},le.memoizedState=xe,le.childLanes=b.childLanes&~U,x.memoizedState=aa,Z}return le=b.child,b=le.sibling,Z=Eu(le,{mode:"visible",children:Z.children}),(x.mode&1)===0&&(Z.lanes=U),Z.return=x,Z.sibling=null,b!==null&&(U=x.deletions,U===null?(x.deletions=[b],x.flags|=16):U.push(b)),x.child=Z,x.memoizedState=null,Z}function Yu(b,x){return x=Cc({mode:"visible",children:x},b.mode,0,null),x.return=b,b.child=x}function is(b,x,U,Z){return Z!==null&&Fe(Z),Or(x,b.child,null,U),b=Yu(x,x.pendingProps.children),b.flags|=2,x.memoizedState=null,b}function Gf(b,x,U,Z,ne,le,xe){if(U)return x.flags&256?(x.flags&=-257,Z=na(Error(o(422))),is(b,x,xe,Z)):x.memoizedState!==null?(x.child=b.child,x.flags|=128,null):(le=Z.fallback,ne=x.mode,Z=Cc({mode:"visible",children:Z.children},ne,0,null),le=ma(le,ne,xe,null),le.flags|=2,Z.return=x,le.return=x,Z.sibling=le,x.child=Z,(x.mode&1)!==0&&Or(x,b.child,null,xe),x.child.memoizedState=mu(xe),x.memoizedState=aa,le);if((x.mode&1)===0)return is(b,x,xe,null);if(St(ne))return Z=Et(ne).digest,le=Error(o(419)),Z=na(le,Z,void 0),is(b,x,xe,Z);if(U=(xe&b.childLanes)!==0,fi||U){if(Z=rn,Z!==null){switch(xe&-xe){case 4:ne=2;break;case 16:ne=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:ne=32;break;case 536870912:ne=268435456;break;default:ne=0}ne=(ne&(Z.suspendedLanes|xe))!==0?0:ne,ne!==0&&ne!==le.retryLane&&(le.retryLane=ne,ra(b,ne),la(Z,b,ne,-1))}return eo(),Z=na(Error(o(421))),is(b,x,xe,Z)}return ut(ne)?(x.flags|=128,x.child=b.child,x=Rp.bind(null,b),et(ne,x),null):(b=le.treeContext,Ae&&(mi=br(ne),Xn=x,nn=!0,za=null,Qs=!1,b!==null&&(xn[Fi++]=ea,xn[Fi++]=ta,xn[Fi++]=En,ea=b.id,ta=b.overflow,En=x)),x=Yu(x,Z.children),x.flags|=4096,x)}function as(b,x,U){b.lanes|=x;var Z=b.alternate;Z!==null&&(Z.lanes|=x),Zo(b.return,x,U)}function Cl(b,x,U,Z,ne){var le=b.memoizedState;le===null?b.memoizedState={isBackwards:x,rendering:null,renderingStartTime:0,last:Z,tail:U,tailMode:ne}:(le.isBackwards=x,le.rendering=null,le.renderingStartTime=0,le.last=Z,le.tail=U,le.tailMode=ne)}function N(b,x,U){var Z=x.pendingProps,ne=Z.revealOrder,le=Z.tail;if(_i(b,x,Z.children,U),Z=Xr.current,(Z&2)!==0)Z=Z&1|2,x.flags|=128;else{if(b!==null&&(b.flags&128)!==0)e:for(b=x.child;b!==null;){if(b.tag===13)b.memoizedState!==null&&as(b,U,x);else if(b.tag===19)as(b,U,x);else if(b.child!==null){b.child.return=b,b=b.child;continue}if(b===x)break e;for(;b.sibling===null;){if(b.return===null||b.return===x)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}Z&=1}if(Nr(Xr,Z),(x.mode&1)===0)x.memoizedState=null;else switch(ne){case"forwards":for(U=x.child,ne=null;U!==null;)b=U.alternate,b!==null&&fo(b)===null&&(ne=U),U=U.sibling;U=ne,U===null?(ne=x.child,x.child=null):(ne=U.sibling,U.sibling=null),Cl(x,!1,ne,U,le);break;case"backwards":for(U=null,ne=x.child,x.child=null;ne!==null;){if(b=ne.alternate,b!==null&&fo(b)===null){x.child=ne;break}b=ne.sibling,ne.sibling=U,U=ne,ne=b}Cl(x,!0,U,null,le);break;case"together":Cl(x,!1,null,null,void 0);break;default:x.memoizedState=null}return x.child}function W(b,x){(x.mode&1)===0&&b!==null&&(b.alternate=null,x.alternate=null,x.flags|=2)}function re(b,x,U){if(b!==null&&(x.dependencies=b.dependencies),Ts|=x.lanes,(U&x.childLanes)===0)return null;if(b!==null&&x.child!==b.child)throw Error(o(153));if(x.child!==null){for(b=x.child,U=Eu(b,b.pendingProps),x.child=U,U.return=x;b.sibling!==null;)b=b.sibling,U=U.sibling=Eu(b,b.pendingProps),U.return=x;U.sibling=null}return x.child}function oe(b,x,U){switch(x.tag){case 3:al(x),Le();break;case 5:qi(x);break;case 1:oi(x.type)&&Wo(x);break;case 4:Jo(x,x.stateNode.containerInfo);break;case 10:Ea(x,x.type._context,x.memoizedProps.value);break;case 13:var Z=x.memoizedState;if(Z!==null)return Z.dehydrated!==null?(Nr(Xr,Xr.current&1),x.flags|=128,null):(U&x.child.childLanes)!==0?cf(b,x,U):(Nr(Xr,Xr.current&1),b=re(b,x,U),b!==null?b.sibling:null);Nr(Xr,Xr.current&1);break;case 19:if(Z=(U&x.childLanes)!==0,(b.flags&128)!==0){if(Z)return N(b,x,U);x.flags|=128}var ne=x.memoizedState;if(ne!==null&&(ne.rendering=null,ne.tail=null,ne.lastEffect=null),Nr(Xr,Xr.current),Z)break;return null;case 22:case 23:return x.lanes=0,en(b,x,U)}return re(b,x,U)}function ue(b){b.flags|=4}function de(b,x){if(b!==null&&b.child===x.child)return!0;if((x.flags&16)!==0)return!1;for(b=x.child;b!==null;){if((b.flags&12854)!==0||(b.subtreeFlags&12854)!==0)return!1;b=b.sibling}return!0}var ge,me,we,Ee;if(be)ge=function(b,x){for(var U=x.child;U!==null;){if(U.tag===5||U.tag===6)z(b,U.stateNode);else if(U.tag!==4&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===x)break;for(;U.sibling===null;){if(U.return===null||U.return===x)return;U=U.return}U.sibling.return=U.return,U=U.sibling}},me=function(){},we=function(b,x,U,Z,ne){if(b=b.memoizedProps,b!==Z){var le=x.stateNode,xe=bi(Bi.current);U=Y(le,U,b,Z,ne,xe),(x.updateQueue=U)&&ue(x)}},Ee=function(b,x,U,Z){U!==Z&&ue(x)};else if(_e){ge=function(b,x,U,Z){for(var ne=x.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;U&&Z&&(le=bt(le,ne.type,ne.memoizedProps,ne)),z(b,le)}else if(ne.tag===6)le=ne.stateNode,U&&Z&&(le=Vt(le,ne.memoizedProps,ne)),z(b,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),ge(b,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===x)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===x)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};var De=function(b,x,U,Z){for(var ne=x.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;U&&Z&&(le=bt(le,ne.type,ne.memoizedProps,ne)),Xt(b,le)}else if(ne.tag===6)le=ne.stateNode,U&&Z&&(le=Vt(le,ne.memoizedProps,ne)),Xt(b,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),De(b,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===x)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===x)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};me=function(b,x){var U=x.stateNode;if(!de(b,x)){b=U.containerInfo;var Z=Rt(b);De(Z,x,!1,!1),U.pendingChildren=Z,ue(x),Rr(b,Z)}},we=function(b,x,U,Z,ne){var le=b.stateNode,xe=b.memoizedProps;if((b=de(b,x))&&xe===Z)x.stateNode=le;else{var $e=x.stateNode,st=bi(Bi.current),Tt=null;xe!==Z&&(Tt=Y($e,U,xe,Z,ne,st)),b&&Tt===null?x.stateNode=le:(le=nr(le,Tt,U,xe,Z,x,b,$e),F(le,U,Z,ne,st)&&ue(x),x.stateNode=le,b?ue(x):ge(le,x,!1,!1))}},Ee=function(b,x,U,Z){U!==Z?(b=bi(Co.current),U=bi(Bi.current),x.stateNode=X(Z,b,U,x),ue(x)):x.stateNode=b.stateNode}}else me=function(){},we=function(){},Ee=function(){};function Xe(b,x){if(!nn)switch(b.tailMode){case"hidden":x=b.tail;for(var U=null;x!==null;)x.alternate!==null&&(U=x),x=x.sibling;U===null?b.tail=null:U.sibling=null;break;case"collapsed":U=b.tail;for(var Z=null;U!==null;)U.alternate!==null&&(Z=U),U=U.sibling;Z===null?x||b.tail===null?b.tail=null:b.tail.sibling=null:Z.sibling=null}}function We(b){var x=b.alternate!==null&&b.alternate.child===b.child,U=0,Z=0;if(x)for(var ne=b.child;ne!==null;)U|=ne.lanes|ne.childLanes,Z|=ne.subtreeFlags&14680064,Z|=ne.flags&14680064,ne.return=b,ne=ne.sibling;else for(ne=b.child;ne!==null;)U|=ne.lanes|ne.childLanes,Z|=ne.subtreeFlags,Z|=ne.flags,ne.return=b,ne=ne.sibling;return b.subtreeFlags|=Z,b.childLanes=U,x}function Ge(b,x,U){var Z=x.pendingProps;switch(Zs(x),x.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(x),null;case 1:return oi(x.type)&&Ri(),We(x),null;case 3:return U=x.stateNode,ci(),Jr(Ti),Jr(vi),ko(),U.pendingContext&&(U.context=U.pendingContext,U.pendingContext=null),(b===null||b.child===null)&&(K(x)?ue(x):b===null||b.memoizedState.isDehydrated&&(x.flags&256)===0||(x.flags|=1024,za!==null&&(Ku(za),za=null))),me(b,x),We(x),null;case 5:es(x),U=bi(Co.current);var ne=x.type;if(b!==null&&x.stateNode!=null)we(b,x,ne,Z,U),b.ref!==x.ref&&(x.flags|=512,x.flags|=2097152);else{if(!Z){if(x.stateNode===null)throw Error(o(166));return We(x),null}if(b=bi(Bi.current),K(x)){if(!Ae)throw Error(o(175));b=hr(x.stateNode,x.type,x.memoizedProps,U,b,x,!Qs),x.updateQueue=b,b!==null&&ue(x)}else{var le=j(ne,Z,U,b,x);ge(le,x,!1,!1),x.stateNode=le,F(le,ne,Z,U,b)&&ue(x)}x.ref!==null&&(x.flags|=512,x.flags|=2097152)}return We(x),null;case 6:if(b&&x.stateNode!=null)Ee(b,x,b.memoizedProps,Z);else{if(typeof Z!="string"&&x.stateNode===null)throw Error(o(166));if(b=bi(Co.current),U=bi(Bi.current),K(x)){if(!Ae)throw Error(o(176));if(b=x.stateNode,U=x.memoizedProps,(Z=Qr(b,U,x,!Qs))&&(ne=Xn,ne!==null))switch(ne.tag){case 3:mc(ne.stateNode.containerInfo,b,U,(ne.mode&1)!==0);break;case 5:Fn(ne.type,ne.memoizedProps,ne.stateNode,b,U,(ne.mode&1)!==0)}Z&&ue(x)}else x.stateNode=X(Z,b,U,x)}return We(x),null;case 13:if(Jr(Xr),Z=x.memoizedState,b===null||b.memoizedState!==null&&b.memoizedState.dehydrated!==null){if(nn&&mi!==null&&(x.mode&1)!==0&&(x.flags&128)===0)ce(),Le(),x.flags|=98560,ne=!1;else if(ne=K(x),Z!==null&&Z.dehydrated!==null){if(b===null){if(!ne)throw Error(o(318));if(!Ae)throw Error(o(344));if(ne=x.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(o(317));Sn(ne,x)}else Le(),(x.flags&128)===0&&(x.memoizedState=null),x.flags|=4;We(x),ne=!1}else za!==null&&(Ku(za),za=null),ne=!0;if(!ne)return x.flags&65536?x:null}return(x.flags&128)!==0?(x.lanes=U,x):(U=Z!==null,U!==(b!==null&&b.memoizedState!==null)&&U&&(x.child.flags|=8192,(x.mode&1)!==0&&(b===null||(Xr.current&1)!==0?dn===0&&(dn=3):eo())),x.updateQueue!==null&&(x.flags|=4),We(x),null);case 4:return ci(),me(b,x),b===null&&Pe(x.stateNode.containerInfo),We(x),null;case 10:return Pa(x.type._context),We(x),null;case 17:return oi(x.type)&&Ri(),We(x),null;case 19:if(Jr(Xr),ne=x.memoizedState,ne===null)return We(x),null;if(Z=(x.flags&128)!==0,le=ne.rendering,le===null)if(Z)Xe(ne,!1);else{if(dn!==0||b!==null&&(b.flags&128)!==0)for(b=x.child;b!==null;){if(le=fo(b),le!==null){for(x.flags|=128,Xe(ne,!1),b=le.updateQueue,b!==null&&(x.updateQueue=b,x.flags|=4),x.subtreeFlags=0,b=U,U=x.child;U!==null;)Z=U,ne=b,Z.flags&=14680066,le=Z.alternate,le===null?(Z.childLanes=0,Z.lanes=ne,Z.child=null,Z.subtreeFlags=0,Z.memoizedProps=null,Z.memoizedState=null,Z.updateQueue=null,Z.dependencies=null,Z.stateNode=null):(Z.childLanes=le.childLanes,Z.lanes=le.lanes,Z.child=le.child,Z.subtreeFlags=0,Z.deletions=null,Z.memoizedProps=le.memoizedProps,Z.memoizedState=le.memoizedState,Z.updateQueue=le.updateQueue,Z.type=le.type,ne=le.dependencies,Z.dependencies=ne===null?null:{lanes:ne.lanes,firstContext:ne.firstContext}),U=U.sibling;return Nr(Xr,Xr.current&1|2),x.child}b=b.sibling}ne.tail!==null&&Dn()>_u&&(x.flags|=128,Z=!0,Xe(ne,!1),x.lanes=4194304)}else{if(!Z)if(b=fo(le),b!==null){if(x.flags|=128,Z=!0,b=b.updateQueue,b!==null&&(x.updateQueue=b,x.flags|=4),Xe(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!le.alternate&&!nn)return We(x),null}else 2*Dn()-ne.renderingStartTime>_u&&U!==1073741824&&(x.flags|=128,Z=!0,Xe(ne,!1),x.lanes=4194304);ne.isBackwards?(le.sibling=x.child,x.child=le):(b=ne.last,b!==null?b.sibling=le:x.child=le,ne.last=le)}return ne.tail!==null?(x=ne.tail,ne.rendering=x,ne.tail=x.sibling,ne.renderingStartTime=Dn(),x.sibling=null,b=Xr.current,Nr(Xr,Z?b&1|2:b&1),x):(We(x),null);case 22:case 23:return xu(),U=x.memoizedState!==null,b!==null&&b.memoizedState!==null!==U&&(x.flags|=8192),U&&(x.mode&1)!==0?(ri&1073741824)!==0&&(We(x),be&&x.subtreeFlags&6&&(x.flags|=8192)):We(x),null;case 24:return null;case 25:return null}throw Error(o(156,x.tag))}function _t(b,x){switch(Zs(x),x.tag){case 1:return oi(x.type)&&Ri(),b=x.flags,b&65536?(x.flags=b&-65537|128,x):null;case 3:return ci(),Jr(Ti),Jr(vi),ko(),b=x.flags,(b&65536)!==0&&(b&128)===0?(x.flags=b&-65537|128,x):null;case 5:return es(x),null;case 13:if(Jr(Xr),b=x.memoizedState,b!==null&&b.dehydrated!==null){if(x.alternate===null)throw Error(o(340));Le()}return b=x.flags,b&65536?(x.flags=b&-65537|128,x):null;case 19:return Jr(Xr),null;case 4:return ci(),null;case 10:return Pa(x.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var ot=!1,Ie=!1,qe=typeof WeakSet=="function"?WeakSet:Set,He=null;function ft(b,x){var U=b.ref;if(U!==null)if(typeof U=="function")try{U(null)}catch(Z){$n(b,x,Z)}else U.current=null}function vt(b,x,U){try{U()}catch(Z){$n(b,x,Z)}}var Gt=!1;function Bt(b,x){for($(b.containerInfo),He=x;He!==null;)if(b=He,x=b.child,(b.subtreeFlags&1028)!==0&&x!==null)x.return=b,He=x;else for(;He!==null;){b=He;try{var U=b.alternate;if((b.flags&1024)!==0)switch(b.tag){case 0:case 11:case 15:break;case 1:if(U!==null){var Z=U.memoizedProps,ne=U.memoizedState,le=b.stateNode,xe=le.getSnapshotBeforeUpdate(b.elementType===b.type?Z:$a(b.type,Z),ne);le.__reactInternalSnapshotBeforeUpdate=xe}break;case 3:be&&Jt(b.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch($e){$n(b,b.return,$e)}if(x=b.sibling,x!==null){x.return=b.return,He=x;break}He=b.return}return U=Gt,Gt=!1,U}function lr(b,x,U){var Z=x.updateQueue;if(Z=Z!==null?Z.lastEffect:null,Z!==null){var ne=Z=Z.next;do{if((ne.tag&b)===b){var le=ne.destroy;ne.destroy=void 0,le!==void 0&&vt(x,U,le)}ne=ne.next}while(ne!==Z)}}function jt(b,x){if(x=x.updateQueue,x=x!==null?x.lastEffect:null,x!==null){var U=x=x.next;do{if((U.tag&b)===b){var Z=U.create;U.destroy=Z()}U=U.next}while(U!==x)}}function Br(b){var x=b.ref;if(x!==null){var U=b.stateNode;switch(b.tag){case 5:b=te(U);break;default:b=U}typeof x=="function"?x(b):x.current=b}}function Ur(b){var x=b.alternate;x!==null&&(b.alternate=null,Ur(x)),b.child=null,b.deletions=null,b.sibling=null,b.tag===5&&(x=b.stateNode,x!==null&&nt(x)),b.stateNode=null,b.return=null,b.dependencies=null,b.memoizedProps=null,b.memoizedState=null,b.pendingProps=null,b.stateNode=null,b.updateQueue=null}function Ir(b){return b.tag===5||b.tag===3||b.tag===4}function xr(b){e:for(;;){for(;b.sibling===null;){if(b.return===null||Ir(b.return))return null;b=b.return}for(b.sibling.return=b.return,b=b.sibling;b.tag!==5&&b.tag!==6&&b.tag!==18;){if(b.flags&2||b.child===null||b.tag===4)continue e;b.child.return=b,b=b.child}if(!(b.flags&2))return b.stateNode}}function Zr(b,x,U){var Z=b.tag;if(Z===5||Z===6)b=b.stateNode,x?Ut(U,b,x):Je(U,b);else if(Z!==4&&(b=b.child,b!==null))for(Zr(b,x,U),b=b.sibling;b!==null;)Zr(b,x,U),b=b.sibling}function tn(b,x,U){var Z=b.tag;if(Z===5||Z===6)b=b.stateNode,x?pt(U,b,x):yt(U,b);else if(Z!==4&&(b=b.child,b!==null))for(tn(b,x,U),b=b.sibling;b!==null;)tn(b,x,U),b=b.sibling}var tr=null,Hr=!1;function Rn(b,x,U){for(U=U.child;U!==null;)zn(b,x,U),U=U.sibling}function zn(b,x,U){if(si&&typeof si.onCommitFiberUnmount=="function")try{si.onCommitFiberUnmount(uo,U)}catch{}switch(U.tag){case 5:Ie||ft(U,x);case 6:if(be){var Z=tr,ne=Hr;tr=null,Rn(b,x,U),tr=Z,Hr=ne,tr!==null&&(Hr?Me(tr,U.stateNode):Ht(tr,U.stateNode))}else Rn(b,x,U);break;case 18:be&&tr!==null&&(Hr?Go(tr,U.stateNode):_s(tr,U.stateNode));break;case 4:be?(Z=tr,ne=Hr,tr=U.stateNode.containerInfo,Hr=!0,Rn(b,x,U),tr=Z,Hr=ne):(_e&&(Z=U.stateNode.containerInfo,ne=Rt(Z),Ze(Z,ne)),Rn(b,x,U));break;case 0:case 11:case 14:case 15:if(!Ie&&(Z=U.updateQueue,Z!==null&&(Z=Z.lastEffect,Z!==null))){ne=Z=Z.next;do{var le=ne,xe=le.destroy;le=le.tag,xe!==void 0&&((le&2)!==0||(le&4)!==0)&&vt(U,x,xe),ne=ne.next}while(ne!==Z)}Rn(b,x,U);break;case 1:if(!Ie&&(ft(U,x),Z=U.stateNode,typeof Z.componentWillUnmount=="function"))try{Z.props=U.memoizedProps,Z.state=U.memoizedState,Z.componentWillUnmount()}catch($e){$n(U,x,$e)}Rn(b,x,U);break;case 21:Rn(b,x,U);break;case 22:U.mode&1?(Ie=(Z=Ie)||U.memoizedState!==null,Rn(b,x,U),Ie=Z):Rn(b,x,U);break;default:Rn(b,x,U)}}function hi(b){var x=b.updateQueue;if(x!==null){b.updateQueue=null;var U=b.stateNode;U===null&&(U=b.stateNode=new qe),x.forEach(function(Z){var ne=d0.bind(null,b,Z);U.has(Z)||(U.add(Z),Z.then(ne,ne))})}}function Ar(b,x){var U=x.deletions;if(U!==null)for(var Z=0;Z<U.length;Z++){var ne=U[Z];try{var le=b,xe=x;if(be){var $e=xe;e:for(;$e!==null;){switch($e.tag){case 5:tr=$e.stateNode,Hr=!1;break e;case 3:tr=$e.stateNode.containerInfo,Hr=!0;break e;case 4:tr=$e.stateNode.containerInfo,Hr=!0;break e}$e=$e.return}if(tr===null)throw Error(o(160));zn(le,xe,ne),tr=null,Hr=!1}else zn(le,xe,ne);var st=ne.alternate;st!==null&&(st.return=null),ne.return=null}catch(Tt){$n(ne,x,Tt)}}if(x.subtreeFlags&12854)for(x=x.child;x!==null;)Gi(x,b),x=x.sibling}function Gi(b,x){var U=b.alternate,Z=b.flags;switch(b.tag){case 0:case 11:case 14:case 15:if(Ar(x,b),An(b),Z&4){try{lr(3,b,b.return),jt(3,b)}catch(Wt){$n(b,b.return,Wt)}try{lr(5,b,b.return)}catch(Wt){$n(b,b.return,Wt)}}break;case 1:Ar(x,b),An(b),Z&512&&U!==null&&ft(U,U.return);break;case 5:if(Ar(x,b),An(b),Z&512&&U!==null&&ft(U,U.return),be){if(b.flags&32){var ne=b.stateNode;try{Oe(ne)}catch(Wt){$n(b,b.return,Wt)}}if(Z&4&&(ne=b.stateNode,ne!=null)){var le=b.memoizedProps;if(U=U!==null?U.memoizedProps:le,Z=b.type,x=b.updateQueue,b.updateQueue=null,x!==null)try{kt(ne,x,Z,U,le,b)}catch(Wt){$n(b,b.return,Wt)}}}break;case 6:if(Ar(x,b),An(b),Z&4&&be){if(b.stateNode===null)throw Error(o(162));ne=b.stateNode,le=b.memoizedProps,U=U!==null?U.memoizedProps:le;try{lt(ne,U,le)}catch(Wt){$n(b,b.return,Wt)}}break;case 3:if(Ar(x,b),An(b),Z&4){if(be&&Ae&&U!==null&&U.memoizedState.isDehydrated)try{Si(x.containerInfo)}catch(Wt){$n(b,b.return,Wt)}if(_e){ne=x.containerInfo,le=x.pendingChildren;try{Ze(ne,le)}catch(Wt){$n(b,b.return,Wt)}}}break;case 4:if(Ar(x,b),An(b),Z&4&&_e){le=b.stateNode,ne=le.containerInfo,le=le.pendingChildren;try{Ze(ne,le)}catch(Wt){$n(b,b.return,Wt)}}break;case 13:Ar(x,b),An(b),ne=b.child,ne.flags&8192&&(le=ne.memoizedState!==null,ne.stateNode.isHidden=le,!le||ne.alternate!==null&&ne.alternate.memoizedState!==null||(wu=Dn())),Z&4&&hi(b);break;case 22:var xe=U!==null&&U.memoizedState!==null;if(b.mode&1?(Ie=(U=Ie)||xe,Ar(x,b),Ie=U):Ar(x,b),An(b),Z&8192){if(U=b.memoizedState!==null,(b.stateNode.isHidden=U)&&!xe&&(b.mode&1)!==0)for(He=b,Z=b.child;Z!==null;){for(x=He=Z;He!==null;){xe=He;var $e=xe.child;switch(xe.tag){case 0:case 11:case 14:case 15:lr(4,xe,xe.return);break;case 1:ft(xe,xe.return);var st=xe.stateNode;if(typeof st.componentWillUnmount=="function"){var Tt=xe,er=xe.return;try{var Er=Tt;st.props=Er.memoizedProps,st.state=Er.memoizedState,st.componentWillUnmount()}catch(Wt){$n(Tt,er,Wt)}}break;case 5:ft(xe,xe.return);break;case 22:if(xe.memoizedState!==null){ga(x);continue}}$e!==null?($e.return=xe,He=$e):ga(x)}Z=Z.sibling}if(be){e:if(Z=null,be)for(x=b;;){if(x.tag===5){if(Z===null){Z=x;try{ne=x.stateNode,U?it(ne):At(x.stateNode,x.memoizedProps)}catch(Wt){$n(b,b.return,Wt)}}}else if(x.tag===6){if(Z===null)try{le=x.stateNode,U?Lt(le):xt(le,x.memoizedProps)}catch(Wt){$n(b,b.return,Wt)}}else if((x.tag!==22&&x.tag!==23||x.memoizedState===null||x===b)&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===b)break e;for(;x.sibling===null;){if(x.return===null||x.return===b)break e;Z===x&&(Z=null),x=x.return}Z===x&&(Z=null),x.sibling.return=x.return,x=x.sibling}}}break;case 19:Ar(x,b),An(b),Z&4&&hi(b);break;case 21:break;default:Ar(x,b),An(b)}}function An(b){var x=b.flags;if(x&2){try{if(be){e:{for(var U=b.return;U!==null;){if(Ir(U)){var Z=U;break e}U=U.return}throw Error(o(160))}switch(Z.tag){case 5:var ne=Z.stateNode;Z.flags&32&&(Oe(ne),Z.flags&=-33);var le=xr(b);tn(b,le,ne);break;case 3:case 4:var xe=Z.stateNode.containerInfo,$e=xr(b);Zr(b,$e,xe);break;default:throw Error(o(161))}}}catch(st){$n(b,b.return,st)}b.flags&=-3}x&4096&&(b.flags&=-4097)}function Un(b,x,U){He=b,di(b)}function di(b,x,U){for(var Z=(b.mode&1)!==0;He!==null;){var ne=He,le=ne.child;if(ne.tag===22&&Z){var xe=ne.memoizedState!==null||ot;if(!xe){var $e=ne.alternate,st=$e!==null&&$e.memoizedState!==null||Ie;$e=ot;var Tt=Ie;if(ot=xe,(Ie=st)&&!Tt)for(He=ne;He!==null;)xe=He,st=xe.child,xe.tag===22&&xe.memoizedState!==null?Ya(ne):st!==null?(st.return=xe,He=st):Ya(ne);for(;le!==null;)He=le,di(le),le=le.sibling;He=ne,ot=$e,Ie=Tt}Oi(b)}else(ne.subtreeFlags&8772)!==0&&le!==null?(le.return=ne,He=le):Oi(b)}}function Oi(b){for(;He!==null;){var x=He;if((x.flags&8772)!==0){var U=x.alternate;try{if((x.flags&8772)!==0)switch(x.tag){case 0:case 11:case 15:Ie||jt(5,x);break;case 1:var Z=x.stateNode;if(x.flags&4&&!Ie)if(U===null)Z.componentDidMount();else{var ne=x.elementType===x.type?U.memoizedProps:$a(x.type,U.memoizedProps);Z.componentDidUpdate(ne,U.memoizedState,Z.__reactInternalSnapshotBeforeUpdate)}var le=x.updateQueue;le!==null&&Hu(x,le,Z);break;case 3:var xe=x.updateQueue;if(xe!==null){if(U=null,x.child!==null)switch(x.child.tag){case 5:U=te(x.child.stateNode);break;case 1:U=x.child.stateNode}Hu(x,xe,U)}break;case 5:var $e=x.stateNode;U===null&&x.flags&4&&ze($e,x.type,x.memoizedProps,x);break;case 6:break;case 4:break;case 12:break;case 13:if(Ae&&x.memoizedState===null){var st=x.alternate;if(st!==null){var Tt=st.memoizedState;if(Tt!==null){var er=Tt.dehydrated;er!==null&&fa(er)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Ie||x.flags&512&&Br(x)}catch(Er){$n(x,x.return,Er)}}if(x===b){He=null;break}if(U=x.sibling,U!==null){U.return=x.return,He=U;break}He=x.return}}function ga(b){for(;He!==null;){var x=He;if(x===b){He=null;break}var U=x.sibling;if(U!==null){U.return=x.return,He=U;break}He=x.return}}function Ya(b){for(;He!==null;){var x=He;try{switch(x.tag){case 0:case 11:case 15:var U=x.return;try{jt(4,x)}catch(st){$n(x,U,st)}break;case 1:var Z=x.stateNode;if(typeof Z.componentDidMount=="function"){var ne=x.return;try{Z.componentDidMount()}catch(st){$n(x,ne,st)}}var le=x.return;try{Br(x)}catch(st){$n(x,le,st)}break;case 5:var xe=x.return;try{Br(x)}catch(st){$n(x,xe,st)}}}catch(st){$n(x,x.return,st)}if(x===b){He=null;break}var $e=x.sibling;if($e!==null){$e.return=x.return,He=$e;break}He=x.return}}var wn=0,Hn=1,oa=2,Do=3,vo=4;if(typeof Symbol=="function"&&Symbol.for){var qr=Symbol.for;wn=qr("selector.component"),Hn=qr("selector.has_pseudo_class"),oa=qr("selector.role"),Do=qr("selector.test_id"),vo=qr("selector.text")}function mo(b){var x=Re(b);if(x!=null){if(typeof x.memoizedProps["data-testname"]!="string")throw Error(o(364));return x}if(b=Te(b),b===null)throw Error(o(362));return b.stateNode.current}function yu(b,x){switch(x.$$typeof){case wn:if(b.type===x.value)return!0;break;case Hn:e:{x=x.value,b=[b,0];for(var U=0;U<b.length;){var Z=b[U++],ne=b[U++],le=x[ne];if(Z.tag!==5||!je(Z)){for(;le!=null&&yu(Z,le);)ne++,le=x[ne];if(ne===x.length){x=!0;break e}else for(Z=Z.child;Z!==null;)b.push(Z,ne),Z=Z.sibling}}x=!1}return x;case oa:if(b.tag===5&&Ue(b.stateNode,x.value))return!0;break;case vo:if((b.tag===5||b.tag===6)&&(b=Se(b),b!==null&&0<=b.indexOf(x.value)))return!0;break;case Do:if(b.tag===5&&(b=b.memoizedProps["data-testname"],typeof b=="string"&&b.toLowerCase()===x.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Xu(b){switch(b.$$typeof){case wn:return"<"+(k(b.value)||"Unknown")+">";case Hn:return":has("+(Xu(b)||"")+")";case oa:return'[role="'+b.value+'"]';case vo:return'"'+b.value+'"';case Do:return'[data-testname="'+b.value+'"]';default:throw Error(o(365))}}function Xa(b,x){var U=[];b=[b,0];for(var Z=0;Z<b.length;){var ne=b[Z++],le=b[Z++],xe=x[le];if(ne.tag!==5||!je(ne)){for(;xe!=null&&yu(ne,xe);)le++,xe=x[le];if(le===x.length)U.push(ne);else for(ne=ne.child;ne!==null;)b.push(ne,le),ne=ne.sibling}}return U}function Aa(b,x){if(!ke)throw Error(o(363));b=mo(b),b=Xa(b,x),x=[],b=Array.from(b);for(var U=0;U<b.length;){var Z=b[U++];if(Z.tag===5)je(Z)||x.push(Z.stateNode);else for(Z=Z.child;Z!==null;)b.push(Z),Z=Z.sibling}return x}var kl=Math.ceil,va=s.ReactCurrentDispatcher,Bo=s.ReactCurrentOwner,yn=s.ReactCurrentBatchConfig,_r=0,rn=null,Cn=null,Mn=0,ri=0,qo=gi(0),dn=0,bu=null,Ts=0,pn=0,Ka=0,Ll=null,sa=null,wu=0,_u=1/0,Ai=null;function ln(){_u=Dn()+500}var Vn=!1,Gn=null,Za=null,yo=!1,Qa=null,xc=0,Wn=0,Su=null,ol=-1,Ja=0;function _n(){return(_r&6)!==0?Dn():ol!==-1?ol:ol=Dn()}function pi(b){return(b.mode&1)===0?1:(_r&2)!==0&&Mn!==0?Mn&-Mn:Ke.transition!==null?(Ja===0&&(Ja=Es()),Ja):(b=Dt,b!==0?b:ye())}function la(b,x,U,Z){if(50<Wn)throw Wn=0,Su=null,Error(o(185));mn(b,U,Z),((_r&2)===0||b!==rn)&&(b===rn&&((_r&2)===0&&(pn|=U),dn===4&&os(b,Mn)),Wi(b,Z),U===1&&_r===0&&(x.mode&1)===0&&(ln(),Ao&&li()))}function Wi(b,x){var U=b.callbackNode;$o(b,x);var Z=$s(b,b===rn?Mn:0);if(Z===0)U!==null&&Oo(U),b.callbackNode=null,b.callbackPriority=0;else if(x=Z&-Z,b.callbackPriority!==x){if(U!=null&&Oo(U),x===1)b.tag===0?Uu(ff.bind(null,b)):gl(ff.bind(null,b)),Ce?he(function(){(_r&6)===0&&li()}):lo(Ks,li),U=null;else{switch(Ys(Z)){case 1:U=Ks;break;case 4:U=au;break;case 16:U=ou;break;case 536870912:U=of;break;default:U=ou}U=Uh(U,Rs.bind(null,b))}b.callbackPriority=x,b.callbackNode=U}}function Rs(b,x){if(ol=-1,Ja=0,(_r&6)!==0)throw Error(o(327));var U=b.callbackNode;if(Tl()&&b.callbackNode!==U)return null;var Z=$s(b,b===rn?Mn:0);if(Z===0)return null;if((Z&30)!==0||(Z&b.expiredLanes)!==0||x)x=ls(b,Z);else{x=Z;var ne=_r;_r|=2;var le=ss();(rn!==b||Mn!==x)&&(Ai=null,ln(),zo(b,x));do try{Oc();break}catch($e){Ca(b,$e)}while(!0);Ua(),va.current=le,_r=ne,Cn!==null?x=0:(rn=null,Mn=0,x=dn)}if(x!==0){if(x===2&&(ne=xs(b),ne!==0&&(Z=ne,x=Ec(b,ne))),x===1)throw U=bu,zo(b,0),os(b,Z),Wi(b,Dn()),U;if(x===6)os(b,Z);else{if(ne=b.current.alternate,(Z&30)===0&&!Wf(ne)&&(x=ls(b,Z),x===2&&(le=xs(b),le!==0&&(Z=le,x=Ec(b,le))),x===1))throw U=bu,zo(b,0),os(b,Z),Wi(b,Dn()),U;switch(b.finishedWork=ne,b.finishedLanes=Z,x){case 0:case 1:throw Error(o(345));case 2:us(b,sa,Ai);break;case 3:if(os(b,Z),(Z&130023424)===Z&&(x=wu+500-Dn(),10<x)){if($s(b,0)!==0)break;if(ne=b.suspendedLanes,(ne&Z)!==Z){_n(),b.pingedLanes|=b.suspendedLanes≠break}b.timeoutHandle=Q(us.bind(null,b,sa,Ai),x);break}us(b,sa,Ai);break;case 4:if(os(b,Z),(Z&4194240)===Z)break;for(x=b.eventTimes,ne=-1;0<Z;){var xe=31-da(Z);le=1<<xe,xe=x[xe],xe>ne&&(ne=xe),Z&=~le}if(Z=ne,Z=Dn()-Z,Z=(120>Z?120:480>Z?480:1080>Z?1080:1920>Z?1920:3e3>Z?3e3:4320>Z?4320:1960*kl(Z/1960))-Z,10<Z){b.timeoutHandle=Q(us.bind(null,b,sa,Ai),Z);break}us(b,sa,Ai);break;case 5:us(b,sa,Ai);break;default:throw Error(o(329))}}}return Wi(b,Dn()),b.callbackNode===U?Rs.bind(null,b):null}function Ec(b,x){var U=Ll;return b.current.memoizedState.isDehydrated&&(zo(b,x).flags|=256),b=ls(b,x),b!==2&&(x=sa,sa=U,x!==null&&Ku(x)),b}function Ku(b){sa===null?sa=b:sa.push.apply(sa,b)}function Wf(b){for(var x=b;;){if(x.flags&16384){var U=x.updateQueue;if(U!==null&&(U=U.stores,U!==null))for(var Z=0;Z<U.length;Z++){var ne=U[Z],le=ne.getSnapshot;ne=ne.value;try{if(!Mi(le(),ne))return!1}catch{return!1}}}if(U=x.child,x.subtreeFlags&16384&&U!==null)U.return=x,x=U;else{if(x===b)break;for(;x.sibling===null;){if(x.return===null||x.return===b)return!0;x=x.return}x.sibling.return=x.return,x=x.sibling}}return!0}function os(b,x){for(x&=~Ka,x&=~pn,b.suspendedLanes|=x,b.pingedLanes&=~x,b=b.expirationTimes;0<x;){var U=31-da(x),Z=1<<U;b[U]=-1,x&=~Z}}function ff(b){if((_r&6)!==0)throw Error(o(327));Tl();var x=$s(b,0);if((x&1)===0)return Wi(b,Dn()),null;var U=ls(b,x);if(b.tag!==0&&U===2){var Z=xs(b);Z!==0&&(x=Z,U=Ec(b,Z))}if(U===1)throw U=bu,zo(b,0),os(b,x),Wi(b,Dn()),U;if(U===6)throw Error(o(345));return b.finishedWork=b.current.alternate,b.finishedLanes=x,us(b,sa,Ai),Wi(b,Dn()),null}function Nl(b){Qa!==null&&Qa.tag===0&&(_r&6)===0&&Tl();var x=_r;_r|=1;var U=yn.transition,Z=Dt;try{if(yn.transition=null,Dt=1,b)return b()}finally{Dt=Z,yn.transition=U,_r=x,(_r&6)===0&&li()}}function xu(){ri=qo.current,Jr(qo)}function zo(b,x){b.finishedWork=null,b.finishedLanes=0;var U=b.timeoutHandle;if(U!==se&&(b.timeoutHandle=se,ae(U)),Cn!==null)for(U=Cn.return;U!==null;){var Z=U;switch(Zs(Z),Z.tag){case 1:Z=Z.type.childContextTypes,Z!=null&&Ri();break;case 3:ci(),Jr(Ti),Jr(vi),ko();break;case 5:es(Z);break;case 4:ci();break;case 13:Jr(Xr);break;case 19:Jr(Xr);break;case 10:Pa(Z.type._context);break;case 22:case 23:xu()}U=U.return}if(rn=b,Cn=b=Eu(b.current,null),Mn=ri=x,dn=0,bu=null,Ka=pn=Ts=0,sa=Ll=null,Ha!==null){for(x=0;x<Ha.length;x++)if(U=Ha[x],Z=U.interleaved,Z!==null){U.interleaved=null;var ne=Z.next,le=U.pending;if(le!==null){var xe=le.next;le.next=ne,Z.next=xe}U.pending=Z}Ha=null}return b}function Ca(b,x){do{var U=Cn;try{if(Ua(),Dr.current=Ls,ts){for(var Z=Mr.memoizedState;Z!==null;){var ne=Z.queue;ne!==null&&(ne.pending=null),Z=Z.next}ts=!1}if(Kn=0,Zn=On=Mr=null,No=!1,To=0,Bo.current=null,U===null||U.return===null){dn=1,bu=x,Cn=null;break}e:{var le=b,xe=U.return,$e=U,st=x;if(x=Mn,$e.flags|=32768,st!==null&&typeof st=="object"&&typeof st.then=="function"){var Tt=st,er=$e,Er=er.tag;if((er.mode&1)===0&&(Er===0||Er===11||Er===15)){var Wt=er.alternate;Wt?(er.updateQueue=Wt.updateQueue,er.memoizedState=Wt.memoizedState,er.lanes=Wt.lanes):(er.updateQueue=null,er.memoizedState=null)}var In=Vf(xe);if(In!==null){In.flags&=-257,Ns(In,xe,$e,le,x),In.mode&1&&Hf(le,Tt,x),x=In,st=Tt;var bn=x.updateQueue;if(bn===null){var to=new Set;to.add(st),x.updateQueue=to}else bn.add(st);break e}else{if((x&1)===0){Hf(le,Tt,x),eo();break e}st=Error(o(426))}}else if(nn&&$e.mode&1){var sl=Vf(xe);if(sl!==null){(sl.flags&65536)===0&&(sl.flags|=256),Ns(sl,xe,$e,le,x),Fe(Hi(st,$e));break e}}le=st=Hi(st,$e),dn!==4&&(dn=2),Ll===null?Ll=[le]:Ll.push(le),le=xe;do{switch(le.tag){case 3:le.flags|=65536,x&=-x,le.lanes|=x;var rt=Vi(le,st,x);tl(le,rt);break e;case 1:$e=st;var Ye=le.type,dt=le.stateNode;if((le.flags&128)===0&&(typeof Ye.getDerivedStateFromError=="function"||dt!==null&&typeof dt.componentDidCatch=="function"&&(Za===null||!Za.has(dt)))){le.flags|=65536,x&=-x,le.lanes|=x;var $t=pa(le,$e,x);tl(le,$t);break e}}le=le.return}while(le!==null)}Zu(U)}catch(dr){x=dr,Cn===U&&U!==null&&(Cn=U=U.return);continue}break}while(!0)}function ss(){var b=va.current;return va.current=Ls,b===null?Ls:b}function eo(){(dn===0||dn===3||dn===2)&&(dn=4),rn===null||(Ts&268435455)===0&&(pn&268435455)===0||os(rn,Mn)}function ls(b,x){var U=_r;_r|=2;var Z=ss();(rn!==b||Mn!==x)&&(Ai=null,zo(b,x));do try{Pc();break}catch(ne){Ca(b,ne)}while(!0);if(Ua(),_r=U,va.current=Z,Cn!==null)throw Error(o(261));return rn=null,Mn=0,dn}function Pc(){for(;Cn!==null;)hf(Cn)}function Oc(){for(;Cn!==null&&!zu();)hf(Cn)}function hf(b){var x=Mp(b.alternate,b,ri);b.memoizedProps=b.pendingProps,x===null?Zu(b):Cn=x,Bo.current=null}function Zu(b){var x=b;do{var U=x.alternate;if(b=x.return,(x.flags&32768)===0){if(U=Ge(U,x,ri),U!==null){Cn=U;return}}else{if(U=_t(U,x),U!==null){U.flags&=32767,Cn=U;return}if(b!==null)b.flags|=32768,b.subtreeFlags=0,b.deletions=null;else{dn=6,Cn=null;return}}if(x=x.sibling,x!==null){Cn=x;return}Cn=x=b}while(x!==null);dn===0&&(dn=5)}function us(b,x,U){var Z=Dt,ne=yn.transition;try{yn.transition=null,Dt=1,Lp(b,x,U,Z)}finally{yn.transition=ne,Dt=Z}return null}function Lp(b,x,U,Z){do Tl();while(Qa!==null);if((_r&6)!==0)throw Error(o(327));U=b.finishedWork;var ne=b.finishedLanes;if(U===null)return null;if(b.finishedWork=null,b.finishedLanes=0,U===b.current)throw Error(o(177));b.callbackNode=null,b.callbackPriority=0;var le=U.lanes|U.childLanes;if(Yo(b,le),b===rn&&(Cn=rn=null,Mn=0),(U.subtreeFlags&2064)===0&&(U.flags&2064)===0||yo||(yo=!0,Uh(ou,function(){return Tl(),null})),le=(U.flags&15990)!==0,(U.subtreeFlags&15990)!==0||le){le=yn.transition,yn.transition=null;var xe=Dt;Dt=1;var $e=_r;_r|=4,Bo.current=null,Bt(b,U),Gi(U,b),V(b.containerInfo),b.current=U,Un(U),Xs(),_r=$e,Dt=xe,yn.transition=le}else b.current=U;if(yo&&(yo=!1,Qa=b,xc=ne),le=b.pendingLanes,le===0&&(Za=null),Da(U.stateNode),Wi(b,Dn()),x!==null)for(Z=b.onRecoverableError,U=0;U<x.length;U++)ne=x[U],Z(ne.value,{componentStack:ne.stack,digest:ne.digest});if(Vn)throw Vn=!1,b=Gn,Gn=null,b;return(xc&1)!==0&&b.tag!==0&&Tl(),le=b.pendingLanes,(le&1)!==0?b===Su?Wn++:(Wn=0,Su=b):Wn=0,li(),null}function Tl(){if(Qa!==null){var b=Ys(xc),x=yn.transition,U=Dt;try{if(yn.transition=null,Dt=16>b?16:b,Qa===null)var Z=!1;else{if(b=Qa,Qa=null,xc=0,(_r&6)!==0)throw Error(o(331));var ne=_r;for(_r|=4,He=b.current;He!==null;){var le=He,xe=le.child;if((He.flags&16)!==0){var $e=le.deletions;if($e!==null){for(var st=0;st<$e.length;st++){var Tt=$e[st];for(He=Tt;He!==null;){var er=He;switch(er.tag){case 0:case 11:case 15:lr(8,er,le)}var Er=er.child;if(Er!==null)Er.return=er,He=Er;else for(;He!==null;){er=He;var Wt=er.sibling,In=er.return;if(Ur(er),er===Tt){He=null;break}if(Wt!==null){Wt.return=In,He=Wt;break}He=In}}}var bn=le.alternate;if(bn!==null){var to=bn.child;if(to!==null){bn.child=null;do{var sl=to.sibling;to.sibling=null,to=sl}while(to!==null)}}He=le}}if((le.subtreeFlags&2064)!==0&&xe!==null)xe.return=le,He=xe;else e:for(;He!==null;){if(le=He,(le.flags&2048)!==0)switch(le.tag){case 0:case 11:case 15:lr(9,le,le.return)}var rt=le.sibling;if(rt!==null){rt.return=le.return,He=rt;break e}He=le.return}}var Ye=b.current;for(He=Ye;He!==null;){xe=He;var dt=xe.child;if((xe.subtreeFlags&2064)!==0&&dt!==null)dt.return=xe,He=dt;else e:for(xe=Ye;He!==null;){if($e=He,($e.flags&2048)!==0)try{switch($e.tag){case 0:case 11:case 15:jt(9,$e)}}catch(dr){$n($e,$e.return,dr)}if($e===xe){He=null;break e}var $t=$e.sibling;if($t!==null){$t.return=$e.return,He=$t;break e}He=$e.return}}if(_r=ne,li(),si&&typeof si.onPostCommitFiberRoot=="function")try{si.onPostCommitFiberRoot(uo,b)}catch{}Z=!0}return Z}finally{Dt=U,yn.transition=x}}return!1}function zh(b,x,U){x=Hi(U,x),x=Vi(b,x,1),b=Va(b,x,1),x=_n(),b!==null&&(mn(b,1,x),Wi(b,x))}function $n(b,x,U){if(b.tag===3)zh(b,b,U);else for(;x!==null;){if(x.tag===3){zh(x,b,U);break}else if(x.tag===1){var Z=x.stateNode;if(typeof x.type.getDerivedStateFromError=="function"||typeof Z.componentDidCatch=="function"&&(Za===null||!Za.has(Z))){b=Hi(U,b),b=pa(x,b,1),x=Va(x,b,1),b=_n(),x!==null&&(mn(x,1,b),Wi(x,b));break}}x=x.return}}function Np(b,x,U){var Z=b.pingCache;Z!==null&&Z.delete(x),x=_n(),b.pingedLanes|=b.suspendedLanes&U,rn===b&&(Mn&U)===U&&(dn===4||dn===3&&(Mn&130023424)===Mn&&500>Dn()-wu?zo(b,0):Ka|=U),Wi(b,x)}function Tp(b,x){x===0&&((b.mode&1)===0?x=1:(x=Ss,Ss<<=1,(Ss&130023424)===0&&(Ss=4194304)));var U=_n();b=ra(b,x),b!==null&&(mn(b,x,U),Wi(b,U))}function Rp(b){var x=b.memoizedState,U=0;x!==null&&(U=x.retryLane),Tp(b,U)}function d0(b,x){var U=0;switch(b.tag){case 13:var Z=b.stateNode,ne=b.memoizedState;ne!==null&&(U=ne.retryLane);break;case 19:Z=b.stateNode;break;default:throw Error(o(314))}Z!==null&&Z.delete(x),Tp(b,U)}var Mp;Mp=function(b,x,U){if(b!==null)if(b.memoizedProps!==x.pendingProps||Ti.current)fi=!0;else{if((b.lanes&U)===0&&(x.flags&128)===0)return fi=!1,oe(b,x,U);fi=(b.flags&131072)!==0}else fi=!1,nn&&(x.flags&1048576)!==0&&lu(x,xa,x.index);switch(x.lanes=0,x.tag){case 2:var Z=x.type;W(b,x),b=x.pendingProps;var ne=ja(x,vi.current);Qo(x,U),ne=Ro(null,x,Z,b,ne,U);var le=Mo();return x.flags|=1,typeof ne=="object"&&ne!==null&&typeof ne.render=="function"&&ne.$$typeof===void 0?(x.tag=1,x.memoizedState=null,x.updateQueue=null,oi(Z)?(le=!0,Wo(x)):le=!1,x.memoizedState=ne.state!==null&&ne.state!==void 0?ne.state:null,el(x),ne.updater=$u,x.stateNode=ne,ne._reactInternals=x,Ui(x,Z,b,U),x=ia(null,x,Z,!0,le,U)):(x.tag=0,nn&&le&&As(x),_i(null,x,ne,U),x=x.child),x;case 16:Z=x.elementType;e:{switch(W(b,x),b=x.pendingProps,ne=Z._init,Z=ne(Z._payload),x.type=Z,ne=x.tag=p0(Z),b=$a(Z,b),ne){case 0:x=ns(null,x,Z,b,U);break e;case 1:x=Pi(null,x,Z,b,U);break e;case 11:x=Sc(null,x,Z,b,U);break e;case 14:x=rs(null,x,Z,$a(Z.type,b),U);break e}throw Error(o(306,Z,""))}return x;case 0:return Z=x.type,ne=x.pendingProps,ne=x.elementType===Z?ne:$a(Z,ne),ns(b,x,Z,ne,U);case 1:return Z=x.type,ne=x.pendingProps,ne=x.elementType===Z?ne:$a(Z,ne),Pi(b,x,Z,ne,U);case 3:e:{if(al(x),b===null)throw Error(o(387));Z=x.pendingProps,le=x.memoizedState,ne=le.element,wl(b,x),co(x,Z,null,U);var xe=x.memoizedState;if(Z=xe.element,Ae&&le.isDehydrated)if(le={element:Z,isDehydrated:!1,cache:xe.cache,pendingSuspenseBoundaries:xe.pendingSuspenseBoundaries,transitions:xe.transitions},x.updateQueue.baseState=le,x.memoizedState=le,x.flags&256){ne=Hi(Error(o(423)),x),x=Al(b,x,Z,U,ne);break e}else if(Z!==ne){ne=Hi(Error(o(424)),x),x=Al(b,x,Z,U,ne);break e}else for(Ae&&(mi=Ft(x.stateNode.containerInfo),Xn=x,nn=!0,za=null,Qs=!1),U=Nn(x,null,Z,U),x.child=U;U;)U.flags=U.flags&-3|4096,U=U.sibling;else{if(Le(),Z===ne){x=re(b,x,U);break e}_i(b,x,Z,U)}x=x.child}return x;case 5:return qi(x),b===null&&Ko(x),Z=x.type,ne=x.pendingProps,le=b!==null?b.memoizedProps:null,xe=ne.children,J(Z,ne)?xe=null:le!==null&&J(Z,le)&&(x.flags|=32),sn(b,x),_i(b,x,xe,U),x.child;case 6:return b===null&&Ko(x),null;case 13:return cf(b,x,U);case 4:return Jo(x,x.stateNode.containerInfo),Z=x.pendingProps,b===null?x.child=Or(x,null,Z,U):_i(b,x,Z,U),x.child;case 11:return Z=x.type,ne=x.pendingProps,ne=x.elementType===Z?ne:$a(Z,ne),Sc(b,x,Z,ne,U);case 7:return _i(b,x,x.pendingProps,U),x.child;case 8:return _i(b,x,x.pendingProps.children,U),x.child;case 12:return _i(b,x,x.pendingProps.children,U),x.child;case 10:e:{if(Z=x.type._context,ne=x.pendingProps,le=x.memoizedProps,xe=ne.value,Ea(x,Z,xe),le!==null)if(Mi(le.value,xe)){if(le.children===ne.children&&!Ti.current){x=re(b,x,U);break e}}else for(le=x.child,le!==null&&(le.return=x);le!==null;){var $e=le.dependencies;if($e!==null){xe=le.child;for(var st=$e.firstContext;st!==null;){if(st.context===Z){if(le.tag===1){st=Oa(-1,U&-U),st.tag=2;var Tt=le.updateQueue;if(Tt!==null){Tt=Tt.shared;var er=Tt.pending;er===null?st.next=st:(st.next=er.next,er.next=st),Tt.pending=st}}le.lanes|=U,st=le.alternate,st!==null&&(st.lanes|=U),Zo(le.return,U,x),$e.lanes|=U;break}st=st.next}}else if(le.tag===10)xe=le.type===x.type?null:le.child;else if(le.tag===18){if(xe=le.return,xe===null)throw Error(o(341));xe.lanes|=U,$e=xe.alternate,$e!==null&&($e.lanes|=U),Zo(xe,U,x),xe=le.sibling}else xe=le.child;if(xe!==null)xe.return=le;else for(xe=le;xe!==null;){if(xe===x){xe=null;break}if(le=xe.sibling,le!==null){le.return=xe.return,xe=le;break}xe=xe.return}le=xe}_i(b,x,ne.children,U),x=x.child}return x;case 9:return ne=x.type,Z=x.pendingProps.children,Qo(x,U),ne=Di(ne),Z=Z(ne),x.flags|=1,_i(b,x,Z,U),x.child;case 14:return Z=x.type,ne=$a(Z,x.pendingProps),ne=$a(Z.type,ne),rs(b,x,Z,ne,U);case 15:return go(b,x,x.type,x.pendingProps,U);case 17:return Z=x.type,ne=x.pendingProps,ne=x.elementType===Z?ne:$a(Z,ne),W(b,x),x.tag=1,oi(Z)?(b=!0,Wo(x)):b=!1,Qo(x,U),Uf(x,Z,ne),Ui(x,Z,ne,U),ia(null,x,Z,!0,b,U);case 19:return N(b,x,U);case 22:return en(b,x,U)}throw Error(o(156,x.tag))};function Uh(b,x){return lo(b,x)}function Ip(b,x,U,Z){this.tag=b,this.key=U,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=x,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Uo(b,x,U,Z){return new Ip(b,x,U,Z)}function Ac(b){return b=b.prototype,!(!b||!b.isReactComponent)}function p0(b){if(typeof b=="function")return Ac(b)?1:0;if(b!=null){if(b=b.$$typeof,b===S)return 11;if(b===y)return 14}return 2}function Eu(b,x){var U=b.alternate;return U===null?(U=Uo(b.tag,x,b.key,b.mode),U.elementType=b.elementType,U.type=b.type,U.stateNode=b.stateNode,U.alternate=b,b.alternate=U):(U.pendingProps=x,U.type=b.type,U.flags=0,U.subtreeFlags=0,U.deletions=null),U.flags=b.flags&14680064,U.childLanes=b.childLanes,U.lanes=b.lanes,U.child=b.child,U.memoizedProps=b.memoizedProps,U.memoizedState=b.memoizedState,U.updateQueue=b.updateQueue,x=b.dependencies,U.dependencies=x===null?null:{lanes:x.lanes,firstContext:x.firstContext},U.sibling=b.sibling,U.index=b.index,U.ref=b.ref,U}function $f(b,x,U,Z,ne,le){var xe=2;if(Z=b,typeof b=="function")Ac(b)&&(xe=1);else if(typeof b=="string")xe=5;else e:switch(b){case h:return ma(U.children,ne,le,x);case v:xe=8,ne|=8;break;case g:return b=Uo(12,U,x,ne|2),b.elementType=g,b.lanes=le,b;case w:return b=Uo(13,U,x,ne),b.elementType=w,b.lanes=le,b;case _:return b=Uo(19,U,x,ne),b.elementType=_,b.lanes=le,b;case m:return Cc(U,ne,le,x);default:if(typeof b=="object"&&b!==null)switch(b.$$typeof){case f:xe=10;break e;case E:xe=9;break e;case S:xe=11;break e;case y:xe=14;break e;case p:xe=16,Z=null;break e}throw Error(o(130,b==null?b:typeof b,""))}return x=Uo(xe,U,x,ne),x.elementType=b,x.type=Z,x.lanes=le,x}function ma(b,x,U,Z){return b=Uo(7,b,Z,x),b.lanes=U,b}function Cc(b,x,U,Z){return b=Uo(22,b,Z,x),b.elementType=m,b.lanes=U,b.stateNode={isHidden:!1},b}function kc(b,x,U){return b=Uo(6,b,null,x),b.lanes=U,b}function Yf(b,x,U){return x=Uo(4,b.children!==null?b.children:[],b.key,x),x.lanes=U,x.stateNode={containerInfo:b.containerInfo,pendingChildren:null,implementation:b.implementation},x}function jp(b,x,U,Z,ne){this.tag=x,this.containerInfo=b,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=se,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ps(0),this.expirationTimes=Ps(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.identifierPrefix=Z,this.onRecoverableError=ne,Ae&&(this.mutableSourceEagerHydrationData=null)}function Hh(b,x,U,Z,ne,le,xe,$e,st){return b=new jp(b,x,U,$e,st),x===1?(x=1,le===!0&&(x|=8)):x=0,le=Uo(3,null,null,x),b.current=le,le.stateNode=b,le.memoizedState={element:Z,isDehydrated:U,cache:null,transitions:null,pendingSuspenseBoundaries:null},el(le),b}function Xf(b){if(!b)return cn;b=b._reactInternals;e:{if(I(b)!==b||b.tag!==1)throw Error(o(170));var x=b;do{switch(x.tag){case 3:x=x.stateNode.context;break e;case 1:if(oi(x.type)){x=x.stateNode.__reactInternalMemoizedMergedChildContext;break e}}x=x.return}while(x!==null);throw Error(o(171))}if(b.tag===1){var U=b.type;if(oi(U))return ha(b,U,x)}return x}function Qu(b){var x=b._reactInternals;if(x===void 0)throw typeof b.render=="function"?Error(o(188)):(b=Object.keys(b).join(","),Error(o(268,b)));return b=O(x),b===null?null:b.stateNode}function Kf(b,x){if(b=b.memoizedState,b!==null&&b.dehydrated!==null){var U=b.retryLane;b.retryLane=U!==0&&U<x?U:x}}function Lc(b,x){Kf(b,x),(b=b.alternate)&&Kf(b,x)}function g0(b){return b=O(b),b===null?null:b.stateNode}function Fp(){return null}return t.attemptContinuousHydration=function(b){if(b.tag===13){var x=ra(b,134217728);if(x!==null){var U=_n();la(x,b,134217728,U)}Lc(b,134217728)}},t.attemptDiscreteHydration=function(b){if(b.tag===13){var x=ra(b,1);if(x!==null){var U=_n();la(x,b,1,U)}Lc(b,1)}},t.attemptHydrationAtCurrentPriority=function(b){if(b.tag===13){var x=pi(b),U=ra(b,x);if(U!==null){var Z=_n();la(U,b,x,Z)}Lc(b,x)}},t.attemptSynchronousHydration=function(b){switch(b.tag){case 3:var x=b.stateNode;if(x.current.memoizedState.isDehydrated){var U=Ws(x.pendingLanes);U!==0&&(Fa(x,U|1),Wi(x,Dn()),(_r&6)===0&&(ln(),li()))}break;case 13:Nl(function(){var Z=ra(b,1);if(Z!==null){var ne=_n();la(Z,b,1,ne)}}),Lc(b,1)}},t.batchedUpdates=function(b,x){var U=_r;_r|=1;try{return b(x)}finally{_r=U,_r===0&&(ln(),Ao&&li())}},t.createComponentSelector=function(b){return{$$typeof:wn,value:b}},t.createContainer=function(b,x,U,Z,ne,le,xe){return Hh(b,x,!1,null,U,Z,ne,le,xe)},t.createHasPseudoClassSelector=function(b){return{$$typeof:Hn,value:b}},t.createHydrationContainer=function(b,x,U,Z,ne,le,xe,$e,st){return b=Hh(U,Z,!0,b,ne,le,xe,$e,st),b.context=Xf(null),U=b.current,Z=_n(),ne=pi(U),le=Oa(Z,ne),le.callback=x??null,Va(U,le,ne),b.current.lanes=ne,mn(b,ne,Z),Wi(b,Z),b},t.createPortal=function(b,x,U){var Z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:Z==null?null:""+Z,children:b,containerInfo:x,implementation:U}},t.createRoleSelector=function(b){return{$$typeof:oa,value:b}},t.createTestNameSelector=function(b){return{$$typeof:Do,value:b}},t.createTextSelector=function(b){return{$$typeof:vo,value:b}},t.deferredUpdates=function(b){var x=Dt,U=yn.transition;try{return yn.transition=null,Dt=16,b()}finally{Dt=x,yn.transition=U}},t.discreteUpdates=function(b,x,U,Z,ne){var le=Dt,xe=yn.transition;try{return yn.transition=null,Dt=1,b(x,U,Z,ne)}finally{Dt=le,yn.transition=xe,_r===0&&ln()}},t.findAllNodes=Aa,t.findBoundingRects=function(b,x){if(!ke)throw Error(o(363));x=Aa(b,x),b=[];for(var U=0;U<x.length;U++)b.push(ve(x[U]));for(x=b.length-1;0<x;x--){U=b[x];for(var Z=U.x,ne=Z+U.width,le=U.y,xe=le+U.height,$e=x-1;0<=$e;$e--)if(x!==$e){var st=b[$e],Tt=st.x,er=Tt+st.width,Er=st.y,Wt=Er+st.height;if(Z>=Tt&&le>=Er&&ne<=er&&xe<=Wt){b.splice(x,1);break}else if(Z!==Tt||U.width!==st.width||Wt<le||Er>xe){if(!(le!==Er||U.height!==st.height||er<Z||Tt>ne)){Tt>Z&&(st.width+=Tt-Z,st.x=Z),er<ne&&(st.width=ne-Tt),b.splice(x,1);break}}else{Er>le&&(st.height+=Er-le,st.y=le),Wt<xe&&(st.height=xe-Er),b.splice(x,1);break}}}return b},t.findHostInstance=Qu,t.findHostInstanceWithNoPortals=function(b){return b=A(b),b=b!==null?q(b):null,b===null?null:b.stateNode},t.findHostInstanceWithWarning=function(b){return Qu(b)},t.flushControlled=function(b){var x=_r;_r|=1;var U=yn.transition,Z=Dt;try{yn.transition=null,Dt=1,b()}finally{Dt=Z,yn.transition=U,_r=x,_r===0&&(ln(),li())}},t.flushPassiveEffects=Tl,t.flushSync=Nl,t.focusWithin=function(b,x){if(!ke)throw Error(o(363));for(b=mo(b),x=Xa(b,x),x=Array.from(x),b=0;b<x.length;){var U=x[b++];if(!je(U)){if(U.tag===5&&ct(U.stateNode))return!0;for(U=U.child;U!==null;)x.push(U),U=U.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Dt},t.getFindAllNodesFailureDescription=function(b,x){if(!ke)throw Error(o(363));var U=0,Z=[];b=[mo(b),0];for(var ne=0;ne<b.length;){var le=b[ne++],xe=b[ne++],$e=x[xe];if((le.tag!==5||!je(le))&&(yu(le,$e)&&(Z.push(Xu($e)),xe++,xe>U&&(U=xe)),xe<x.length))for(le=le.child;le!==null;)b.push(le,xe),le=le.sibling}if(U<x.length){for(b=[];U<x.length;U++)b.push(Xu(x[U]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(Z.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+b.join(" > ")}return null},t.getPublicRootInstance=function(b){if(b=b.current,!b.child)return null;switch(b.child.tag){case 5:return te(b.child.stateNode);default:return b.child.stateNode}},t.injectIntoDevTools=function(b){if(b={bundleType:b.bundleType,version:b.version,rendererPackageName:b.rendererPackageName,rendererConfig:b.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:g0,findFiberByHostInstance:b.findFiberByHostInstance||Fp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")b=!1;else{var x=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(x.isDisabled||!x.supportsFiber)b=!0;else{try{uo=x.inject(b),si=x}catch{}b=!!x.checkDCE}}return b},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(b,x,U,Z){if(!ke)throw Error(o(363));b=Aa(b,x);var ne=mt(b,U,Z).disconnect;return{disconnect:function(){ne()}}},t.registerMutableSourceForHydration=function(b,x){var U=x._getVersion;U=U(x._source),b.mutableSourceEagerHydrationData==null?b.mutableSourceEagerHydrationData=[x,U]:b.mutableSourceEagerHydrationData.push(x,U)},t.runWithPriority=function(b,x){var U=Dt;try{return Dt=b,x()}finally{Dt=U}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(b,x,U,Z){var ne=x.current,le=_n(),xe=pi(ne);return U=Xf(U),x.context===null?x.context=U:x.pendingContext=U,x=Oa(le,xe),x.payload={element:b},Z=Z===void 0?null:Z,Z!==null&&(x.callback=Z),b=Va(ne,x,xe),b!==null&&(la(b,ne,xe,le),xi(b,ne,xe)),xe},t}),sg}var $5;function Ox(){return $5||($5=1,og.exports=Px()),og.exports}var Ax=Ox();const Cx=yp(Ax);var lg={exports:{}},Bc={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-reconciler-constants.production.min.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var Y5;function kx(){return Y5||(Y5=1,Bc.ConcurrentRoot=1,Bc.ContinuousEventPriority=4,Bc.DefaultEventPriority=16,Bc.DiscreteEventPriority=1,Bc.IdleEventPriority=536870912,Bc.LegacyRoot=0),Bc}var X5;function Lx(){return X5||(X5=1,lg.exports=kx()),lg.exports}var T6=Lx(),Nx=jr();const K5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Z5=!1,Q5=!1;const hm=".react-konva-event";let R6=!1;function Tx(e){R6=e}const Rx=`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
|
+
`,Mx=`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
|
+
`,Ix={};function e0(e,r,t=Ix){if(!Z5&&"zIndex"in r&&(console.warn(Mx),Z5=!0),!Q5&&r.draggable){var n=r.x!==void 0||r.y!==void 0,a=r.onDragEnd||r.onDragMove;n&&!a&&(console.warn(Rx),Q5=!0)}for(var i in t)if(!K5[i]){var o=i.slice(0,2)==="on",s=t[i]!==r[i];if(o&&s){var u=i.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,t[i])}var c=!r.hasOwnProperty(i);c&&e.setAttr(i,void 0)}var h=R6||r._useStrictMode,v={},g=!1;const f={};for(var i in r)if(!K5[i]){var o=i.slice(0,2)==="on",E=t[i]!==r[i];if(o&&E){var u=i.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),r[i]&&(f[u]=r[i])}!o&&(r[i]!==t[i]||h&&r[i]!==e.getAttr(i))&&(g=!0,v[i]=r[i])}g&&(e.setAttrs(v),tf(e));for(var u in f)e.on(u+hm,f[u])}function tf(e){if(!Nx.Konva.autoDrawEnabled){var r=e.getLayer()||e.getStage();r&&r.batchDraw()}}var ug=q2();const M6={},jx={};dp.Node.prototype._applyProps=e0;function Fx(e,r){if(typeof r=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${r}`);return}e.add(r),tf(e)}function Dx(e,r,t){let n=dp[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=dp.Group);const a={},i={};for(var o in r){var s=o.slice(0,2)==="on";s?i[o]=r[o]:a[o]=r[o]}const u=new n(a);return e0(u,i),u}function Bx(e,r,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function qx(e,r,t){return!1}function zx(e){return e}function Ux(){return null}function Hx(){return null}function Vx(e,r,t,n){return jx}function Gx(){}function Wx(e){}function $x(e,r){return!1}function Yx(){return M6}function Xx(){return M6}const Kx=setTimeout,Zx=clearTimeout,Qx=-1;function Jx(e,r){return!1}const eE=!1,tE=!0,rE=!0;function nE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function iE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function I6(e,r,t){r._remove(),e.add(r),r.setZIndex(t.getZIndex()),tf(e)}function aE(e,r,t){I6(e,r,t)}function oE(e,r){r.destroy(),r.off(hm),tf(e)}function sE(e,r){r.destroy(),r.off(hm),tf(e)}function lE(e,r,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function uE(e,r,t){}function cE(e,r,t,n,a){e0(e,a,n)}function fE(e){e.hide(),tf(e)}function hE(e){}function dE(e,r){(r.visible==null||r.visible)&&e.show()}function pE(e,r){}function gE(e){}function vE(){}const mE=()=>T6.DefaultEventPriority,yE=Object.freeze(Object.defineProperty({__proto__:null,appendChild:nE,appendChildToContainer:iE,appendInitialChild:Fx,cancelTimeout:Zx,clearContainer:gE,commitMount:uE,commitTextUpdate:lE,commitUpdate:cE,createInstance:Dx,createTextInstance:Bx,detachDeletedInstance:vE,finalizeInitialChildren:qx,getChildHostContext:Xx,getCurrentEventPriority:mE,getPublicInstance:zx,getRootHostContext:Yx,hideInstance:fE,hideTextInstance:hE,idlePriority:ug.unstable_IdlePriority,insertBefore:I6,insertInContainerBefore:aE,isPrimaryRenderer:eE,noTimeout:Qx,now:ug.unstable_now,prepareForCommit:Ux,preparePortalMount:Hx,prepareUpdate:Vx,removeChild:oE,removeChildFromContainer:sE,resetAfterCommit:Gx,resetTextContent:Wx,run:ug.unstable_runWithPriority,scheduleTimeout:Kx,shouldDeprioritizeSubtree:$x,shouldSetTextContent:Jx,supportsMutation:rE,unhideInstance:dE,unhideTextInstance:pE,warnsIfNotActing:tE},Symbol.toStringTag,{value:"Module"}));var bE=Object.defineProperty,wE=Object.defineProperties,_E=Object.getOwnPropertyDescriptors,J5=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,xE=Object.prototype.propertyIsEnumerable,eb=(e,r,t)=>r in e?bE(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,tb=(e,r)=>{for(var t in r||(r={}))SE.call(r,t)&&eb(e,t,r[t]);if(J5)for(var t of J5(r))xE.call(r,t)&&eb(e,t,r[t]);return e},EE=(e,r)=>wE(e,_E(r)),rb,nb;typeof window<"u"&&((rb=window.document)!=null&&rb.createElement||((nb=window.navigator)==null?void 0:nb.product)==="ReactNative")?ii.useLayoutEffect:ii.useEffect;function j6(e,r,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const a=j6(n,r,t);if(a)return a;n=n.sibling}}function F6(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const ib=console.error;console.error=function(){const e=[...arguments].join("");if(e?.startsWith("Warning:")&&e.includes("useContext")){console.error=ib;return}return ib.apply(this,arguments)};const dm=F6(ii.createContext(null));class D6 extends ii.Component{render(){return ii.createElement(dm.Provider,{value:this._reactInternals},this.props.children)}}function PE(){const e=ii.useContext(dm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const r=ii.useId();return ii.useMemo(()=>{for(const n of[e,e?.alternate]){if(!n)continue;const a=j6(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===r)return!0;o=o.next}});if(a)return a}},[e,r])}function OE(){const e=PE(),[r]=ii.useState(()=>new Map);r.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==dm&&!r.has(a)&&r.set(a,ii.useContext(F6(a)))}t=t.return}return r}function B6(){const e=OE();return ii.useMemo(()=>Array.from(e.keys()).reduce((r,t)=>n=>ii.createElement(r,null,ii.createElement(t.Provider,EE(tb({},n),{value:e.get(t)}))),r=>ii.createElement(D6,tb({},r))),[e])}function AE(e){const r=$r.useRef({});return $r.useLayoutEffect(()=>{r.current=e}),$r.useLayoutEffect(()=>()=>{r.current={}},[]),r.current}const CE=e=>{const r=$r.useRef(),t=$r.useRef(),n=$r.useRef(),a=AE(e),i=B6(),o=s=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(s):u.current=s)};return $r.useLayoutEffect(()=>(t.current=new dp.Stage({width:e.width,height:e.height,container:r.current}),o(t.current),n.current=hh.createContainer(t.current,T6.LegacyRoot,!1,null),hh.updateContainer($r.createElement(i,{},e.children),n.current),()=>{dp.isBrowser&&(o(null),hh.updateContainer(null,n.current,null),t.current.destroy())}),[]),$r.useLayoutEffect(()=>{o(t.current),e0(t.current,e,a),hh.updateContainer($r.createElement(i,{},e.children),n.current,null)}),$r.createElement("div",{ref:r,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},kE="Layer",LE="FastLayer",M1="Group",NE="Label",TE="Rect",RE="Circle",ME="Ellipse",IE="Wedge",jE="Line",FE="Sprite",DE="Image",BE="Text",qE="TextPath",zE="Star",UE="Ring",HE="Arc",VE="Tag",GE="Path",WE="RegularPolygon",$E="Arrow",YE="Shape",XE="Transformer",KE="18.2.12",hh=Cx(yE);hh.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:$r.version,rendererPackageName:"react-konva"});const ZE=$r.forwardRef((e,r)=>$r.createElement(D6,{},$r.createElement(CE,{...e,forwardedRef:r}))),QE=Tx,JE=Object.freeze(Object.defineProperty({__proto__:null,Arc:HE,Arrow:$E,Circle:RE,Ellipse:ME,FastLayer:LE,Group:M1,Image:DE,KonvaRenderer:hh,Label:NE,Layer:kE,Line:jE,Path:GE,Rect:TE,RegularPolygon:WE,Ring:UE,Shape:YE,Sprite:FE,Stage:ZE,Star:zE,Tag:VE,Text:BE,TextPath:qE,Transformer:XE,Wedge:IE,useStrictMode:QE,version:KE},Symbol.toStringTag,{value:"Module"})),Fu=Zc(JE);var cg,ab;function t0(){if(ab)return cg;ab=1;var e=ai();return cg=function(t,n,a){const i=e.useRef("loading"),o=e.useRef(),[s,u]=e.useState(0),c=e.useRef(),h=e.useRef(),v=e.useRef();return(c.current!==t||h.current!==n||v.current!==a)&&(i.current="loading",o.current=void 0,c.current=t,h.current=n,v.current=a),e.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function f(){g.decode().catch(()=>{}).finally(()=>{i.current="loaded",o.current=g,u(Math.random())})}function E(){i.current="failed",o.current=void 0,u(Math.random())}return g.addEventListener("load",f),g.addEventListener("error",E),n&&(g.crossOrigin=n),a&&(g.referrerPolicy=a),g.src=t,function(){g.removeEventListener("load",f),g.removeEventListener("error",E)}},[t,n,a]),[o.current,i.current]},cg}var Dd={},Bd={},eP=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t};const tP=e=>{const r=window.getComputedStyle(e).position;return!(r==="absolute"||r==="relative")};function q6(e=()=>{}){const r=$r.useRef(e);return r.current=e,$r.useCallback((...t)=>r.current.apply(null,t),[])}const rP=({children:e,groupProps:r,divProps:t,transform:n,transformFunc:a,parentNodeFunc:i})=>{const o=B6(),s=$r.useRef(null),[u]=$r.useState(()=>document.createElement("div")),c=$r.useMemo(()=>mw.createRoot(u),[u]),h=n??!0,v=q6(()=>{if(h&&s.current){let w=s.current.getAbsoluteTransform().decompose();a&&(w=a(w)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${w.x}px, ${w.y}px) rotate(${w.rotation}deg) scaleX(${w.scaleX}) scaleY(${w.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=t||{},{style:f}=g,E=eP(g,["style"]);Object.assign(u.style,f),Object.assign(u,E)});return $r.useLayoutEffect(()=>{var g;const f=s.current;if(!f)return;const E=i?i({stage:f.getStage()}):(g=f.getStage())===null||g===void 0?void 0:g.container();if(E)return E.appendChild(u),h&&tP(E)&&(E.style.position="relative"),f.on("absoluteTransformChange",v),v(),()=>{var S;f.off("absoluteTransformChange",v),(S=u.parentNode)===null||S===void 0||S.removeChild(u)}},[h,i]),$r.useLayoutEffect(()=>{v()},[t,a]),$r.useLayoutEffect(()=>{queueMicrotask(()=>{b6.flushSync(()=>{c.render($r.createElement(o,null,e))})})}),$r.useLayoutEffect(()=>()=>{setTimeout(()=>{c.unmount()})},[]),$r.createElement(M1,Object.assign({ref:s},r))},nP=({selector:e,enabled:r,children:t})=>{const n=$r.useRef(null),a=$r.useRef(null),i=$r.useRef(null),o=r??!0;return $r.useLayoutEffect(()=>{if(!n.current||!a.current)return;i.current=a.current;const u=n.current.getStage().findOne(e);o&&u?a.current.moveTo(u):a.current.moveTo(n.current);const c=n.current.getLayer();if(c&&(c.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),$r.useEffect(()=>()=>{var s;(s=i.current)===null||s===void 0||s.destroy()},[]),$r.createElement(M1,{name:"_outer_portal",ref:n},$r.createElement(M1,{name:"_inner_portal",ref:a},t))};var iP=t0();const aP=yp(iP),oP=Object.freeze(Object.defineProperty({__proto__:null,Html:rP,Portal:nP,useEvent:q6,useImage:aP},Symbol.toStringTag,{value:"Module"})),Mh=Zc(oP);function sP(e,r){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(r))),e}function z6(e,r,t){const n=r-1,a=t[H6(n,t.length)];return a.marker!=="Z"?a:z6(e,n,t)}function U6(e,r,t){const n=r+1,a=t[H6(n,t.length)];return a.marker==="Z"?U6(e,n,t):a}function lP(e,r,t){let n=t[r-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(o,s){return o[s].marker==="M"?o[s]:a(o,s-1)},i=a(t,r);e.values.x=i.values.x,e.values.y=i.values.y}return e}function uP(e,r){const t=[];switch(e.toUpperCase()){case"M":for(let n=0;n<r.length;n+=2){let a;e===e.toUpperCase()?a=n===0?"M":"L":a=n===0?"m":"l",t.push({marker:a,values:{x:r[n],y:r[n+1]}})}break;case"L":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"H":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:r[n],y:0}});break;case"V":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:0,y:r[n]}});break;case"C":for(let n=0;n<r.length;n+=6)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x2:r[n+2],y2:r[n+3],x:r[n+4],y:r[n+5]}});break;case"S":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x2:r[n],y2:r[n+1],x:r[n+2],y:r[n+3]}});break;case"Q":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x:r[n+2],y:r[n+3]}});break;case"T":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"A":for(let n=0;n<r.length;n+=7)t.push({marker:e,values:{radiusX:r[n],radiusY:r[n+1],rotation:r[n+2],largeArc:r[n+3],sweep:r[n+4],x:r[n+5],y:r[n+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function H6(e,r){return(e%r+r)%r}function cP(e,r,t){if(r!==0&&e.marker==="L"){let n=t[r-1];["x","y"].every(i=>Math.round(Math.abs(n.values[i]-e.values[i]))===0)&&(e.overlap=!0)}return e}function P2(e,r){const t=["x","y"].every(n=>Math.round(Math.abs(e[r].values[n]-e[0].values[n]))===0);e[r].marker==="L"&&t&&(e[r].overlap=!0,P2(e,r-1)),e[r].marker==="Z"&&P2(e,r-1)}function fP(e,r,t){const n=sb(e.values,t.values),a=sb(r.values,e.values);return Math.min(a,n)}function ob(e,r){return Math.atan2(r.x-e.x,r.y-e.y)}function sb(e,r){const t=e.x-r.x,n=e.y-r.y;return Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}function lb(e,r){return Math.sin(e)*r}function ub(e,r){return Math.cos(e)*r}function cb(e,r){const t=r/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?r:t}function hP(e,r){return r*Math.tan(e)}function dP(e,r){let t,n=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=cb(e/2,-r):(t=cb(e/2,r),n=1,t===1/0&&(t=r)),{offset:t,sweepFlag:n}}function pP(e){const r=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let n="";if(t.marker!=="Z"){const a=Object.keys(t.values);n=r.filter(i=>a.indexOf(i)!==-1).map(i=>t.values[i]).join()}return`${t.marker}${n}`}).join("").trim()}function V6(e){const r=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(r)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,a)=>{const i=e.substring(a.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:a.marker,index:a.index,chunk:i.length>0?i.substr(1,i.length-1):i}])},[]).reverse().flatMap(n=>{const a=n.chunk.match(t),i=a?a.map(parseFloat):[];return uP(n.marker,i)}).map(lP)}function G6(e,r,t){let n=[],a=[];return t&&e.forEach(i=>sP(i,t)),e.forEach(i=>{i.marker==="M"&&n.push([]),n[n.length-1].push(i)}),n.forEach(i=>{i.map(cP),P2(i,i.length-1);const o=i[i.length-1].marker=="Z";i.filter(s=>!s.overlap).map((s,u,c)=>{const v=z6(s,u,c),g=U6(s,u,c),f=ob(s.values,v.values),E=ob(s.values,g.values),S=E-f,w=S*(180/Math.PI),_=fP(s,v,g),y=Math.abs(hP(S/2,_/2)),p=Math.min(r,y),m=dP(S,p),P=m.offset,T=m.sweepFlag,k=(u==0||u==c.length-1)&&!o;switch(s.marker){case"M":case"L":const L=[s.values.x+lb(f,P),s.values.y+ub(f,P)],I=[s.values.x+lb(E,P),s.values.y+ub(E,P)];k?a.push({marker:s.marker,values:s.values}):a.push({marker:s.marker,values:{x:parseFloat(L[0].toFixed(3)),y:parseFloat(L[1].toFixed(3))}}),!k&&(g.marker==="L"||g.marker==="M")&&a.push({marker:"A",radius:p,values:{radiusX:parseFloat(p.toFixed(3)),radiusY:parseFloat(p.toFixed(3)),rotation:w,largeArc:0,sweep:T,x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:s.marker,values:s.values});break}})}),{path:pP(a),commands:a}}function gP(e,r,t){return G6([...V6(e)],r,t)}const vP=Object.freeze(Object.defineProperty({__proto__:null,parsePath:V6,roundCommands:G6,roundCorners:gP},Symbol.toStringTag,{value:"Module"})),mP=Zc(vP);var jl={},qd={},l1={},fb;function yP(){if(fb)return l1;fb=1;var e=e||{};e.stringify=function(){var r={"visit_linear-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return r.visit_gradient(t)},"visit_radial-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return r.visit_gradient(t)},visit_gradient:function(t){var n=r.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+r.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,a=r.visit(t.at),i=r.visit(t.style);return i&&(n+=" "+i),a&&(n+=" at "+a),n},"visit_default-radial":function(t){var n="",a=r.visit(t.at);return a&&(n+=a),n},"visit_extent-keyword":function(t){var n=t.value,a=r.visit(t.at);return a&&(n+=" at "+a),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return r.visit(t.value.x)+" "+r.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return r.visit_color(t.value,t)},visit_hex:function(t){return r.visit_color("#"+t.value,t)},visit_rgb:function(t){return r.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return r.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return r.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return r.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return r.visit_color("var("+t.value+")",t)},visit_color:function(t,n){var a=t,i=r.visit(n.length);return i&&(a+=" "+i),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",a=t.length;return t.forEach(function(i,o){n+=r.visit(i),o<a-1&&(n+=", ")}),n},visit_object:function(t){return t.width&&t.height?r.visit(t.width)+" "+r.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return r.visit_array(t);if(typeof t=="object"&&!t.type)return r.visit_object(t);if(t.type){var n=r["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return r.visit(t)}}();var e=e||{};return e.parse=function(){var r={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},t="";function n(F){var Y=new Error(t+": "+F);throw Y.source=t,Y}function a(){var F=i();return t.length>0&&n("Invalid input not EOF"),F}function i(){return m(o)}function o(){return s("linear-gradient",r.linearGradient,c)||s("repeating-linear-gradient",r.repeatingLinearGradient,c)||s("radial-gradient",r.radialGradient,g)||s("repeating-radial-gradient",r.repeatingRadialGradient,g)}function s(F,Y,J){return u(Y,function(X){var Q=J();return Q&&(j(r.comma)||n("Missing comma before color stops")),{type:F,orientation:Q,colorStops:m(P)}})}function u(F,Y){var J=j(F);if(J){j(r.startCall)||n("Missing (");var X=Y(J);return j(r.endCall)||n("Missing )"),X}}function c(){var F=h();if(F)return F;var Y=V("position-keyword",r.positionKeywords,1);return Y?{type:"directional",value:Y.value}:v()}function h(){return V("directional",r.sideOrCorner,1)}function v(){return V("angular",r.angleValue,1)||V("angular",r.radianValue,1)}function g(){var F,Y=f(),J;return Y&&(F=[],F.push(Y),J=t,j(r.comma)&&(Y=f(),Y?F.push(Y):t=J)),F}function f(){var F=E()||S();if(F)F.at=_();else{var Y=w();if(Y){F=Y;var J=_();J&&(F.at=J)}else{var X=_();if(X)F={type:"default-radial",at:X};else{var Q=y();Q&&(F={type:"default-radial",at:Q})}}}return F}function E(){var F=V("shape",/^(circle)/i,0);return F&&(F.style=$()||w()),F}function S(){var F=V("shape",/^(ellipse)/i,0);return F&&(F.style=y()||te()||w()),F}function w(){return V("extent-keyword",r.extentKeywords,1)}function _(){if(V("position",/^at/,0)){var F=y();return F||n("Missing positioning value"),F}}function y(){var F=p();if(F.x||F.y)return{type:"position",value:F}}function p(){return{x:te(),y:te()}}function m(F){var Y=F(),J=[];if(Y)for(J.push(Y);j(r.comma);)Y=F(),Y?J.push(Y):n("One extra comma");return J}function P(){var F=T();return F||n("Expected color definition"),F.length=te(),F}function T(){return L()||M()||O()||R()||I()||A()||k()}function k(){return V("literal",r.literalColor,0)}function L(){return V("hex",r.hexColor,1)}function I(){return u(r.rgbColor,function(){return{type:"rgb",value:m(D)}})}function R(){return u(r.rgbaColor,function(){return{type:"rgba",value:m(D)}})}function A(){return u(r.varColor,function(){return{type:"var",value:q()}})}function O(){return u(r.hslColor,function(){var F=j(r.percentageValue);F&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var Y=D();j(r.comma);var J=j(r.percentageValue),X=J?J[1]:null;j(r.comma),J=j(r.percentageValue);var Q=J?J[1]:null;return(!X||!Q)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[Y,X,Q]}})}function M(){return u(r.hslaColor,function(){var F=D();j(r.comma);var Y=j(r.percentageValue),J=Y?Y[1]:null;j(r.comma),Y=j(r.percentageValue);var X=Y?Y[1]:null;j(r.comma);var Q=D();return(!J||!X)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[F,J,X,Q]}})}function q(){return j(r.variableName)[1]}function D(){return j(r.number)[1]}function te(){return V("%",r.percentageValue,1)||H()||B()||$()}function H(){return V("position-keyword",r.positionKeywords,1)}function B(){return u(r.calcValue,function(){for(var F=1,Y=0;F>0&&Y<t.length;){var J=t.charAt(Y);J==="("?F++:J===")"&&F--,Y++}F>0&&n("Missing closing parenthesis in calc() expression");var X=t.substring(0,Y-1);return z(Y-1),{type:"calc",value:X}})}function $(){return V("px",r.pixelValue,1)||V("em",r.emValue,1)}function V(F,Y,J){var X=j(Y);if(X)return{type:F,value:X[J]}}function j(F){var Y,J;return J=/^[\n\r\t\s]+/.exec(t),J&&z(J[0].length),Y=F.exec(t),Y&&z(Y[0].length),Y}function z(F){t=t.substr(F)}return function(F){return t=F.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),a()}}(),l1.parse=e.parse,l1.stringify=e.stringify,l1}var hb;function pm(){return hb||(hb=1,function(e){var r=qd&&qd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=r(yP());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const n=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const i=t.default.parse(a)[0];return{rotation:parseFloat(i.orientation.value),stops:i.colorStops.map((o,s)=>({color:n(o),offset:o.length?parseFloat(o.length.value)/100:s/(i.colorStops.length-1)}))}}}(qd)),qd}var db;function Op(){return db||(db=1,function(e){var r,t=jl&&jl.__createBinding||(Object.create?function(c,h,v,g){g===void 0&&(g=v);var f=Object.getOwnPropertyDescriptor(h,v);f&&!("get"in f?!h.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return h[v]}}),Object.defineProperty(c,g,f)}:function(c,h,v,g){g===void 0&&(g=v),c[g]=h[v]}),n=jl&&jl.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),a=jl&&jl.__importStar||(r=function(c){return r=Object.getOwnPropertyNames||function(h){var v=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(v[v.length]=g);return v},r(c)},function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var v=r(c),g=0;g<v.length;g++)v[g]!=="default"&&t(h,c,v[g]);return n(h,c),h}),i=jl&&jl.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const o=i(ai()),s=a(pm()),u=i(Hs());e.useColor=(c,h=c.fill,v="fill")=>o.default.useMemo(()=>{if(!s.isGradient(h))return{[v]:h};const{stops:g,rotation:f}=s.parseColor(h),E=c.a.width/2,S=c.a.height/2,w=(f%180+180)%180,_=w>45&&w<135?c.a.width:c.a.height,y=u.default.Util.degToRad(f)-Math.PI/2,p=[];return g.forEach(({offset:m,color:P})=>{p.push(m,P)}),v==="fill"?{fillLinearGradientStartPointX:E-_/2*Math.cos(y),fillLinearGradientStartPointY:S-_/2*Math.sin(y),fillLinearGradientColorStops:p,fillLinearGradientEndPointX:E+_/2*Math.cos(y),fillLinearGradientEndPointY:S+_/2*Math.sin(y),fill:g[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E-_/2*Math.cos(y),strokeLinearGradientStartPointY:S-_/2*Math.sin(y),strokeLinearGradientColorStops:p,strokeLinearGradientEndPointX:E+_/2*Math.cos(y),strokeLinearGradientEndPointY:S+_/2*Math.sin(y)}},[h,c.width,c.height])}(jl)),jl}var fg={},zd={},pb;function If(){return pb||(pb=1,function(e){var r=zd&&zd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(i,o){const s=t.default.useRef();t.default.useLayoutEffect(()=>{s.current&&s.current.destroy()},[o]),t.default.useLayoutEffect(()=>{if(!a)return;const u=i.current.opacity();return u?(i.current.opacity(0),s.current=new n.default.Tween({node:i.current,opacity:u,onFinish:()=>{var c;(c=s.current)===null||c===void 0||c.destroy()}}),s.current.play(),()=>{var c;(c=s.current)===null||c===void 0||c.destroy()}):void 0},[])};const t=r(ai()),n=r(Hs());let a=!1;e.toggleFadeInAnimation=(i=!a)=>{a=i},e.isAnimationUsed=()=>a}(zd)),zd}var gb;function jf(){return gb||(gb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(c){t+=1;let h=!1,v=!1;const g=setTimeout(()=>{h||(u(`Timeout loading asset ${c}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",c),h=!0,o())},a);return()=>{v?console.error("Finish called twice! That is not expected. id: ",c):(v=!0,h||(clearTimeout(g),o()))}},e.decrementLoader=o,e.whenLoaded=function(){return new Promise(c=>{return h=()=>{(0,r.isAnimationUsed)()?setTimeout(c,300):c(!0)},void(t===0?h():n.push(h));var h})},e.onLoadError=function(c){s.push(c)},e.triggerLoadError=u;const r=If();let t=0,n=[],a=3e4;e.setAssetLoadTimeout=c=>{a=c},e.getAssetLoadTimeout=()=>a;let i=6e3;function o(){t-=1,t===0&&(n.forEach(c=>c()),n=[])}e.setFontLoadTimeout=c=>{i=c},e.getFontLoadTimeout=()=>i;let s=[];function u(c){s.forEach(h=>h(c))}}(fg)),fg}var rc={},vb;function Ih(){return vb||(vb=1,function(e){var r,t=rc&&rc.__createBinding||(Object.create?function(y,p,m,P){P===void 0&&(P=m);var T=Object.getOwnPropertyDescriptor(p,m);T&&!("get"in T?!p.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return p[m]}}),Object.defineProperty(y,P,T)}:function(y,p,m,P){P===void 0&&(P=m),y[P]=p[m]}),n=rc&&rc.__setModuleDefault||(Object.create?function(y,p){Object.defineProperty(y,"default",{enumerable:!0,value:p})}:function(y,p){y.default=p}),a=rc&&rc.__importStar||(r=function(y){return r=Object.getOwnPropertyNames||function(p){var m=[];for(var P in p)Object.prototype.hasOwnProperty.call(p,P)&&(m[m.length]=P);return m},r(y)},function(y){if(y&&y.__esModule)return y;var p={};if(y!=null)for(var m=r(y),P=0;P<m.length;P++)m[P]!=="default"&&t(p,y,m[P]);return n(p,y),p});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return u.value},e.setGoogleFonts=function(y){y!=="default"?(u.value=!0,s.splice(0,s.length),s.push(...y)):u.value=!1},e.getFontsList=function(){return s},e.addGlobalFont=function(y){e.globalFonts.push(y)},e.removeGlobalFont=function(y){const p=e.globalFonts.findIndex(m=>m.fontFamily===y);p!==-1&&e.globalFonts.splice(p,1)},e.replaceGlobalFonts=function(y){e.globalFonts.replace(y)},e.measureFontDom=function(y,p="Arial",m="normal",P="normal"){if(typeof document>"u"||!document.body)return 0;const T=document.createElement("span");T.textContent=c,T.style.cssText=`
|
|
77
|
+
position:absolute;
|
|
78
|
+
visibility:hidden;
|
|
79
|
+
white-space:nowrap;
|
|
80
|
+
top:-9999px;
|
|
81
|
+
left:-9999px;
|
|
82
|
+
font:${m} ${P} 90px '${y}', ${p};
|
|
83
|
+
`,document.body.appendChild(T);const k=T.getBoundingClientRect().width;return T.remove(),k},e.loadFont=async function(y,p,m){var P;if(g[y])return;const T=!!(!((P=document.fonts)===null||P===void 0)&&P.load),k=v("Arial","Arial",p,m);if(T)try{if(await document.fonts.load(`16px '${y}', ${p} ${m}`),k!==v(y,"Arial",p,m))return void(g[y]=!0)}catch{}const L=v("Times","Times",p,m),I=v(y,"Arial",p,m),R=Math.min(6e3,(0,o.getFontLoadTimeout)())/60;for(let A=0;A<R;A++){const O=v(y,"Arial",p,m),M=v(y,"Times",p,m);if(O!==I||O!==k||M!==L)return void(g[y]=!0);await new Promise(q=>setTimeout(q,60))}console.warn(`Timeout for loading font "${y}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.triggerLoadError)(`Timeout for loading font "${y}"`)},e.setGoogleFontsVariants=function(y){E=y},e.getGoogleFontsVariants=function(){return E},e.getGoogleFontsUrl=S,e.injectGoogleFont=function(y){if(f[y])return;const p=S(y),m=document.createElement("link");m.type="text/css",m.href=p,m.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(m),f[y]=!0},e.injectCustomFont=function(y){const p=y.fontFamily;if(w[p]||!y.url&&!y.styles)return;const m=y.styles||(y.url?[{src:`url("${y.url}")`}]:[]),P=(_||(_=document.getElementById("polotno-font-style"),_||(_=document.createElement("style"),_.id="polotno-font-style",document.head.appendChild(_)),_)).sheet;m.forEach(T=>{P.insertRule(`
|
|
84
|
+
@font-face{
|
|
85
|
+
font-family:'${p}';
|
|
86
|
+
src:${T.src};
|
|
87
|
+
font-style:${T.fontStyle||"normal"};
|
|
88
|
+
font-weight:${T.fontWeight||"normal"};
|
|
89
|
+
font-display:swap; /* optional but recommended */
|
|
90
|
+
}`,P.cssRules.length)}),w[y.fontFamily]=!0};const i=a(vs),o=jf();let s=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),u=i.observable({value:!1});e.globalFonts=i.observable([]);var c="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let h;function v(y,p="Arial",m="normal",P="normal"){h||(h=document.createElement("canvas"));var T=h.getContext("2d");return T.font=`${m} ${P} 40px '${y}', ${p}`,T.measureText(c).width}const g={Arial:!0};e.isFontLoaded=y=>!!g[y];const f={};let E="400,400italic,700,700italic";function S(y){return`https://fonts.googleapis.com/css?family=${y.replace(/ /g,"+")}:${E}`}const w={};let _}(rc)),rc}var nc={},mb;function gc(){return mb||(mb=1,function(e){var r,t=nc&&nc.__createBinding||(Object.create?function(o,s,u,c){c===void 0&&(c=u);var h=Object.getOwnPropertyDescriptor(s,u);h&&!("get"in h?!s.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(o,c,h)}:function(o,s,u,c){c===void 0&&(c=u),o[c]=s[u]}),n=nc&&nc.__setModuleDefault||(Object.create?function(o,s){Object.defineProperty(o,"default",{enumerable:!0,value:s})}:function(o,s){o.default=s}),a=nc&&nc.__importStar||(r=function(o){return r=Object.getOwnPropertyNames||function(s){var u=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(u[u.length]=c);return u},r(o)},function(o){if(o&&o.__esModule)return o;var s={};if(o!=null)for(var u=r(o),c=0;c<u.length;c++)u[c]!=="default"&&t(s,o,u[c]);return n(s,o),s});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=a(vs);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(o=>{e.flags.textVerticalResizeEnabled=o}),e.useRemoveBackground=i.action(o=>{e.flags.removeBackgroundEnabled=o}),e.useHtmlTextRender=i.action(o=>{e.flags.htmlRenderEnabled=o}),e.setDownScalingEnabled=i.action(o=>{e.flags.imageDownScalingEnabled=o}),e.useDownScaling=i.action(o=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(o)}),e.setForceTextFit=i.action(o=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(o=>{e.flags.textOverflow=o}),e.setTextSplitAllowed=i.action(o=>{e.flags.textSplitAllowed=o}),e.setAnimationsEnabled=i.action(o=>{e.flags.animationsEnabled=o})}(nc)),nc}var hg={},yb;function r0(){return yb||(yb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=function(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(t,n,a)=>(a.slice(n+t.length).match(/<\/p>/gi)||[]).length>0?`
|
|
91
|
+
`:t)),r.replace(/(<([^>]+)>)/gi,"")},e.sanitizeHtml=function(r){return r?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(r)?(r=r.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):r.replace(/</g,"<").replace(/>/g,">"):""}}(hg)),hg}var Ud={},bb;function Ap(){return bb||(bb=1,function(e){var r=Ud&&Ud.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,i){var o;const s={filters:[]},u={};i.brightnessEnabled&&(s.filters.push(t.default.Filters.Brighten),s.brightness=i.brightness),i.blurEnabled&&(s.filters.push(t.default.Filters.Blur),s.blurRadius=i.blurRadius,i.type==="text"&&i.lineHeight<1&&(u.offset=i.fontSize)),i.sepiaEnabled&&s.filters.push(t.default.Filters.Sepia),i.grayscaleEnabled&&s.filters.push(t.default.Filters.Grayscale),i.filters.forEach((c,h)=>{const v=n[h];v&&s.filters.push(v(c.intensity))}),a.setAttrs(s),s.filters.length?a.cache(Object.assign(Object.assign({},u),{pixelRatio:i.store._elementsPixelRatio})):a.clearCache(),(o=a.getLayer())===null||o===void 0||o.batchDraw()};const t=r(Hs()),n={warm:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]+30*a,255),o[s+1]=Math.min(o[s+1]+15*a,255);return i},cold:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]-15*a,255),o[s+1]=Math.min(o[s+1]-10*a,255),o[s+2]=Math.min(o[s+2]+15*a,255);return i},natural:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4){o[s]=Math.min(o[s]*(1+.1*a),255),o[s+1]=Math.min(o[s+1]*(1+.1*a),255),o[s+2]=Math.min(o[s+2]*(1+.1*a),255);const u=(o[s]+o[s+1]+o[s+2])/3;o[s]=Math.min((o[s]-u)*(1+.2*a)+u,255),o[s+1]=Math.min((o[s+1]-u)*(1+.2*a)+u,255),o[s+2]=Math.min((o[s+2]-u)*(1+.2*a)+u,255)}return i},temperature:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=(o[s+1],o[s+2]);o[s]=Math.min(Math.max(u+15*a,0),255),o[s+2]=Math.min(Math.max(c-15*a,0),255)}return i},contrast:a=>i=>{const o=i.data,s=100*(a=Math.max(-1,Math.min(1,a))),u=259*(s+255)/(255*(259-s));for(let c=0;c<o.length;c+=4)o[c]=Math.min(Math.max(u*(o[c]-128)+128,0),255),o[c+1]=Math.min(Math.max(u*(o[c+1]-128)+128,0),255),o[c+2]=Math.min(Math.max(u*(o[c+2]-128)+128,0),255);return i},shadows:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=(o[s]+o[s+1]+o[s+2])/3;if(u<128){const c=1+a*(1-u/128)*2;o[s]=Math.min(Math.max(o[s]*c,0),255),o[s+1]=Math.min(Math.max(o[s+1]*c,0),255),o[s+2]=Math.min(Math.max(o[s+2]*c,0),255)}}return i},white:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],v=(u+c+h)/3;if(v>128){const g=1+a*((v-128)/127);o[s]=Math.min(Math.max(u*g,0),255),o[s+1]=Math.min(Math.max(c*g,0),255),o[s+2]=Math.min(Math.max(h*g,0),255)}}return i},black:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],v=(u+c+h)/3;if(v<128){const g=1+a*((128-v)/128);o[s]=Math.min(Math.max(u*g,0),255),o[s+1]=Math.min(Math.max(c*g,0),255),o[s+2]=Math.min(Math.max(h*g,0),255)}}return i},vibrance:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],v=Math.max(u,c,h),g=a<0?(1-(v===0?0:(v-(u+c+h)/3)/v))*a*1.5:.5*a;o[s]=Math.min(Math.max(u-(v-u)*g,0),255),o[s+1]=Math.min(Math.max(c-(v-c)*g,0),255),o[s+2]=Math.min(Math.max(h-(v-h)*g,0),255)}return i},saturation:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],v=.2126*u+.7152*c+.0722*h;o[s]=Math.min(Math.max(v+(u-v)*(1+a),0),255),o[s+1]=Math.min(Math.max(v+(c-v)*(1+a),0),255),o[s+2]=Math.min(Math.max(v+(h-v)*(1+a),0),255)}return i}}}(Ud)),Ud}var Hd={},wb;function rf(){return wb||(wb=1,function(e){var r=Hd&&Hd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=r(ai());e.MOBILE_BREAKPOINT=800,e.isMobile=()=>window.innerWidth<=e.MOBILE_BREAKPOINT,e.mobileStyle=n=>`
|
|
92
|
+
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
93
|
+
${n}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.polotno-mobile & {
|
|
97
|
+
${n}
|
|
98
|
+
}
|
|
99
|
+
`,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[n,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const i=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),n}}(Hd)),Hd}var _b={},W6="warn";function $6(e){W6=e}function Y6(){return W6}function bP(e){$6(e)}var wa;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(wa||(wa={}));var O2=function(e,r){return O2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},O2(e,r)};function Jn(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");O2(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var _a=function(){return _a=Object.assign||function(r){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},_a.apply(this,arguments)};function wP(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t}function X6(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(h){return u([c,h])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,a=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=r.call(e,t)}catch(h){c=[6,h],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function lp(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Iu(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),a,i=[],o;try{for(;(r===void 0||r-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i}function ju(e,r,t){if(arguments.length===2)for(var n=0,a=r.length,i;n<a;n++)(i||!(n in r))&&(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))}function Cp(e){return or(e).type}function _P(e,r){return or(e).getChildType(r)}function K6(e,r){return or(e).onPatch(r)}function SP(e,r){return or(e).onSnapshot(r)}function Ph(e,r){or(e).applyPatches(Sm(r))}function xP(e,r){var t={patches:[],inversePatches:[]},n={},a,i={get recording(){return!!a},get patches(){return n.patches||(n.patches=t.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=t.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=t.inversePatches.slice()),n.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=K6(e,function(o,s){r&&!r(o,s,ym())||(t.patches.push(o),t.inversePatches.push(s),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ph(o||e,t.patches)},undo:function(o){Ph(o||e,t.inversePatches.slice().reverse())}};return i.resume(),i}function EP(e){var r=or(e);if(!r.isRoot)throw new Qt("`protect` can only be invoked on root nodes");r.isProtectionEnabled=!0}function PP(e){var r=or(e);if(!r.isRoot)throw new Qt("`unprotect` can only be invoked on root nodes");r.isProtectionEnabled=!1}function OP(e){return or(e).isProtected}function Z6(e,r){return or(e).applySnapshot(r)}function gm(e,r){r===void 0&&(r=!0);var t=or(e);return r?t.snapshot:t.type.getSnapshot(t,!1)}function AP(e,r){r===void 0&&(r=1);for(var t=or(e).parent;t;){if(--r===0)return!0;t=t.parent}return!1}function CP(e,r){r===void 0&&(r=1);for(var t=r,n=or(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new Qt("Failed to find the parent of ".concat(or(e)," at depth ").concat(r))}function kP(e,r){for(var t=or(e).parent;t;){if(r.is(t.storedValue))return!0;t=t.parent}return!1}function LP(e,r){for(var t=or(e).parent;t;){if(r.is(t.storedValue))return t.storedValue;t=t.parent}throw new Qt("Failed to find the parent of ".concat(or(e)," of a given type"))}function Q6(e){return or(e).root.storedValue}function J6(e){return or(e).path}function NP(e){return Lh(or(e).path)}function TP(e){return or(e).isRoot}function RP(e,r){var t=m8(or(e),r);return t?t.value:void 0}function MP(e,r,t){var n=or(r).root.identifierCache.resolve(e,jh(t));return n?.value}function e8(e){return or(e).identifier}function IP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return;if(Ln(t))return r?vm(t)?t:void 0:t;throw new Qt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return;throw n}}function jP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return!1;if(Ln(t))return r?vm(t):!0;throw new Qt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return!1;throw n}}function t8(e,r){var t=m8(or(e),r,!1);if(t!==void 0)try{return t.value}catch{return}}function FP(e,r){return v8(or(e),or(r))}function DP(e,r){r===void 0&&(r=!0);var t=or(e);return t.type.create(t.snapshot,r===!0?t.root.environment:r===!1?void 0:r)}function BP(e){return or(e).detach(),e}function qP(e){var r=or(e);r.isRoot?r.die():r.parent.removeChild(r.subpath)}function vm(e){return or(e).observableIsAlive}function zP(e,r){var t=or(e);return t.addDisposer(r),r}function UP(e){var r=or(e),t=r.root.environment;if(!t)throw new Qt("Failed to find the environment of ".concat(r," ").concat(r.path));return t}function HP(e){var r=or(e),t=r.root.environment;return!!t}function r8(e,r){var t=or(e);t.getChildren().forEach(function(n){Ln(n.storedValue)&&r8(n.storedValue,r)}),r(t.storedValue)}function n8(e){var r;return Ln(e)?r=Cp(e):r=e,{name:r.name,properties:_a({},r.properties)}}function VP(e){var r=or(e).type,t=_a(_a({},n8(r)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(a){if(!(a in t.properties)){var i=Object.getOwnPropertyDescriptor(e,a);if(i.get){s6(e,a)?t.views.push(a):t.volatile.push(a);return}i.value._isFlowAction===!0&&t.flowActions.push(a),i.value._isMSTAction===!0?t.actions.push(a):u6(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function GP(e){return e}function WP(e){return e}function $P(e){return e}function YP(e){return or(e).nodeId}var i8=function(){function e(r,t,n,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:io.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=a,this.baseSetParent(t,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(r){var t=this.isAlive;this._state=r;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._hookSubscribers&&this._hookSubscribers.emit(r,this,r)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return this._hookSubscribers||(this._hookSubscribers=new S8),this._hookSubscribers.register(r,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){this._parent=r,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.pathAtom||(this.pathAtom=fp("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Wc(this._subpath):""),this.parent.getEscapedPath(r)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==io.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===io.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=fp("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.state===io.CREATED){if(this.parent){if(this.parent.state!==io.FINALIZED)return;this.fireHook(wa.afterAttach)}this.state=io.FINALIZED,r&&r()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=io.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(wa.beforeDestroy)}}),e}(),pp=function(e){Jn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;try{s.storedValue=t.createNewInstance(o)}catch(u){throw s.state=io.DEAD,u}return s.state=io.CREATED,s.finalizeCreation(),s}return Object.defineProperty(r.prototype,"root",{get:function(){if(!this.parent)throw new Qt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.parent!==t,i=this.subpath!==n;!a&&!i||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===io.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),r}(i8);pp.prototype.die=ca(pp.prototype.die);var XP=1,Vl;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Vl||(Vl={}));var js;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(js||(js={}));var KP={onError:function(e){throw e}},ms=function(e){Jn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++XP}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Vl.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=Tf(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=t.identifierAttribute,n||(s.identifierCache=new vO),s._childNodes=t.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var c=s._childNodes[s.identifierAttribute];c&&(u=c.value)}if(typeof u!="string"&&typeof u!="number")throw new Qt("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=jh(u),s.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(r.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(r.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===Vl.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(r.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n,a,i,o;t===void 0&&(t=!0),this._observableInstanceState=Vl.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===Vl.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var c=lp(s),h=c.next();!h.done;h=c.next()){var v=h.value;v.createObservableInstanceIfNeeded(!1)}}catch(S){n={error:S}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}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(S){throw this.state=io.DEAD,S}finally{this._isRunningAction=!1}if(this._observableInstanceState=Vl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ch,this.state=io.CREATED,t){this.fireHook(wa.afterCreate),this.finalizeCreation();try{for(var f=lp(s.reverse()),E=f.next();!E.done;E=f.next()){var v=E.value;v.fireHook(wa.afterCreate),v.finalizeCreation()}}catch(S){i={error:S}}finally{try{E&&!E.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}}}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(wa.beforeDetach);var t=this.state;this.state=io.DETACHING;var n=this.root,a=n.environment,i=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=i}finally{this.state=t}}}}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t!==this.parent,i=n!==this.subpath;!a&&!i||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,n),this.fireHook(wa.afterAttach)):i&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(Sh?Sh(function(){a.apply(n.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Vl.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(r.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,n=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(n,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(r.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(r.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=Y6();if(!this.isAlive&&n!=="ignore"){var a=this._getAssertAliveError(t);switch(n){case"error":throw new Qt(a);case"warn":kO(a)}}}}),Object.defineProperty(r.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Wc(t.subpath)||"",i=t.actionContext||mm();i&&i.type!=="action"&&i.parentActionEvent&&(i=i.parentActionEvent);var o="";if(i&&i.name!=null){var s=i&&i.context&&J6(i.context)||n;o="".concat(s,".").concat(i.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(a,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===Vl.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Ch),this._autoUnbox=!1;try{return this._observableInstanceState===Vl.CREATED?this.type.getChildren(this):b8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new Qt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(r.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var n,a;try{for(var i=lp(t.getChildren()),o=i.next();!o.done;o=i.next()){var s=o.value;s.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}t.fireInternalHook(wa.afterCreationFinalization)})}}),Object.defineProperty(r.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Qt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(r.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=gp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var i=Lh(a.path),o=y8(t,i.slice(0,-1));o.applyPatchLocally(i[i.length-1],a)})}),this._applySnapshot=gp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==t.snapshot)return t.type.applySnapshot(t,n)}),Ef(this.storedValue,"$treenode",this),Ef(this.storedValue,"toJSON",yO)}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===io.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Vl.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(js.Dispose),this._internalEventsClear(js.Dispose))}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(js.Patch,t)}}),Object.defineProperty(r.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(js.Patch)){var a=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),i=OO({},t,{path:a}),o=Iu(IO(i),2),s=o[0],u=o[1];this._internalEventsEmit(js.Patch,s,u)}this.parent&&this.parent.emitPatch(t,n)}}),Object.defineProperty(r.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(js.Dispose,t)}}),Object.defineProperty(r.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(js.Dispose,t,!0);return}throw new Qt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(r.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(js.Dispose,t))throw new Qt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(js.Dispose,t)}}),Object.defineProperty(r.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var n=this.middlewares.indexOf(t);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(r.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={handler:t,includeHooks:n};return this.middlewares?this.middlewares.push(i):this.middlewares=[i],function(){a.removeMiddleware(i)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,n)}}),Object.defineProperty(r.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var n=Jw(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},KP);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(r.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(r.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new S8),this._internalEvents.register(t,n,a)}}),Object.defineProperty(r.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!!this._internalEvents&&this._internalEvents.has(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._internalEvents&&this._internalEvents.unregister(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,a=[],i=1;i<arguments.length;i++)a[i-1]=arguments[i];this._internalEvents&&(n=this._internalEvents).emit.apply(n,ju([t],Iu(a),!1))}}),Object.defineProperty(r.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(r.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),r}(i8);ms.prototype.createObservableInstance=ca(ms.prototype.createObservableInstance);ms.prototype.detach=ca(ms.prototype.detach);ms.prototype.die=ca(ms.prototype.die);var a8,Lr;(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"})(Lr||(Lr={}));var o8="cannotDetermine",ZP=Symbol("$type"),pc=function(){function e(r){Object.defineProperty(this,a8,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return hc(this,r),this.instantiate(null,"",t,r).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){throw new Qt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=g8(r);if(n){var a=Cp(r);return this.isAssignableFrom(a)?ys():bs(t,r)}return this.isValidSnapshot(r,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.validate(r,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Qt("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 Qt("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 Qt("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 Qt("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}();a8=ZP;pc.prototype.create=ca(pc.prototype.create);var Oh=function(e){Jn(r,e);function r(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(r.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!t.identifierAttribute||t.identifier===jh(n[t.identifierAttribute])}}),Object.defineProperty(r.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t.isDetaching?!1:t.snapshot===n||Ln(n)&&or(n)===t?!0:t.type===this&&w8(n)&&!Ln(n)&&this.isMatchingSnapshotId(t,n)?(t.applySnapshot(n),!0):!1}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.tryToReconcileNode(t,n);if(o)return t.setParent(a,i),t;if(t.die(),Ln(n)&&this.isAssignableFrom(Cp(n))){var s=or(n);return s.setParent(a,i),s}return this.instantiate(a,i,void 0,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);Oh.prototype.create=ca(Oh.prototype.create);var Ff=function(e){Jn(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this&&t.storedValue===n)return t;var o=this.instantiate(a,i,void 0,n);return t.die(),o}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);function Sa(e){return typeof e=="object"&&e&&e.isType===!0}var Ou=new Map;function QP(e){return function(t,n,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var i=e.onStart(t);e.onResume(t,i),Ou.set(t.id,{call:t,context:i,async:!1});try{var o=n(t);return e.onSuspend(t,i),Ou.get(t.id).async===!1&&(Ou.delete(t.id),e.onSuccess(t,i,o)),o}catch(u){throw Ou.delete(t.id),e.onFail(t,i,u),u}}else return n(t);case"flow_spawn":{var s=Ou.get(t.rootId);return s.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var s=Ou.get(t.rootId);e.onResume(t,s.context);try{return n(t)}finally{e.onSuspend(t,s.context)}}case"flow_throw":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onFail(t,s.context,t.args[0]),n(t)}case"flow_return":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onSuccess(t,s.context,t.args[0]),n(t)}}}}var JP=function(){function e(r,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),r&&r.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,r))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function eO(e){var r=new Map;return function(n,a){var i=n.parentActionEvent?r.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=_a(_a({},n),{env:i&&i.call.env,parentCall:i&&i.call}),s=!e.filter||e.filter(o),u=s?e:void 0,c=new JP(u,o);r.set(n.id,c);var h=void 0;try{h=a(n)}catch(g){throw r.delete(n.id),c.finish(g),g}return c.hasFlowsPending||(r.delete(n.id),c.finish()),h}else{if(!i)return a(n);switch(n.type){case"flow_spawn":return i.incFlowsPending(),a(n);case"flow_resume":case"flow_resume_error":return a(n);case"flow_throw":{var v=n.args[0];try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish(v))}}case"flow_return":try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish())}}}}}function tO(e,r,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(kh(n))return n;if(Ln(n))return u1("[MSTNode: ".concat(Cp(n).name,"]"));if(typeof n=="function")return u1("[function]");if(typeof n=="object"&&!xf(n)&&!_m(n))return u1("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(a){return u1(""+a)}}function rO(e,r){return r&&typeof r=="object"&&"$MST_DATE"in r?new Date(r.$MST_DATE):r}function u1(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function s8(e,r){Sh(function(){Sm(r).forEach(function(t){return nO(e,t)})})}function nO(e,r){var t=t8(e,r.path||"");if(!t)throw new Qt("Invalid action path: ".concat(r.path||""));var n=or(t);if(r.name==="@APPLY_PATCHES")return Ph.call(null,t,r.args[0]);if(r.name==="@APPLY_SNAPSHOT")return Z6.call(null,t,r.args[0]);if(typeof t[r.name]!="function")throw new Qt("Action '".concat(r.name,"' does not exist in '").concat(n.path,"'"));return t[r.name].apply(t,r.args?r.args.map(function(a){return rO(n,a)}):[])}function iO(e,r){var t=[],n=function(o){var s=r?r(o,ym()):!0;s&&t.push(o)},a,i={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=l8(e,n))},replay:function(o){s8(o,t)}};return i.resume(),i}function l8(e,r,t){return t===void 0&&(t=!1),f8(e,function(a,i){if(a.type==="action"&&a.id===a.rootId){var o=or(a.context),s={name:a.name,path:v8(or(e),o),args:a.args.map(function(c,h){return tO(o,a.name,h,c)})};if(t){var u=i(a);return r(s),u}else return r(s),i(a)}else return i(a)})}var aO=1,up;function mm(){return up}function u8(){return aO++}function A2(e,r){var t=or(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var a=up;up=e;try{return lO(t,e,r)}finally{up=a,t._isRunningAction=n}}function c8(e){if(e)return e.type==="action"?e:e.parentActionEvent}function gp(e,r,t){var n=function(){var a=u8(),i=up,o=c8(i);return A2({type:"action",name:r,id:a,args:x8(arguments),context:e,tree:Q6(e),rootId:i?i.rootId:a,parentId:i?i.id:0,allParentIds:i?ju(ju([],Iu(i.allParentIds),!1),[i.id],!1):[],parentEvent:i,parentActionEvent:o},t)};return n._isMSTAction=!0,n._isFlowAction=t._isFlowAction,n}function f8(e,r,t){t===void 0&&(t=!0);var n=or(e);return n.addMiddleWare(r,t)}function oO(e,r,t){t===void 0&&(t=!0);var n={handler:e,includeHooks:t};return r.$mst_middleware=r.$mst_middleware||[],r.$mst_middleware.push(n),r}var sO=function(){function e(r,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=r;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.middlewares[this.arrayIndex];if(r){var t=r[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function lO(e,r,t){var n=new sO(e,t);if(n.isEmpty)return ca(t).apply(null,r.args);var a=null;function i(o){var s=n.getNextMiddleware(),u=s&&s.handler;if(!u)return ca(t).apply(null,o.args);if(!s.includeHooks&&wa[o.name])return i(o);function c(v,g){a=i(v),g&&(a=g(a))}function h(v){a=v}return u(o,c,h),a}return i(r)}function ym(){for(var e=mm();e&&e.type!=="action";)e=e.parentActionEvent;return e}function h8(e,r,t){for(var n=typeof r=="number"?r:r.id,a=t?e:e.parentActionEvent;a;){if(a.id===n)return!0;a=a.parentActionEvent}return!1}function uO(e,r){return h8(e,r,!1)}function cO(e,r){return h8(e,r,!0)}function fO(e){try{return JSON.stringify(e)}catch(r){return"<Unserializable: ".concat(r,">")}}function d8(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Ln(e)?"<".concat(e,">"):"`".concat(fO(e),"`")}function hO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function dO(e){var r=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),a=n.length>0?'at path "/'.concat(n,'" '):"",i=Ln(r)?"value of type ".concat(or(r).type.name,":"):kh(r)?"value":"snapshot",o=t&&Ln(r)&&t.is(or(r).snapshot);return"".concat(a).concat(i," ").concat(d8(r)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?I8(t)||kh(r)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function bm(e,r,t){return e.concat([{path:r,type:t}])}function ys(){return Ah}function bs(e,r,t){return[{context:e,value:r,message:t}]}function n0(e){return e.reduce(function(r,t){return r.concat(t)},[])}function hc(e,r){LO()&&p8(e,r)}function p8(e,r){var t=e.validate(r,[{path:"",type:e}]);if(t.length>0)throw new Qt(pO(e,r,t))}function pO(e,r,t){if(t.length!==0)return"Error while converting ".concat(hO(d8(r))," to `").concat(e.name,`\`:
|
|
100
|
+
|
|
101
|
+
`)+t.map(dO).join(`
|
|
102
|
+
`)}var gO=0,vO=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:gO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:jn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:jn.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r);this.lastCacheModificationPerId.set(r,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){if(t===void 0&&(t=!0),r.identifierAttribute){var n=r.identifier;this.cache.has(n)||this.cache.set(n,jn.array([],i0));var a=this.cache.get(n);if(a.indexOf(r)!==-1)throw new Qt("Already registered");a.push(r),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this;Z2(r.identifierCache.cache).forEach(function(n){return n.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.identifierAttribute){var t=r.identifier,n=this.cache.get(t);n&&(n.remove(r),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(r.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this,n=new e,a=r.path+"/";return c6(this.cache).forEach(function(i){for(var o=Iu(i,2),s=o[0],u=o[1],c=!1,h=u.length-1;h>=0;h--){var v=u[h];(v===r||v.path.indexOf(a)===0)&&(n.addNodeToCache(v,!1),u.splice(h,1),u.length||t.cache.delete(s),c=!0)}c&&t.updateLastCacheModificationPerId(s)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);return n?n.some(function(a){return r.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);if(!n)return null;var a=n.filter(function(i){return r.isAssignableFrom(i.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new Qt("Cannot resolve a reference to type '".concat(r.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(i){return i.path}).join(", ")))}}}),e}();function wm(e,r,t,n,a){var i=g8(a);if(i){if(i.parent)throw new Qt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(r?r.path:"","/").concat(t,"', but it lives already at '").concat(i.path,"'"));return r&&i.setParent(r,t),i}return new ms(e,r,t,n,a)}function nf(e,r,t,n,a){return new pp(e,r,t,n,a)}function mO(e){return e instanceof pp||e instanceof ms}var io;(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"})(io||(io={}));function Ln(e){return!!(e&&e.$treenode)}function or(e){if(!Ln(e))throw new Qt("Value ".concat(e," is no MST Node"));return e.$treenode}function g8(e){return e&&e.$treenode||null}function yO(){return or(this).snapshot}var bO=function(e){return".."};function v8(e,r){if(e.root!==r.root)throw new Qt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(r,"' are not part of the same object tree"));for(var t=Lh(e.path),n=Lh(r.path),a=0;a<t.length&&t[a]===n[a];a++);return t.slice(a).map(bO).join("/")+I1(n.slice(a))}function m8(e,r,t){return t===void 0&&(t=!0),y8(e,Lh(r),t)}function y8(e,r,t){t===void 0&&(t=!0);var n=e;try{for(var a=0;a<r.length;a++){var i=r[a];if(i===".."){if(n=n.parent,n)continue}else{if(i===".")continue;if(n){if(n instanceof pp){var o=n.value;Ln(o)&&(n=or(o))}if(n instanceof ms){var s=n.getChildType(i);if(s&&(n=n.getChildNode(i),n))continue}}}throw new Qt("Could not resolve '".concat(i,"' in path '").concat(I1(r.slice(0,a))||"/","' while resolving '").concat(I1(r),"'"))}}catch(u){if(!t)return;throw u}return n}function b8(e){if(!e)return Ah;var r=Object.keys(e);if(!r.length)return Ah;var t=new Array(r.length);return r.forEach(function(n,a){t[a]=e[n]}),t}function wO(e){return E8(e)}var _O=Object.toString(),Ah=Object.freeze([]),Ch=Object.freeze({}),i0=zw().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(i0);var Qt=function(e){Jn(r,e);function r(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return r}(Error);function SO(e){return e}var xO=Number.isInteger;function EO(e){return Number(e)===e&&e%1!==0}function PO(e){return Number.isFinite(e)}function _m(e){return Array.isArray(e)||Vo(e)}function Sm(e){return e?_m(e)?e:[e]:Ah}function OO(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=0;n<r.length;n++){var a=r[n];for(var i in a)e[i]=a[i]}return e}function xf(e){var r;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((r=t.constructor)===null||r===void 0?void 0:r.toString())===_O}function w8(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function kh(e,r){return r===void 0&&(r=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||r&&e instanceof Date}function _8(e){return typeof e!="function"}function AO(e,r,t){Ra(e)?J2(e,r,t):Object.defineProperty(e,r,t)}function Ef(e,r,t){AO(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}var CO=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(r):this.handlers.push(r),function(){n.unregister(r)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.handlers.indexOf(r)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.handlers.indexOf(r);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=this.handlers.slice();n.forEach(function(a){return a.apply(void 0,ju([],Iu(r),!1))})}}),e}(),S8=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.eventHandlers&&this.eventHandlers[r];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[r];return a||(a=this.eventHandlers[r]=new CO),a.register(t,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.eventHandlers&&delete this.eventHandlers[r]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var t,n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var i=this.eventHandlers&&this.eventHandlers[r];i&&(t=i).emit.apply(t,ju([],Iu(n),!1))}}),e}();function x8(e){for(var r=new Array(e.length),t=0;t<e.length;t++)r[t]=e[t];return r}function dg(e,r){return e.indexOf(r)===0}function kO(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function LO(){return typeof process<"u"&&_b&&_b.ENABLE_TYPE_CHECK==="true"}function pg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function E8(e){return MO(e.name,e)}function NO(e){return e}function TO(e){return function(){var r,t=[];for(r=0;r<arguments.length;r++)t[r]=arguments[r];return X6(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,ju([],Iu(t),!1))];case 1:return[2,n.sent()]}})}}function RO(e){return X6(this,function(r){switch(r.label){case 0:return[4,e];case 1:return[2,r.sent()]}})}function MO(e,r){var t=function(){var a=u8(),i=mm();if(!i)throw new Qt("a mst flow must always have a parent context");var o=c8(i);if(!o)throw new Qt("a mst flow must always have a parent action context");var s={name:e,id:a,tree:i.tree,context:i.context,parentId:i.id,allParentIds:ju(ju([],Iu(i.allParentIds),!1),[i.id],!1),rootId:i.rootId,parentEvent:i,parentActionEvent:o},u=arguments;function c(h,v,g){return h.$mst_middleware=t.$mst_middleware,A2(_a(_a({},s),{type:v,args:[g]}),h)}return new Promise(function(h,v){var g,f=function(){g=r.apply(null,arguments),E(void 0)};f.$mst_middleware=t.$mst_middleware,A2(_a(_a({},s),{type:"flow_spawn",args:x8(u)}),f);function E(_){var y;try{var p=c(function(m){y=g.next(m)},"flow_resume",_);p instanceof Error&&(y=g.throw(p))}catch(m){pg(function(){c(function(P){v(m)},"flow_throw",m)});return}w(y)}function S(_){var y;try{c(function(p){y=g.throw(p)},"flow_resume_error",_)}catch(p){pg(function(){c(function(m){v(p)},"flow_throw",p)});return}w(y)}function w(_){if(_.done){pg(function(){c(function(y){h(y)},"flow_return",_.value)});return}if(!_.value||typeof _.value.then!="function")throw new Qt("Only promises can be yielded to `async`, got: "+_);return _.value.then(E,S)}})};return t._isFlowAction=!0,t}function IO(e){if(!("oldValue"in e))throw new Qt("Patches without `oldValue` field cannot be inversed");return[jO(e),FO(e)]}function jO(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 FO(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 DO(e){return typeof e=="number"}function Wc(e){return DO(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function P8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function I1(e){if(e.length===0)return"";var r=function(t){return t.map(Wc).join("/")};return e[0]==="."||e[0]===".."?r(e):"/"+r(e)}function Lh(e){var r=e.split("/").map(P8),t=e===""||e==="."||e===".."||dg(e,"/")||dg(e,"./")||dg(e,"../");if(!t)throw new Qt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return r[0]===""&&r.shift(),r}var gg=Symbol("$preProcessorFailed"),BO=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,a||t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(r.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(r.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return gg}}}),Object.defineProperty(r.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,n.storedValue):t}}),Object.defineProperty(r.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;qO(t.type,this,"create"),t instanceof ms&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(a.call(t),t)},F8(this._subtype)||(t.getReconciliationType=function(){return n})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?i:this.preProcessSnapshot(i),s=this._subtype.instantiate(t,n,a,o);return this._fixNode(s),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this._subtype.reconcile(t,Ln(n)?n:this.preProcessSnapshot(n),a,i);return o!==t&&this._fixNode(o),o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=!0);var a=this._subtype.getSnapshot(t);return n?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.preProcessSnapshotSafe(t);return a===gg?bs(n,t,"Failed to preprocess value"):this._subtype.validate(a,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(r.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=Sa(t)?this._subtype:Ln(t)?gm(t,!1):this.preProcessSnapshotSafe(t);return n===gg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!(this._subtype instanceof Oh))return!1;var a=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,a)}}),r}(pc);function qO(e,r){for(var t,n,a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];try{for(var o=lp(a),s=o.next();!s.done;s=o.next()){var u=s.value;e[u]=r[u].bind(r)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}function zO(e,r,t){return new BO(e,r,t)}var Sb="Map.put can only be used to store complex values that have an identifier type attribute";function O8(e,r){var t,n,a=e.getSubTypes();if(a===o8)return!1;if(a){var i=Sm(a);try{for(var o=lp(i),s=o.next();!s.done;s=o.next()){var u=s.value;if(!O8(u,r))return!1}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}return e instanceof vp&&r.push(e),!0}var Uc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Uc||(Uc={}));var UO=function(e){Jn(r,e);function r(t,n){return e.call(this,t,jn.ref.enhancer,n)||this}return Object.defineProperty(r.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(r.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(r.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(r.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,""+t,n)}}),Object.defineProperty(r.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new Qt("Map.put cannot be used to set empty values");if(Ln(t)){var n=or(t);if(n.identifier===null)throw new Qt(Sb);return this.set(n.identifier,t),t}else if(w8(t)){var a=or(this),i=a.type;if(i.identifierMode!==Uc.YES)throw new Qt(Sb);var o=i.mapIdentifierAttribute,s=t[o];if(!Em(s)){var u=this.put(i.getChildType().create(t,a.environment));return this.put(gm(u))}var c=jh(s);return this.set(c,t),this.get(c)}else throw new Qt("Map.put can only be used to store complex values")}}),r}(Z1),j1=function(e){Jn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Uc.UNKNOWN}),Object.defineProperty(i,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Map}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i._determineIdentifierMode(),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._determineIdentifierMode(),wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Uc.UNKNOWN){var t=[];if(O8(this._subType,t)){var n=t.reduce(function(a,i){if(!i.identifierAttribute)return a;if(a&&a!==i.identifierAttribute)throw new Qt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(i.name,"' declared attribute '").concat(i.identifierAttribute,"' as identifier"));return i.identifierAttribute},void 0);n?(this.identifierMode=Uc.YES,this.mapIdentifierAttribute=n):this.identifierMode=Uc.NO}}}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type._subType,i={};return Object.keys(n).forEach(function(o){i[o]=a.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new UO(t,this.name)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){K2(n,t.unbox);var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var u=o[s],c=gp(n,s,u);Ef(n,s,c)})}),Y1(n,this.willChange),K1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return Z2(t.storedValue)}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t.storedValue.get(""+n);if(!a)throw new Qt("Not a child "+n);return a}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object),a=t.name;n.assertWritable({subpath:a});var i=n.type,o=i._subType;switch(t.type){case"update":{var s=t.newValue,u=t.object.get(a);if(s===u)return null;hc(o,s),t.newValue=o.reconcile(n.getChildNode(a),t.newValue,n,a),i.processIdentifier(a,t.newValue)}break;case"add":hc(o,t.newValue),t.newValue=o.instantiate(n,a,void 0,t.newValue),i.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(r.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.identifierMode===Uc.YES&&n instanceof ms){var a=n.identifier;if(a!==t)throw new Qt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return t.getChildren().forEach(function(a){n[a.subpath]=a.snapshot}),n}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Wc(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Wc(t.name),value:t.newValue.snapshot,oldValue:void 0},n);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void n.emitPatch({op:"remove",path:Wc(t.name),oldValue:a},n)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue;switch(a.op){case"add":case"replace":i.set(n,a.value);break;case"remove":i.delete(n);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue,i={};if(Array.from(a.keys()).forEach(function(s){i[s]=!1}),n)for(var o in n)a.set(o,n[o]),i[""+o]=!0;Object.keys(i).forEach(function(s){i[s]===!1&&a.delete(s)})}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return xf(t)?n0(Object.keys(t).map(function(i){return a._subType.validate(t[i],bm(n,i,a._subType))})):bs(n,t,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),r}(Oh);j1.prototype.applySnapshot=ca(j1.prototype.applySnapshot);function HO(e){return new j1("Map<string, ".concat(e.name,">"),e)}function VO(e){return Sa(e)&&(e.flags&Lr.Map)>0}var F1=function(e){Jn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Array}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=[]);var a=t.type._subType,i={};return n.forEach(function(o,s){var u=""+s;i[u]=a.instantiate(t,u,void 0,o)}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=_a(_a({},i0),{name:this.name});return jn.array(b8(t),n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Zl(n).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var u=o[s],c=gp(n,s,u);Ef(n,s,c)})}),Y1(n,this.willChange),K1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=Number(n);if(a<t.storedValue.length)return t.storedValue[a];throw new Qt("Not a child: "+n)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);n.assertWritable({subpath:""+t.index});var a=n.type._subType,i=n.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var o=xb(n,a,[i[t.index]],[t.newValue],[t.index]);if(!o)return null;t.newValue=o[0]}break;case"splice":{var s=t.index,u=t.removedCount,c=t.added,h=xb(n,a,i.slice(s,s+u),c,c.map(function(g,f){return s+f}));if(!h)return null;t.added=h;for(var v=s+u;v<i.length;v++)i[v].setParent(n,""+(v+c.length-u))}break}return t}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=[];return Object.keys(t).forEach(function(a){n.push(t[a].getSnapshot())}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:t.removed.map(function(i){return i.snapshot})},n);for(var a=t.removedCount-1;a>=0;a--)n.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},n);for(var a=0;a<t.addedCount;a++)n.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue,o=n==="-"?i.length:Number(n);switch(a.op){case"replace":i[o]=a.value;break;case"add":i.splice(o,0,a.value);break;case"remove":i.splice(o,1);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue;a.replace(n)}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return _m(t)?n0(t.map(function(i,o){return a._subType.validate(i,bm(n,""+o,a._subType))})):bs(n,t,"Value is not an array")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ah}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.splice(Number(n),1)}}),r}(Oh);F1.prototype.applySnapshot=ca(F1.prototype.applySnapshot);function GO(e){return new F1("".concat(e.name,"[]"),e)}function xb(e,r,t,n,a){for(var i=!0,o=0;;o++){var s=o<=n.length-1,u=t[o],c=s?n[o]:void 0,h=""+a[o];if(mO(c)&&(c=c.storedValue),!u&&!s)break;if(!s)i=!1,t.splice(o,1),u instanceof ms&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(Eb(u,c))t[o]=vg(r,e,h,c,u);else{for(var g=void 0,f=o;f<t.length;f++)if(Eb(t[f],c)){g=t.splice(f,1)[0];break}i=!1;var v=vg(r,e,h,c,g);t.splice(o,0,v)}else{if(Ln(c)&&or(c).parent===e)throw new Qt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(or(c).path,"'"));i=!1;var v=vg(r,e,h,c);t.splice(o,0,v)}}return i?null:t}function vg(e,r,t,n,a){hc(e,n);function i(){if(Ln(n)){var s=or(n);if(s.assertAlive(Ch),s.parent!==null&&s.parent===r)return s.setParent(r,t),s}return a?e.reconcile(a,n,r,t):e.instantiate(r,t,void 0,n)}var o=i();return a&&a!==o&&(a instanceof ms&&a.createObservableInstanceIfNeeded(),a.die()),o}function Eb(e,r){if(!e.isAlive)return!1;if(Ln(r)){var t=or(r);return t.isAlive&&t===e}if(e.snapshot===r)return!0;if(!(e instanceof ms))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&xf(r)&&n.is(r)&&n.isMatchingSnapshotId(e,r)}function WO(e){return Sa(e)&&(e.flags&Lr.Array)>0}var Pb="preProcessSnapshot",Ob="postProcessSnapshot";function $O(){return or(this).toString()}var Ab={name:"AnonymousModel",properties:{},initializers:Ah};function YO(e){var r=Object.keys(e),t=new Set;return r.forEach(function(n){if(t.has(n))throw new Qt("".concat(n," is declared twice in the model. Model should not contain the same keys"));t.add(n)}),r.reduce(function(n,a){if(a in wa)throw new Qt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var i=Object.getOwnPropertyDescriptor(e,a);if("get"in i)throw new Qt("Getters are not supported as properties. Please use views instead");var o=i.value;if(o==null)throw new Qt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(kh(o))n[a]=Pf(eA(o),o);else if(o instanceof j1)n[a]=Pf(o,{});else if(o instanceof F1)n[a]=Pf(o,[]);else if(!Sa(o))throw new Qt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},_a({},e))}var vp=function(e){Jn(r,e);function r(t){var n=e.call(this,t.name||Ab.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({name:a})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({properties:a})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.preProcessor;return i?n.cloneAndEnhance({preProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.postProcessor;return i?n.cloneAndEnhance({postProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({postProcessor:a})}}),Object.assign(n,Ab,t),n.properties=YO(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(r.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(n,a){if(a.flags&Lr.Identifier){if(t)throw new Qt("Cannot define property '".concat(n,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=n}}),t}}),Object.defineProperty(r.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new r({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(r.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateActions(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(a){if(a===Pb)throw new Qt("Cannot define action '".concat(Pb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Ob)throw new Qt("Cannot define action '".concat(Ob,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var i=n[a],o=t[a];if(a in wa&&o){var s=i;i=function(){o.apply(null,arguments),s.apply(null,arguments)}}var u=i.$mst_middleware,c=i.bind(n);c._isFlowAction=i._isFlowAction||!1,c.$mst_middleware=u;var h=gp(t,a,c);n[a]=h,Ef(t,a,h)})}}),Object.defineProperty(r.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;if(typeof t!="function")throw new Qt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(i){return n.instantiateVolatileState(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("volatile state initializer should return a plain object containing state");Q2(t,n)}}),Object.defineProperty(r.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){var o=t(i),s=o.actions,u=o.views,c=o.state,h=wP(o,["actions","views","state"]);for(var v in h)throw new Qt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(v,"'"));return c&&n.instantiateVolatileState(i,c),u&&n.instantiateViews(i,u),s&&n.instantiateActions(i,s),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateViews(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(a){var i,o=Object.getOwnPropertyDescriptor(n,a);if("get"in o)J2(t,a,o),em(t,(i={},i[a]=Tf,i));else if(typeof o.value=="function")Ef(t,a,o.value);else throw new Qt("A view member should either be a function or getter based property")})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?i:this.applySnapshotPreProcessor(i);return wm(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type,i={};return a.forAllProps(function(o,s){i[o]=s.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=_a(_a({},i0),{name:this.name});return jn.object(t,Ch,n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Ef(n,"toString",$O),this.forAllProps(function(a){K2(n,a,t.unbox)}),this.initializers.reduce(function(a,i){return i(a)},n),Y1(n,this.willChange),K1(n,this.didChange)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=or(n.object),i=n.name;a.assertWritable({subpath:i});var o=a.type.properties[i];return o&&(hc(o,n.newValue),n.newValue=o.reconcile(a.getChildNode(i),n.newValue,a,i)),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=or(n.object),i=a.type.properties[n.name];if(i){var o=n.oldValue?n.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Wc(n.name),value:n.newValue.snapshot,oldValue:o},a)}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=[];return this.forAllProps(function(i){a.push(n.getChildNode(t,i))}),a}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a;if(!(n in this.properties))throw new Qt("Not a value property: "+n);var i=Zl(t.storedValue,n),o=(a=i.raw)===null||a===void 0?void 0:a.call(i);if(!o)throw new Qt("Node not available for property "+n);return o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={};return this.forAllProps(function(o,s){try{var u=Mu(t.storedValue,o);u.reportObserved()}catch{throw new Qt("".concat(o," property is declared twice"))}i[o]=a.getChildNode(t,o).snapshot}),n?this.applySnapshotPostProcessor(i):i}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){if(!(a.op==="replace"||a.op==="add"))throw new Qt("object does not support operation ".concat(a.op));t.storedValue[n]=a.value}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=this.applySnapshotPreProcessor(n);this.forAllProps(function(i){t.storedValue[i]=a[i]})}}),Object.defineProperty(r.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.preProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.postProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.applySnapshotPreProcessor(t);return xf(i)?n0(this.propertyNames.map(function(o){return a.properties[o].validate(i[o],bm(n,o,a.properties[o]))})):bs(n,i,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.propertyNames.forEach(function(a){return t(a,n.properties[a])})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(n){return n+": "+t.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),r}(Oh);vp.prototype.applySnapshot=ca(vp.prototype.applySnapshot);function XO(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new vp({name:t,properties:n})}function KO(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string",n=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,i){return a.cloneAndEnhance({name:a.name+"_"+i.name,properties:i.properties,initializers:i.initializers,preProcessor:function(o){return i.applySnapshotPreProcessor(a.applySnapshotPreProcessor(o))},postProcessor:function(o){return i.applySnapshotPostProcessor(a.applySnapshotPostProcessor(o))}})}).named(n)}function A8(e){return Sa(e)&&(e.flags&Lr.Object)>0}var vc=function(e){Jn(r,e);function r(t,n,a,i){i===void 0&&(i=SO);var o=e.call(this,t)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:i}),o.flags=n,o}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(kh(t)&&this.checker(t))return ys();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return bs(n,t,"Value is not a ".concat(a))}}),r}(Ff),C8=new vc("string",Lr.String,function(e){return typeof e=="string"}),k8=new vc("number",Lr.Number,function(e){return typeof e=="number"}),ZO=new vc("integer",Lr.Integer,function(e){return xO(e)}),QO=new vc("float",Lr.Float,function(e){return EO(e)}),JO=new vc("finite",Lr.Finite,function(e){return PO(e)}),L8=new vc("boolean",Lr.Boolean,function(e){return typeof e=="boolean"}),N8=new vc("null",Lr.Null,function(e){return e===null}),T8=new vc("undefined",Lr.Undefined,function(e){return e===void 0}),R8=new vc("Date",Lr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});R8.getSnapshot=function(e){return e.storedValue.getTime()};var M8=R8;function eA(e){switch(typeof e){case"string":return C8;case"number":return k8;case"boolean":return L8;case"object":if(e instanceof Date)return M8}throw new Qt("Cannot determine primitive type from value "+e)}function I8(e){return Sa(e)&&(e.flags&(Lr.String|Lr.Number|Lr.Integer|Lr.Boolean|Lr.Date))>0}var tA=function(e){Jn(r,e);function r(t){var n=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Literal}),n.value=t,n}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return kh(t)&&t===this.value?ys():bs(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),r}(Ff);function j8(e){return new tA(e)}function rA(e){return Sa(e)&&(e.flags&Lr.Literal)>0}var nA=function(e){Jn(r,e);function r(t,n,a,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this._subtype.validate(t,n);if(a.length>0)return a;var i=Ln(t)?or(t).snapshot:t;return this._predicate(i)?ys():bs(n,t,this._message(t))}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function iA(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():Sa(e[0])?e[0].name:null,n=e[0],a=e[1],i=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new nA(t,n,a,i)}function aA(e){return Sa(e)&&(e.flags&Lr.Refinement)>0}function oA(e,r){var t=typeof e=="string"?r:e,n=a0.apply(void 0,ju([],Iu(t.map(function(a){return j8(""+a)})),!1));return typeof e=="string"&&(n.name=e),n}var sA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t)||this;return Object.defineProperty(i,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=_a({eager:!0,dispatcher:void 0},a),i._dispatcher=a.dispatcher,a.eager||(i._eager=!1),i}return Object.defineProperty(r.prototype,"flags",{get:function(){var t=Lr.Union;return this._types.forEach(function(n){t|=n.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(n){return n.isAssignableFrom(t)})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(i,void 0);if(!o)throw new Qt("No matching type for union "+this.describe());return o.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(n,t.getReconciliationType());if(!o)throw new Qt("No matching type for union "+this.describe());return o.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._dispatcher?this._dispatcher(t):n?n.is(t)?n:this._types.filter(function(a){return a!==n}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._dispatcher)return this._dispatcher(t).validate(t,n);for(var a=[],i=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(t,n);if(u.length===0){if(this._eager)return ys();i++}else a.push(u)}return i===1?ys():bs(n,t,"No type is applicable for the union").concat(n0(a))}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),r}(pc);function a0(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var n=Sa(e)?void 0:e,a=Sa(e)?ju([e],Iu(r),!1):r,i="("+a.map(function(o){return o.name}).join(" | ")+")";return new sA(i,a,n)}function F8(e){return Sa(e)&&(e.flags&Lr.Union)>0}var lA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(this.optionalValues.indexOf(i)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,n,a,o)}return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),a,i)}}),Object.defineProperty(r.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&hc(this,t),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.optionalValues.indexOf(t)>=0?ys():this._subtype.validate(t,n)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function uA(e,r){if(typeof r!="function"&&Ln(r))throw new Qt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Pf(e,r,t){return uA(e,r),new lA(e,r,t||cA)}var cA=[void 0];function fA(e){return Sa(e)&&(e.flags&Lr.Optional)>0}var hA=Pf(T8,void 0),dA=Pf(N8,null);function D8(e){return a0(e,hA)}function pA(e){return a0(e,dA)}var gA=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(r.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Lr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var n=void 0;try{n=this._definition()}catch(a){if(a instanceof ReferenceError)n=void 0;else throw a}if(t&&n===void 0)throw new Qt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.getSubType(!1);return a?a.validate(t,n):ys()}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getSubType(!1);return n?n.isAssignableFrom(t):!1}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||o8}}),r}(pc);function vA(e,r){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?r:e;return new gA(t,n)}function mA(e){return Sa(e)&&(e.flags&Lr.Late)>0}function yA(e,r){return new bA(e,r)}var bA=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:jn.array()}),S2(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(i){return i.isAlive&&a.options.shouldLoadPredicate(i.parent?i.parent.value:null)})},function(){a.options.loadType().then(ca(function(i){a.loadedType=i,a.pendingNodeList.forEach(function(o){o.parent&&a.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this;if(this.loadedType)return this.loadedType.instantiate(t,n,a,i);var s=nf(this,t,n,a,i);return this.pendingNodeList.push(s),S2(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):_8(t)?ys():bs(n,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.loadedType?(t.die(),this.loadedType.instantiate(a,i,a.environment,n)):e.prototype.reconcile.call(this,t,n,a,i)}}),r}(Ff),B8=function(e){Jn(r,e);function r(t){var n=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Frozen}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return _8(t)?this.subType?this.subType.validate(t,n):ys():bs(n,t,"Value is not serializable and cannot be frozen")}}),r}(Ff),Cb=new B8;function wA(e){return arguments.length===0?Cb:Sa(e)?new B8(e):Pf(Cb,e)}function _A(e){return Sa(e)&&(e.flags&Lr.Frozen)>0}function SA(e){switch(e){case wa.beforeDestroy:return"destroy";case wa.beforeDetach:return"detach";default:return}}var xA=function(){function e(r,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Em(r))this.identifier=r;else if(Ln(r)){var n=or(r);if(!n.identifierAttribute)throw new Qt("Can only store references with a defined identifier attribute.");var a=n.unnormalizedIdentifier;if(a==null)throw new Qt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new Qt("Can only store references to tree nodes or identifiers, got: '".concat(r,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=jh(this.identifier),n=r.root,a=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var i=this.targetType,o=n.identifierCache.resolve(i,t);if(!o)throw new xm("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(r.path,")"));this.resolvedReference={node:o,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),xm=function(e){Jn(r,e);function r(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,r.prototype),n}return r}(Error),q8=function(e){Jn(r,e);function r(t,n){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Reference}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Em(t)?ys():bs(n,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(r.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=n.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:t,parent:s,invalidTarget:i?i.storedValue:void 0,invalidId:a,replaceRef:function(u){Ph(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){A8(o.type)?this.replaceRef(void 0):Ph(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(r.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.getValue(t);if(i){var o=or(i),s=function(h,v){var g=SA(v);g&&a.fireInvalidated(g,t,n,o)},u=o.registerHook(wa.beforeDetach,s),c=o.registerHook(wa.beforeDestroy,s);return function(){u(),c()}}}}),Object.defineProperty(r.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=this;if(this.onInvalidated){var o;t.registerHook(wa.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var c=t.parent,h=c&&c.storedValue;if(c&&c.isAlive&&h){var v=void 0;a?v=!!a.get(n,h):v=t.root.identifierCache.has(i.targetType,jh(n)),v?o=i.addTargetNodeWatcher(t,n):u||i.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===io.FINALIZED?s(!0):(t.isRoot||t.root.registerHook(wa.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(wa.afterAttach,function(){s(!1)}))}}}),r}(Ff),EA=function(e){Jn(r,e);function r(t,n){return e.call(this,t,n)||this}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=t.storedValue;return n.resolvedValue}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t.storedValue;return n.identifier}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?e8(i):i,s=new xA(i,this.targetType),u=nf(this,t,n,a,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this){var o=Ln(n),s=t.storedValue;if(!o&&s.identifier===n||o&&s.resolvedValue===n)return t.setParent(a,i),t}var u=this.instantiate(a,i,void 0,n);return t.die(),u}}),r}(q8),PA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t,a)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return n}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?this.options.set(i,t?t.storedValue:null):i,s=nf(this,t,n,a,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(n)?this.options.set(n,t?t.storedValue:null):n;if(!t.isDetaching&&t.type===this&&t.storedValue===o)return t.setParent(a,i),t;var s=this.instantiate(a,i,void 0,o);return t.die(),s}}),r}(q8);function z8(e,r){var t=r||void 0,n=r?r.onInvalidated:void 0;return t&&(t.get||t.set)?new PA(e,{get:t.get,set:t.set},n):new EA(e,n)}function OA(e){return Sa(e)&&(e.flags&Lr.Reference)>0}function AA(e,r){var t=z8(e,_a(_a({},r),{onInvalidated:function(n){r&&r.onInvalidated&&r.onInvalidated(n),n.removeRef()}}));return r&&r.acceptsUndefined===!1?t:D8(t)}var U8=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Identifier}),a}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t||!(t.type instanceof vp))throw new Qt("Identifier types can only be instantiated as direct child of a model type");return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(t.storedValue!==n)throw new Qt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return t.setParent(a,i),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return typeof t!==this.validType?bs(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):ys()}}),r}(Ff),CA=function(e){Jn(r,e);function r(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Identifier}),t}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),r}(U8),kA=function(e){Jn(r,e);function r(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),r}(U8),LA=new CA,NA=new kA;function TA(e){return Sa(e)&&(e.flags&Lr.Identifier)>0}function jh(e){return""+e}function Em(e){return typeof e=="string"||typeof e=="number"}function RA(e){return new MA(e)}var MA=function(e){Jn(r,e);function r(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Custom}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.options.isTargetType(t))return ys();var a=this.options.getValidationMessage(t);return a?bs(n,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):ys()}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.options.isTargetType(i)?i:this.options.fromSnapshot(i,t&&t.root.environment);return nf(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=!this.options.isTargetType(n);if(!t.isDetaching){var s=t.type===this&&(o?n===t.snapshot:n===t.storedValue);if(s)return t.setParent(a,i),t}var u=o?this.options.fromSnapshot(n,a.root.environment):n,c=this.instantiate(a,i,void 0,u);return t.die(),c}}),r}(Ff),kb={enumeration:oA,model:XO,compose:KO,custom:RA,reference:z8,safeReference:AA,union:a0,optional:Pf,literal:j8,maybe:D8,maybeNull:pA,refinement:iA,string:C8,boolean:L8,number:k8,integer:ZO,float:QO,finite:JO,Date:M8,map:HO,array:GO,frozen:wA,identifier:LA,identifierNumber:NA,late:vA,lazy:yA,undefined:T8,null:N8,snapshotProcessor:zO};const IA=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:zP,addMiddleware:f8,applyAction:s8,applyPatch:Ph,applySnapshot:Z6,cast:GP,castFlowReturn:NO,castToReferenceSnapshot:$P,castToSnapshot:WP,clone:DP,createActionTrackingMiddleware:QP,createActionTrackingMiddleware2:eO,decorate:oO,destroy:qP,detach:BP,escapeJsonPath:Wc,flow:E8,getChildType:_P,getEnv:UP,getIdentifier:e8,getLivelinessChecking:Y6,getMembers:VP,getNodeId:YP,getParent:CP,getParentOfType:LP,getPath:J6,getPathParts:NP,getPropertyMembers:n8,getRelativePath:FP,getRoot:Q6,getRunningActionContext:ym,getSnapshot:gm,getType:Cp,hasEnv:HP,hasParent:AP,hasParentOfType:kP,isActionContextChildOf:uO,isActionContextThisOrChildOf:cO,isAlive:vm,isArrayType:WO,isFrozenType:_A,isIdentifierType:TA,isLateType:mA,isLiteralType:rA,isMapType:VO,isModelType:A8,isOptionalType:fA,isPrimitiveType:I8,isProtected:OP,isReferenceType:OA,isRefinementType:aA,isRoot:TP,isStateTreeNode:Ln,isType:Sa,isUnionType:F8,isValidReference:jP,joinJsonPath:I1,onAction:l8,onPatch:K6,onSnapshot:SP,process:wO,protect:EP,recordActions:iO,recordPatches:xP,resolveIdentifier:MP,resolvePath:RP,setLivelinessChecking:$6,setLivelynessChecking:bP,splitJsonPath:Lh,t:kb,toGenerator:RO,toGeneratorFunction:TO,tryReference:IP,tryResolve:t8,typecheck:p8,types:kb,unescapeJsonPath:P8,unprotect:PP,walk:r8},Symbol.toStringTag,{value:"Module"})),hl=Zc(IA);var mg={},Lb;function H8(){return Lb||(Lb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:r,newText:t,element:n}){if(!(t.length/Math.max(20,r.length)>=4))return n.fontSize;const a=n.width*n.page.computedHeight/t.length,i=1.5*Math.sqrt(a),o=n.fontSize;return Math.min(o,Math.max(5,Math.round(i)))}}(mg)),mg}var Nb;function V8(){return Nb||(Nb=1,function(e){var r=Bd&&Bd.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=k,e.getDir=L,e.usePrevious=A;const t=r(ai()),n=Us,a=Fu,i=Mh,o=vs,s=r(Hs()),u=mP,c=Op(),h=jf(),v=Ih(),g=gc(),f=r0(),E=Ap(),S=If(),w=rf(),_=hl,y=H8();let p;function m(){return p||(p=document.getElementById("polotno-text-style"),p||(p=document.createElement("style"),p.id="polotno-text-style",document.head.appendChild(p)),p)}s.default._fixTextRendering=!0;const P={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 T(O){var M="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+M+"]*?["+M+"]").test(O)}function k(O){O=O.replace(/\s/g,"");let M=0;for(var q=0;q<O.length;q++)T(O[q])&&(M+=1);return M>O.length/2}function L(O){return k(O)?"rtl":"ltr"}const I=(0,n.observer)(({textNodeRef:O,element:M,onBlur:q,selectAll:D,cursorPosition:te})=>{const[H,B]=t.default.useState(P),$=O.current;t.default.useLayoutEffect(()=>{const Y={};Y.width=$.width()-2*$.padding()+"px",Y.height=$.height()-2*$.padding()+$.fontSize()*$.lineHeight()+"px",Y.fontSize=$.fontSize()+"px",Y.lineHeight=$.lineHeight()+.01,Y.fontFamily=$.fontFamily(),Y.textAlign=$.align(),Y.color=$.fill(),Y.fontWeight=M.fontWeight,Y.fontStyle=M.fontStyle,Y.letterSpacing=M.letterSpacing+"em",Y.opacity=Math.max(M.a.opacity,.2),Y.textTransform=M.textTransform;const J=`
|
|
103
|
+
.polotno-input::placeholder {
|
|
104
|
+
color: ${H.color};
|
|
105
|
+
opacity: 0.6;
|
|
106
|
+
}
|
|
107
|
+
`,X=m();X.innerHTML="",X.appendChild(document.createTextNode(J)),JSON.stringify(Y)!==JSON.stringify(H)&&B(Y)});const V=t.default.useRef(null);t.default.useLayoutEffect(()=>{var Y;const J=V.current;if(!J)return;(Y=V.current)===null||Y===void 0||Y.focus();const X=te||J.value.length;J.selectionStart=J.selectionEnd=X,D&&(J?.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",q);const Y=J=>{var X;!((X=V.current)===null||X===void 0)&&X.contains(J.target)||q()};return window.addEventListener("touchstart",Y),()=>{window.removeEventListener("blur",q),window.removeEventListener("touchstart",Y)}},[]);let j=0;const z=$.textArr.length*$.lineHeight()*$.fontSize();M.verticalAlign==="middle"&&(j=(M.a.height-z)/2),M.verticalAlign==="bottom"&&(j=M.a.height-z);const F=(0,f.removeTags)(M.text);return t.default.createElement("textarea",{className:"polotno-input",ref:V,dir:L(F),style:Object.assign(Object.assign(Object.assign({},P),H),{paddingTop:j+"px"}),value:F,onChange:Y=>{const J=(0,y.getLimitedFontSize)({oldText:M.text,newText:Y.target.value,element:M});M.set({text:Y.target.value,fontSize:J})},placeholder:M.placeholder,onBlur:q})}),R=O=>t.default.createElement(i.Html,null,t.default.createElement(I,Object.assign({},O)));function A(O){const M=t.default.useRef(O),q=t.default.useRef(O);return t.default.useMemo(()=>{q.current=M.current,M.current=O},[O]),q.current}e.useFontLoader=(O,M)=>{const[q,D]=t.default.useReducer(H=>H+1,0),te=t.default.useRef((0,v.isFontLoaded)(M));return t.default.useLayoutEffect(()=>{if(te.current=(0,v.isFontLoaded)(M),te.current)return;let H=!0;return(async()=>{te.current=!1,D();const B=(0,h.incrementLoader)(`text ${M}`);await O.loadFont(M),setTimeout(B,100),H&&(te.current=!0,D())})(),()=>{H=!1}},[M]),[te.current]},e.getLineHeight=({fontLoaded:O,fontFamily:M,fontSize:q,lineHeight:D})=>t.default.useMemo(()=>{if(typeof D=="number")return D;const te=document.createElement("div");te.style.fontFamily=M,te.style.fontSize=q+"px",te.style.lineHeight=D,te.innerText="Test text",document.body.appendChild(te);const H=te.offsetHeight;return document.body.removeChild(te),H/q},[O,M,q,D]),e.TextElement=(0,n.observer)(({element:O,store:M})=>{const q=t.default.useRef(null),D=t.default.useRef(null),{editorEnabled:te,selectAll:H}=(he=>{const[ke,Te]=t.default.useState(!1),ve=t.default.useRef(!1);return t.default.useEffect(()=>{var Se=!0;return setTimeout(()=>{Se&&(he._editModeEnabled&&(ve.current=!0),Te(!0),setTimeout(()=>{ve.current=!1},50))},50),()=>{Se=!1}},[]),{editorEnabled:ke&&he._editModeEnabled,selectAll:ve.current}})(O),[B,$]=t.default.useState(!1),V=t.default.useRef(O.a.height),j=M.selectedShapes.indexOf(O)>=0&&O.selectable,{textVerticalResizeEnabled:z}=g.flags,F=A(O.fontFamily),[Y,J]=t.default.useState([]);t.default.useEffect(()=>{var he,ke;const Te=(ke=(he=q.current)===null||he===void 0?void 0:he.textArr)!==null&&ke!==void 0?ke:[];JSON.stringify(Te)!==JSON.stringify(Y)&&J(Te)}),t.default.useEffect(()=>{if(O.a.width)return;const he=q.current;he.width(600),O.set({width:1.4*he.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const he=q.current;(0,E.applyFilter)(he,O)}));const[X]=(0,e.useFontLoader)(M,O.fontFamily);let Q=(0,f.removeTags)(O.text);O.textTransform==="uppercase"&&(Q=Q.toUpperCase());const ae=()=>{const he=q.current.clone({height:void 0}),ke=Math.ceil(he.fontSize()*he.lineHeight()*he.textArr.length+1);return he.destroy(),ke};t.default.useLayoutEffect(()=>{if(!X)return;const{textOverflow:he,textSplitAllowed:ke}=g.flags;if(!O.a.height){const Te=ae();return void M.history.ignore(()=>{O.set({height:Te})},!1,!0)}if(!M.isPlaying)if(he!=="change-font-size"||B){if(he==="resize"){const Te=ae();z&&O.a.height<Te&&M.history.ignore(()=>{var ve;(0,_.isAlive)(O)&&O.set({height:Te}),(ve=q.current)===null||ve===void 0||ve.height(Te)},!1,!0),z||O.a.height===Te||B||M.history.ignore(()=>{var ve;(0,_.isAlive)(O)&&O.set({height:Te}),(ve=q.current)===null||ve===void 0||ve.height(Te)},!1,!0)}}else{const Te=function(Se,je,Ue=!1){const ct=Se.fontSize(),mt=Se.height(),yt=(0,f.removeTags)(je.text);let Je=je.a.fontSize;Se.height(void 0);const lt=Math.round(2*je.a.fontSize)-1;for(let ze=1;ze<lt;ze++){const kt=je.a.height&&Se.height()>je.a.height;let pt=yt.split(`
|
|
108
|
+
`).join(" ").split(/[\s-]+/).reduce((Me,Oe)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Oe)?Me.concat(Oe.split("")):Me.concat(Oe),[]),Ut=Se.textArr.map(Me=>Me.text).join(";");const Ht=pt.find(Me=>!Ut.includes(Me)||(Ut=Ut.replace(Me,""),!1));if(!(kt||Ht&&!Ue))break;Je-=.5,Se.fontSize(Je)}return Se.fontSize(ct),Se.height(mt),Je}(q.current,O,ke);if(Te!==O.a.fontSize)return void M.history.ignore(()=>{O.set({fontSize:Te})},!1,!0);const ve=ae();O.a.height===ve||z||M.history.ignore(()=>{O.set({height:ve})},!1,!0)}}),t.default.useLayoutEffect(()=>{const he=q.current;he&&(he.width(he.width()+1e-8),he._setTextData(),(0,E.applyFilter)(he,O))},[X]);const se=t.default.useRef(null),fe=t.default.useRef(0),be=he=>{he.evt.preventDefault(),M.selectedShapes.find(Te=>Te===O)&&O.contentEditable&&(fe.current=function(Te){var ve;const Se=Te.target,je=function(lt){var ze=lt.getAbsoluteTransform().copy();ze.invert();var kt=lt.getStage().getPointerPosition();return ze.point(kt)}(Se),Ue=Se.textArr,ct=Math.floor(je.y/(Se.fontSize()*Se.lineHeight())),mt=Ue.slice(0,ct).reduce((lt,ze)=>lt+ze.text.length,ct),yt=(ve=Ue[ct])!==null&&ve!==void 0?ve:Ue[0];let Je=0;return Se.align()==="right"?Je=Se.width()-yt.width:Se.align()==="center"&&(Je=Se.width()/2-yt.width/2),mt+Math.round((je.x-Je)/yt.width*yt.text.length)}(he),O.toggleEditMode())},_e=!Q&&O.placeholder?.6:O.a.opacity;(0,S.useFadeIn)(q,_e);const Ae=(0,e.getLineHeight)({fontLoaded:X,fontFamily:O.fontFamily,fontSize:O.a.fontSize,lineHeight:O.lineHeight}),Re=O.selectable||M.role==="admin",Pe=(0,c.useColor)(O),ye=t.default.useMemo(()=>O.backgroundEnabled?function({lines:he,lineHeight:ke,width:Te,align:ve="left",padding:Se=0,cornerRadius:je=0}){var Ue;he.forEach((Je,lt)=>{Je.cx=Te/2,ve==="right"?Je.cx=Te-Je.width/2:ve==="left"&&(Je.cx=Je.width/2),ve!=="justify"||Je.lastInParagraph||(Je.width=Te),ve==="justify"&&(Je.cx=Je.width/2)});let ct=`M ${(Ue=he[0])===null||Ue===void 0?void 0:Ue.cx} ${-Se}`;he.forEach((Je,lt)=>{const{cx:ze}=Je,kt=he[lt-1];kt&&kt.width>Je.width?ct+=` L ${ze+Je.width/2+Se} ${lt*ke+Se}`:ct+=` L ${ze+Je.width/2+Se} ${lt*ke-Se}`;const pt=he[lt+1];pt&&pt.width>Je.width?ct+=` L ${ze+Je.width/2+Se} ${(lt+1)*ke-Se}`:ct+=` L ${ze+Je.width/2+Se} ${(lt+1)*ke+Se}`});for(var mt=he.length-1;mt>=0;mt--){const Je=he[mt],{cx:lt}=Je,ze=he[mt+1];ze&&ze.width>Je.width?ct+=` L ${lt-Je.width/2-Se} ${(mt+1)*ke-Se}`:ct+=` L ${lt-Je.width/2-Se} ${(mt+1)*ke+Se}`;const kt=he[mt-1];kt&&kt.width>Je.width?ct+=` L ${lt-Je.width/2-Se} ${mt*ke+Se}`:ct+=` L ${lt-Je.width/2-Se} ${mt*ke-Se}`}ct+=" Z";const yt=(0,u.parsePath)(ct);return(0,u.roundCommands)(yt,je).path}({lines:JSON.parse(JSON.stringify(Y)),cornerRadius:O.backgroundCornerRadius*(O.a.fontSize*Ae*.5),lineHeight:Ae*O.a.fontSize,padding:O.backgroundPadding*(O.a.fontSize*Ae*.5),width:O.a.width,align:O.align}):"",[O.backgroundEnabled,O.backgroundCornerRadius,O.a.fontSize,Ae,O.backgroundPadding,O.a.width,O.align,Y]),nt=(0,w.isTouchDevice)();let Ce=0;return O.verticalAlign==="middle"?Ce=(O.a.height-Y.length*Ae*O.a.fontSize)/2:O.verticalAlign==="bottom"&&(Ce=O.a.height-Y.length*Ae*O.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:D,x:O.a.x,y:O.a.y,rotation:O.a.rotation,hideInExport:!O.showInExport,listening:!1,visible:O.backgroundEnabled,opacity:O.backgroundOpacity*_e,data:ye,fill:O.backgroundColor,offsetY:-Ce}),t.default.createElement(a.Text,Object.assign({ref:q,id:O.id,name:"element",hideInExport:!O.showInExport,editModeEnabled:O._editModeEnabled,x:O.a.x,y:O.a.y,rotation:O.a.rotation,width:O.a.width,height:O.a.height,text:Q||O.placeholder,direction:L(Q)},Pe,{stroke:O.stroke,lineJoin:"round",strokeWidth:O.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:O.a.fontSize,fontFamily:`"${O.fontFamily}", "${F}"`,fontStyle:O.fontStyle+" "+O.fontWeight,textDecoration:O.textDecoration,align:O.align,verticalAlign:O.verticalAlign,draggable:nt?O.draggable&&j:O.draggable,preventDefault:!nt||j,opacity:_e,visible:!O._editModeEnabled,ellipsis:g.flags.textOverflow==="ellipsis",shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,lineHeight:Ae,letterSpacing:O.letterSpacing*O.a.fontSize,listening:Re,onDragMove:he=>{O.set({x:he.target.x(),y:he.target.y()})},onDragEnd:he=>{O.set({x:he.target.x(),y:he.target.y()})},onClick:be,onTap:be,onTransformStart:()=>{$(!0),V.current=q.current.height()},onTransform:he=>{var ke,Te,ve;const Se=he.target;(ke=D.current)===null||ke===void 0||ke.setAttrs({x:Se.x(),y:Se.y(),rotation:Se.rotation(),scale:Se.scale()});const je=((Te=Se.getStage())===null||Te===void 0?void 0:Te.findOne("Transformer")).getActiveAnchor();if(je==="middle-left"||je==="middle-right"){const ct=Se.scaleX(),mt=Se.width()*ct,yt=O.a.fontSize;let Je=mt;mt<yt&&(Je=yt,se.current&&Se.position(se.current)),Se.width(Je),Se.scaleX(1),Se.scaleY(1);const lt=ae();if(g.flags.textOverflow!=="ellipsis"){const kt=Math.max(lt,V.current);Se.height(kt),O.set({height:Se.height()})}const ze=g.flags.textVerticalResizeEnabled?Math.max(lt,V.current):ae();O.set({x:Se.x(),width:Se.width(),rotation:Se.rotation(),height:ze}),(0,E.applyFilter)(Se,O)}if(je==="top-center"||je==="bottom-center"){let ct=g.flags.textOverflow==="resize"?ae():Ae*O.a.fontSize;he.target.height(Math.max(ct,he.target.height()*he.target.scaleY())),he.target.scaleY(1)}se.current=he.target.position();const Ue=he.target.scaleX();(ve=D.current)===null||ve===void 0||ve.setAttrs({scaleX:1,scaleY:1}),he.target.scaleX(1),he.target.scaleY(1),O.set({fontSize:O.a.fontSize*Ue,width:he.target.width()*Ue,x:he.target.x(),y:he.target.y(),rotation:he.target.rotation(),height:he.target.height()*Ue,shadowBlur:O.shadowBlur*Ue,shadowOffsetX:O.shadowOffsetX*Ue,shadowOffsetY:O.shadowOffsetY*Ue,strokeWidth:O.strokeWidth*Ue})},onTransformEnd:he=>{var ke;const Te=he.target.scaleX();he.target.scaleX(1),he.target.scaleY(1),O.set({fontSize:Math.round(O.a.fontSize*Te),width:Math.ceil(he.target.width()*Te),x:he.target.x(),y:he.target.y(),rotation:he.target.rotation(),height:he.target.height()*Te,shadowBlur:O.shadowBlur*Te,shadowOffsetX:O.shadowOffsetX*Te,shadowOffsetY:O.shadowOffsetY*Te,strokeWidth:O.strokeWidth*Te}),(ke=D.current)===null||ke===void 0||ke.setAttrs({scaleX:1,scaleY:1}),$(!1)}})),te&&t.default.createElement(a.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation},t.default.createElement(R,{textNodeRef:q,element:O,selectAll:H,cursorPosition:fe.current,onBlur:()=>{O.toggleEditMode(!1),O.text===""&&O.removable&&!O.placeholder&&M.deleteElements([O.id])}})))})}(Bd)),Bd}var Fl={},Vd={},yg={exports:{}},bg={exports:{}},Tb;function Pm(){return Tb||(Tb=1,function(e,r){e.exports=t;function t(a){return n.bind(null,a)}function n(a){var i=[].slice.call(arguments,1);i.unshift("["+a+"]"),process.stderr.write(i.join(" ")+`
|
|
109
|
+
`)}}(bg)),bg.exports}var Rb;function G8(){return Rb||(Rb=1,function(e,r){Pm()("lex"),e.exports=t;function t(n){var a="",i,o=0,s=-1,u=0,c=1,h="before-selector",v=[h],g={},f=[],E=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function S(){return L(),n[s]}function w(H){return H?v[v.length-1-H]:h}function _(H){var B=s+1;return H===n.slice(B,B+H.length)}function y(H){var B=n.slice(s).indexOf(H);return B>0?B:!1}function p(H){return H===m(1)}function m(H){return n[s+(H||1)]}function P(){var H=v.pop();return h=v[v.length-1],H}function T(H){return h=H,v.push(h),v.length}function k(H){var B=h;return v[v.length-1]=h=H,B}function L(H){if((H||1)==1)n[s]==`
|
|
110
|
+
`?(c++,o=1):o++,s++;else{var B=n.slice(s,s+H).split(`
|
|
111
|
+
`);B.length>1&&(c+=B.length-1,o=1),o+=B[B.length-1].length,s=s+H}}function I(){g.end={line:c,col:o},f.push(g),a="",g={}}function R(H){g={type:H,start:{line:c,col:o}}}for(;i=S();)switch(i){case" ":switch(w()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":a+=i;break}break;case`
|
|
112
|
+
`:case" ":case"\r":case"\f":switch(w()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":a+=i;break;case"at-value":i===`
|
|
113
|
+
`&&(g.value=a.trim(),I(),P());break}break;case":":switch(w()){case"name":g.name=a.trim(),a="",k("before-value");break;case"before-selector":a+=i,R("selector"),T("selector");break;case"before-value":k("value"),a+=i;break;default:a+=i;break}break;case";":switch(w()){case"name":case"before-value":case"value":a.trim().length>0&&(g.value=a.trim(),I()),k("before-name");break;case"value-paren":a+=i;break;case"at-value":g.value=a.trim(),I(),P();break;case"before-name":break;default:a+=i;break}break;case"{":switch(w()){case"selector":if(m(-1)==="\\"){a+=i;break}g.text=a.trim(),I(),k("before-name"),u=u+1;break;case"at-group":switch(g.name=a.trim(),g.type){case"font-face":case"viewport":case"page":T("before-name");break;default:T("before-selector")}I(),u=u+1;break;case"name":case"at-rule":g.name=a.trim(),I(),T("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":k("value"),a+=i;break}break;case"}":switch(w()){case"before-name":case"name":case"before-value":case"value":a&&(g.value=a.trim()),g.name&&g.value&&I(),R("end"),I(),P(),w()==="at-group"&&(R("at-group-end"),I(),P()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(m(-1)==="\\"){a+=i;break}u>0&&w(1)==="at-group"&&(R("at-group-end"),I()),u>1&&P(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":a+=i;break}break;case'"':case"'":switch(w()){case"double-string":i==='"'&&m(-1)!=="\\"&&P();break;case"single-string":i==="'"&&m(-1)!=="\\"&&P();break;case"before-at-value":k("at-value"),T(i==='"'?"double-string":"single-string");break;case"before-value":k("value"),T(i==='"'?"double-string":"single-string");break;case"comment":break;default:m(-1)!=="\\"&&T(i==='"'?"double-string":"single-string")}a+=i;break;case"/":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":case"selector":case"name":case"value":if(p("*")){var A=y("*/");A&&L(A+1)}else w()=="before-value"&&k("value"),a+=i;break;default:p("*")?(R("comment"),T("comment"),L()):a+=i;break}break;case"*":switch(w()){case"comment":p("/")?(g.text=a,L(),I(),P()):a+=i;break;case"before-selector":a+=i,R("selector"),T("selector");break;case"before-value":k("value"),a+=i;break;default:a+=i}break;case"@":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":k("value"),a+=i;break;default:for(var O=!1,M,q,D=0,te=E.length;!O&&D<te;++D)q=E[D],M=q.name||q,_(M)&&(O=!0,R(M),T(q.state||"at-group"),L(M.length),q.prefix&&(g.prefix=q.prefix),q.type&&(g.type=q.type));O||(a+=i);break}break;case"(":switch(w()){case"value":T("value-paren");break;case"before-value":k("value");break}a+=i;break;case")":switch(w()){case"value-paren":P();break;case"before-value":k("value");break}a+=i;break;default:switch(w()){case"before-selector":R("selector"),T("selector");break;case"before-name":R("property"),k("name");break;case"before-value":k("value");break;case"before-at-value":k("at-value");break}a+=i;break}return f}}(yg)),yg.exports}var wg={exports:{}},Mb;function jA(){return Mb||(Mb=1,function(e,r){Pm()("parse");var t=G8();e.exports=s;var n,a,i,o;function s(P,T){T||(T={}),n=!!T.comments,i=!!T.position,a=0,o=Array.isArray(P)?P.slice():t(P);for(var k,L=[],I;I=c();)k=_(I),k&&L.push(k);return{type:"stylesheet",stylesheet:{rules:L}}}function u(P,T){T||(T={});for(var k,L=["type","name","value"],I={},R=0;R<L.length;++R)k=L[R],P[k]&&(I[k]=T[k]||P[k]);for(L=Object.keys(T),R=0;R<L.length;++R)k=L[R],I[k]||(I[k]=T[k]);return i&&(I.position={start:P.start,end:P.end}),I}function c(){var P=o.shift();return P}function h(P){a=a+1;var T={};switch(P.type){case"font-face":case"viewport":T.declarations=p();break;case"page":T.prefix=P.prefix,T.declarations=p();break;default:T.prefix=P.prefix,T.rules=m()}return u(P,T)}function v(P){return u(P)}function g(P){return u(P)}function f(P){return u(P,{text:P.text})}function E(P){return u(P)}function S(P){return u(P)}function w(P){function T(k){return k.trim()}return u(P,{type:"rule",selectors:P.text.split(",").map(T),declarations:p()})}function _(P){switch(P.type){case"property":return S(P);case"selector":return w(P);case"at-group-end":a=a-1;return;case"media":case"keyframes":return h(P);case"comment":if(n)return f(P);break;case"charset":return g(P);case"import":return v(P);case"namespace":return E(P);case"font-face":case"supports":case"viewport":case"document":case"page":return h(P)}}function y(P){for(var T,k=[],L;(L=c())&&P&&P(L);)T=_(L),T&&k.push(T);return L&&L.type!=="end"&&o.unshift(L),k}function p(){return y(function(P){return P.type==="property"||P.type==="comment"})}function m(){return y(function(){return a})}}(wg)),wg.exports}var _g={exports:{}},Ib;function FA(){return Ib||(Ib=1,function(e,r){Pm()("stringify");var t,n,a,i,o,s;e.exports=u;function u(m,P){P||(P={}),a=P.indentation||"",n=!!P.compress,t=!!P.comments,i=1,n?o=s="":(o=`
|
|
114
|
+
`,s=" ");var T=E(m.stylesheet.rules,y).join(`
|
|
115
|
+
`).trim();return T}function c(m){if(m){i+=m;return}return n?"":Array(i).join(a||"")}function h(m){return"@"+m.type+" "+m.value+";"+o}function v(m){var P="",T=m.prefix||"";m.name&&(P=" "+m.name);var k=m.type!=="page";return"@"+T+m.type+P+s+S(m,k)+o}function g(m){return t?"/*"+(m.text||"")+"*/"+o:""}function f(m){var P;return m.selectors?P=m.selectors.join(","+o):(P="@"+m.type,P+=m.name?" "+m.name:""),c()+P+s+S(m)+o}function E(m,P){return m.reduce(function(T,k){var L=k.type==="comment"?g(k):P(k);return L&&T.push(L),T},[])}function S(m,P){var T=m.declarations,k=_;return m.rules&&(T=m.rules,k=f),T=w(T,k),T&&(T=o+T+(P?"":o)),"{"+T+c()+"}"}function w(m,P){if(!m)return"";c(1);var T=E(m,P);return c(-1),T.length?T.join(o):""}function _(m){if(m.type==="property")return p(m)}function y(m){switch(m.type){case"rule":return f(m);case"media":case"keyframes":return v(m);case"comment":return g(m);case"import":case"charset":case"namespace":return h(m);case"font-face":case"supports":case"viewport":case"document":case"page":return v(m)}}function p(m){var P=m.name?m.name+":"+s:"";return c()+P+m.value+";"}}(_g)),_g.exports}var Sg,jb;function DA(){return jb||(jb=1,Sg={lex:G8(),parse:jA(),stringify:FA()}),Sg}var Fb;function kp(){return Fb||(Fb=1,function(e){var r=Vd&&Vd.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=async function(E){const S=await fetch(E);return f(await S.text())},e.urlToString=v,e.getColors=g,e.svgToURL=f,e.getSvgSize=async function(E){const S=await v(E),w=new DOMParser().parseFromString(S,"image/svg+xml").documentElement.getAttribute("viewBox"),[_,y,p,m]=w?.split(" ")||[];return{width:parseFloat(p),height:parseFloat(m)}},e.fixSize=function(E){var S=new DOMParser().parseFromString(E,"image/svg+xml");const w=S.documentElement.getAttribute("viewBox"),[_,y,p,m]=w?.split(" ")||[],P=S.documentElement.getAttribute("width");P||S.documentElement.setAttribute("width",p+"px");const T=S.documentElement.getAttribute("height");if((!T||T.indexOf("%")>=0)&&S.documentElement.setAttribute("height",m+"px"),P&&P.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const k=parseFloat(T)/parseFloat(m);S.documentElement.setAttribute("width",k*parseFloat(p)+"px")}if(T&&T.indexOf("%")>=0&&P&&P.indexOf("%")===-1){const k=parseFloat(P)/parseFloat(p);S.documentElement.setAttribute("height",k*parseFloat(m)+"px")}return P==="100%"&&T==="100%"&&(S.documentElement.setAttribute("width",p+"px"),S.documentElement.setAttribute("height",m+"px")),new XMLSerializer().serializeToString(S)},e.replaceColors=function(E,S){var w=new DOMParser().parseFromString(E,"image/svg+xml");const _=h(w),y=Array.from(S.keys()),p=s(w);return _.forEach(m=>{const{fill:P,stroke:T}=u(m,p);[{prop:"fill",color:P},{prop:"stroke",color:T}].forEach(({prop:k,color:L})=>{const I=y.find(R=>(0,e.sameColors)(R,L));if(I){const R=S.get(I);if((0,a.isGradient)(R)){const{rotation:A,stops:O}=(0,a.parseColor)(R),M=O.map(D=>({offset:100*D.offset+"%","stop-color":D.color})),q="color"+Math.round(1e8*Math.random());(function(D,te,H,B){var $=D.namespaceURI,V=document.createElementNS($,"linearGradient");const j=t.default.Util.degToRad(H+90),z=(Math.cos(j)+1)/2,F=(Math.sin(j)+1)/2,Y=(Math.cos(j+Math.PI)+1)/2,J=(Math.sin(j+Math.PI)+1)/2;V.setAttribute("x1",100*z+"%"),V.setAttribute("y1",100*F+"%"),V.setAttribute("x2",100*Y+"%"),V.setAttribute("y2",100*J+"%"),V.setAttribute("gradientUnits","userSpaceOnUse"),V.setAttribute("id",te);for(var X=0;X<B.length;X++){var Q=B[X],ae=document.createElementNS($,"stop");for(var se in Q)Q.hasOwnProperty(se)&&ae.setAttribute(se,Q[se]);V.appendChild(ae)}(D.querySelector("defs")||D.insertBefore(document.createElementNS($,"defs"),D.firstChild)).appendChild(V)})(w.children[0],q,A,M),m.style[k]=null,m.setAttribute(k,`url('#${q}')`)}else m.style[k]=S.get(I)}})}),f(new XMLSerializer().serializeToString(w))};const t=r(Hs()),n=r(ai()),a=pm(),i=r(DA());function o(E){for(;E.parentNode;){if(E.nodeName==="defs")return!0;E=E.parentNode}return!1}function s(E){const S={};return E.querySelectorAll("style").forEach(w=>{const _=i.default.parse(w.textContent).stylesheet.rules;for(let y of _)y.selectors&&y.selectors.forEach(p=>{const m=S[p]||{};y.declarations.forEach(P=>{m[P.name]=P.value}),S[p]=m})}),S}function u(E,S){var w;const _={fill:"",stroke:""},y=((w=E.getAttribute("class"))===null||w===void 0?void 0:w.split(" "))||[],p=E.getAttribute("id");let m={};if(p&&S[`#${p}`]?m=S[`#${p}`]:y.forEach(P=>{S[`.${P}`]&&(m=Object.assign(Object.assign({},m),S[`.${P}`]))}),S[E.nodeName]&&(m=Object.assign(Object.assign({},m),S[E.nodeName])),E.getAttribute("fill")&&E.getAttribute("fill")!=="none"?_.fill=E.getAttribute("fill"):m.fill&&m.fill!=="none"&&(_.fill=m.fill),E.getAttribute("stroke")&&E.getAttribute("stroke")!=="none"?_.stroke=E.getAttribute("stroke"):m.stroke&&m.stroke!=="none"&&(_.stroke=m.stroke),!_.fill&&E.style.fill&&E.style.fill!=="none"&&(_.fill=E.style.fill),!_.stroke&&E.style.stroke&&E.style.stroke!=="none"&&(_.stroke=E.style.stroke),!_.stroke&&!_.fill){const P=E.ownerSVGElement,T=P&&P!==E&&u(P,S);T?.fill==="currentColor"||T?.stroke==="currentColor"||(_.fill="black")}return _}const c=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(E){for(var S=[],w=E.getElementsByTagName("*"),_=0,y=w.length;_<y;_++){const p=w[_];o(p)||(p.getAttribute("fill")!==null&&S.push(p),(p.getAttribute("stroke")!==null||p.style&&p.style.fill||c.indexOf(p.nodeName)>=0)&&S.push(p))}return S}async function v(E){return await(await fetch(E,{mode:"cors"})).text()}function g(E){var S=new DOMParser().parseFromString(E,"image/svg+xml");const w=s(S),_=h(S),y=[];return _.forEach(p=>{const{fill:m,stroke:P}=u(p,w);[m,P].forEach(T=>{T&&(T==="currentColor"&&(T="black"),t.default.Util.colorToRGBA(T)&&y.indexOf(T)===-1&&y.push(T))})}),y}function f(E){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(E)))}e.sameColors=(E,S)=>{if(!E||!S)return!1;if(S==="currentColor"&&E==="black")return!0;const w=t.default.Util.colorToRGBA(E),_=t.default.Util.colorToRGBA(S);return w&&_?w.r===_.r&&w.g===_.g&&w.b===_.b&&w.a===_.a:void 0},e.useSvgColors=E=>{const[S,w]=n.default.useState([]);return n.default.useEffect(()=>{let _=!1;return(async()=>{w([]);const y=g(await v(E));_||w(y)})(),()=>{_=!0}},[E]),S}}(Vd)),Vd}var xg={},Db;function W8(){return Db||(Db=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0,e.trySetCanvasSize=(r,t,n)=>{let a=t,i=n,o=1;for(;a>0&&i>0;){r.width=a,r.height=i;const s=r.getContext("2d");if(!s)return;if(s.fillStyle="rgba(0,0,0,0.1)",s.fillRect(0,0,1,1),s.getImageData(0,0,1,1).data[3]!==0)return void s.clearRect(0,0,r.width,r.height);if(o*=.9,a=Math.floor(t*o),i=Math.floor(n*o),a=Math.max(a,1),i=Math.max(i,1),a<=1&&i<=1)return r.width=1,void(r.height=1)}}}(xg)),xg}var Gd={},Bb;function $8(){return Bb||(Bb=1,function(e){var r=Gd&&Gd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDelayer=void 0;const t=r(ai());e.useDelayer=(n,a=100,i=!1,o)=>{const s=t.default.useRef(o??n),[,u]=t.default.useReducer(v=>v+1,0),c=t.default.useCallback(v=>{s.current!==v&&(s.current=v,u())},[s]),h=t.default.useRef(null);return n===i&&(h.current&&(clearTimeout(h.current),h.current=null),s.current=i),t.default.useEffect(()=>(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(n),h.current=null},a),()=>{h.current&&clearTimeout(h.current)}),[n,a,i]),[s.current,c]}}(Gd)),Gd}var qb;function Om(){return qb||(qb=1,function(e){var r,t=Fl&&Fl.__createBinding||(Object.create?function(D,te,H,B){B===void 0&&(B=H);var $=Object.getOwnPropertyDescriptor(te,H);$&&!("get"in $?!te.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return te[H]}}),Object.defineProperty(D,B,$)}:function(D,te,H,B){B===void 0&&(B=H),D[B]=te[H]}),n=Fl&&Fl.__setModuleDefault||(Object.create?function(D,te){Object.defineProperty(D,"default",{enumerable:!0,value:te})}:function(D,te){D.default=te}),a=Fl&&Fl.__importStar||(r=function(D){return r=Object.getOwnPropertyNames||function(te){var H=[];for(var B in te)Object.prototype.hasOwnProperty.call(te,B)&&(H[H.length]=B);return H},r(D)},function(D){if(D&&D.__esModule)return D;var te={};if(D!=null)for(var H=r(D),B=0;B<H.length;B++)H[B]!=="default"&&t(te,D,H[B]);return n(te,D),te}),i=Fl&&Fl.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useCornerRadiusAndCrop=e.setOuterImageCropTransformerStyle=e.setInnerImageCropTransformerStyle=e.useSizeFixer=void 0;const o=i(ai()),s=Us,u=vs,c=Fu,h=i(t0()),v=i(Hs()),g=Mh,f=jf(),E=a(kp()),S=gc(),w=W8(),_=Ap(),y=If(),p=rf(),m=$8();function P(){return document.createElement("canvas")}const T=D=>D.indexOf("data:image/svg+xml")>=0||D.indexOf(".svg")>=0;function k(D,te){return{x:(D.x+te.x)/2,y:(D.y+te.y)/2}}e.useSizeFixer=D=>{const[te,H]=o.default.useState(D);return o.default.useEffect(()=>{(async()=>{const B=await async function($){if(!T($))return $;const V=await E.urlToString($),j=E.fixSize(V);return E.svgToURL(j)}(D);B!==te&&H(B)})()},[D]),te};const L={boundBoxFunc:(D,te)=>te.width<5||te.height<5?D:te,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2};e.setInnerImageCropTransformerStyle=D=>{Object.assign(L,D)};const I={boundBoxFunc:(D,te)=>te.width<5||te.height<5?D:te,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2};e.setOuterImageCropTransformerStyle=D=>{Object.assign(I,D)};const R=(D,te,H)=>Math.max(te,Math.min(H,D));e.useCornerRadiusAndCrop=(D,te,H,B,$=0,V=!1,j=!0)=>{const z=Math.floor(R(D.a.width*B,1,1e4)),F=Math.floor(R(D.a.height*B,1,1e4)),Y=Math.min($*B,z/2,F/2),J=Math.max(D.a.width/H.width,D.a.height/H.height)*B,X=D.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&J<1&&!V,Q=H.x===0&&H.y===0&&H.width===te?.width&&H.height===te?.height,ae=o.default.useMemo(()=>{if(te&&te.width&&te.height)return Q&&Y===0&&!X?void 0:P()},[te,Y,X,Q]);return o.default.useLayoutEffect(()=>{if(!ae||!te)return;(0,w.trySetCanvasSize)(ae,z,F);const se=ae.getContext("2d");if(!se)return;Y&&(se.beginPath(),se.moveTo(Y,0),se.lineTo(z-Y,0),se.arc(z-Y,Y,Y,3*Math.PI/2,0,!1),se.lineTo(z,F-Y),se.arc(z-Y,F-Y,Y,0,Math.PI/2,!1),se.lineTo(Y,F),se.arc(Y,F-Y,Y,Math.PI/2,Math.PI,!1),se.lineTo(0,Y),se.arc(Y,Y,Y,Math.PI,3*Math.PI/2,!1),se.clip());const fe=X?function(_e,Ae){var Re,Pe;const ye=P();ye.width=_e.width,ye.height=_e.height;const nt=Math.max(1,Math.floor(ye.width*Ae)),Ce=Math.max(1,Math.floor(ye.height*Ae));(Re=ye.getContext("2d"))===null||Re===void 0||Re.drawImage(_e,0,0,ye.width,ye.height);const he=function(ke,Te,ve,Se,je,Ue,ct){for(var mt=new ImageData(Te,ve),yt=new Int32Array(ke.data.buffer),Je=ke.width,lt=new Int32Array(mt.data.buffer),ze=mt.width,kt=Te/Ue,pt=ve/ct,Ut=Math.round(1/kt),Ht=Math.round(1/pt),Me=Ut*Ht,Oe=0;Oe<mt.height;Oe++)for(var it=0;it<ze;it++){for(var Lt=0+Math.round(it/kt)+(0+Math.round(Oe/pt))*Je,At=0,xt=0,Jt=0,nr=0,Rt=0;Rt<Ht;Rt++)for(var Xt=0;Xt<Ut;Xt++){var Rr=yt[Lt+Xt+Rt*Je];At+=Rr<<24>>>24,xt+=Rr<<16>>>24,Jt+=Rr<<8>>>24,nr+=Rr>>>24}At=Math.round(At/Me),xt=Math.round(xt/Me),Jt=Math.round(Jt/Me),nr=Math.round(nr/Me),lt[it+Oe*ze]=nr<<24|Jt<<16|xt<<8|At}return mt}(ye.getContext("2d").getImageData(0,0,ye.width,ye.height),nt,Ce,0,0,ye.width,ye.height);return ye.width=nt,ye.height=Ce,(Pe=ye.getContext("2d"))===null||Pe===void 0||Pe.putImageData(he,0,0),ye}(te,J):te,be=X?{x:Math.floor(H.x*J),y:Math.floor(H.y*J),width:Math.floor(H.width*J),height:Math.floor(H.height*J)}:H;se.drawImage(fe,be.x,be.y,be.width,be.height,0,0,ae.width,ae.height)},[ae,D.a.width,D.a.height,H.x,H.y,H.width,H.height,$,B,V,D.page._exportingOrRendering,X]),o.default.useEffect(()=>()=>{ae&&ae.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(ae)},[ae]),ae||te};const A=P(),O=(0,s.observer)(({element:D})=>{const te=Math.min(30,D.a.width/4,D.a.height/4),H=o.default.useRef(null);return o.default.useEffect(()=>{const B=H.current;if(!B)return;const $=new v.default.Animation(V=>{B.rotate((V?.timeDiff||0)/2)},B.getLayer());return $.start(),()=>{$.stop()}}),o.default.createElement(c.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},o.default.createElement(c.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(c.Arc,{ref:H,x:D.a.width/2,y:D.a.height/2,fill:"white",outerRadius:Math.abs(te),innerRadius:Math.max(1,te-5),angle:270}))}),M=(0,s.observer)(({element:D})=>{const te=Math.max(10,Math.min(30,D.a.width/25));return o.default.createElement(c.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},o.default.createElement(c.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(c.Text,{text:"Can not load the image...",fontSize:te,width:D.a.width,height:D.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let q=h.default;e.setImageLoaderHook=D=>{q=D},e.useImageLoader=(D,te="",H="")=>{const B=o.default.useRef(),$=()=>{var V;(V=B.current)===null||V===void 0||V.call(B),B.current=void 0};o.default.useEffect(()=>$,[]),o.default.useLayoutEffect(()=>{const V=te.slice(0,200),j=`image with id ${H} url: ${V}`;D!=="loading"||B.current||(B.current=(0,f.incrementLoader)(j)),D!=="loading"&&$(),D==="failed"&&(0,f.triggerLoadError)(j)},[D])},e.ImageElement=(0,s.observer)(({element:D,store:te})=>{var H;const[B,$]=o.default.useState(!1),V=o.default.useRef(null),j=o.default.useRef(null),z=te.selectedShapes.indexOf(D)>=0&&D.selectable,[F,Y]=(Ze=>{const[bt,Vt]=o.default.useReducer(St=>St+1,0),wt=o.default.useRef("loading"),Kt=o.default.useRef(Ze.src),Yt=o.default.useRef(Ze.src);Yt.current!==Ze.src&&(Yt.current=Ze.src,wt.current="loading");const ut=o.default.useMemo(()=>T(Ze.src)||Ze.type==="svg",[Ze.src,Ze.type]);return o.default.useEffect(()=>{if(!ut||!Ze.src)return;let St=!1;return(async()=>{wt.current="loading",Vt();const Et=await E.urlToString(Ze.src),et=E.fixSize(Et);let qt;qt=Ze.colorsReplace?E.replaceColors(et,Ze.colorsReplace||new Map):E.svgToURL(et),St||(Kt.current=qt,wt.current="loaded",Vt())})(),()=>{St=!0}},[Ze.src,JSON.stringify(Ze.colorsReplace)]),ut?[Kt.current,wt.current]:[Ze.src,"loaded"]})(D),[J,X]=q(F,"anonymous"),Q=D.type!=="svg"||Y==="loaded"?X:"loading";(0,e.useImageLoader)(Q,D.src,D.id);const ae=D.page._exportingOrRendering?1:Math.max(1,te.scale),se=te._elementsPixelRatio*ae,fe=(({image:Ze,status:bt,type:Vt})=>{const wt=o.default.useRef();return o.default.useEffect(()=>{wt.current=Ze||wt.current},[Ze]),bt!=="failed"||bt!=="failed"&&Vt==="svg"?wt.current:void 0})({image:J,status:X,type:D.type}),be=((Ze,bt,Vt)=>{const wt=o.default.useMemo(()=>{var Kt,Yt;const{flipX:ut,flipY:St}=Ze,Et=Ze.type==="svg"||Ze.src.indexOf("data:image/svg+xml")>=0||Ze.src.indexOf(".svg")>=0,et=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,qt=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||et)&&Et||Ze.maskSrc;if(!ut&&!St&&!qt)return bt;if(!bt||!bt.width||!bt.height)return null;const gt=P();let Ft=1;Ze.type==="svg"&&(Ft=Math.max(Ze.a.width/bt.width*Vt,Ze.a.height/bt.height*Vt)),(0,w.trySetCanvasSize)(gt,Math.max(bt.width*Ft,1),Math.max(bt.height*Ft,1));let br=ut?-gt.width:0,hr=St?-gt.height:0;return(Kt=gt.getContext("2d"))===null||Kt===void 0||Kt.scale(ut?-1:1,St?-1:1),(Yt=gt.getContext("2d"))===null||Yt===void 0||Yt.drawImage(bt,br,hr,gt.width,gt.height),gt},[Ze.maskSrc,Ze.flipX,Ze.flipY,bt,Ze.a.width,Ze.a.height,Vt]);return o.default.useEffect(()=>()=>{wt&&wt.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(wt)},[wt]),wt})(D,J||fe,se),_e=((Ze,bt)=>{const Vt=(0,e.useSizeFixer)(Ze.maskSrc||""),[wt,Kt]=q(Vt,"anonymous"),Yt=Vt?Kt:"loaded";return(0,e.useImageLoader)(Yt,Vt||"",Ze.id),o.default.useMemo(()=>{if(!wt||!bt||!bt.width||!bt.height)return bt;const ut=P();ut.width=Math.max(bt.width,1),ut.height=Math.max(bt.height,1);const St=ut.getContext("2d");if(!St)return bt;St.drawImage(bt,0,0),St.globalCompositeOperation="source-in";const Et=function(et,qt){const gt=qt.width/qt.height;let Ft,br;return gt>=et.width/et.height?(Ft=et.width,br=et.width/gt):(Ft=et.height*gt,br=et.height),{x:(et.width-Ft)/2,y:(et.height-br)/2,width:Ft,height:br}}(wt,Ze);return St.drawImage(wt,Et.x,Et.y,Et.width,Et.height,0,0,bt.width,bt.height),ut},[bt,wt,Ze.a.width,Ze.a.height])})(D,be)||A;let{cropX:Ae,cropY:Re,cropWidth:Pe,cropHeight:ye}=D.a;X!=="loaded"&&(Ae=Re=0,Pe=ye=1);const nt=_e.width*Pe,Ce=_e.height*ye,he=D.a.width/D.a.height;let ke,Te;const ve=nt/Ce,Se=D.stretchEnabled;Se?(ke=nt,Te=Ce):he>=ve?(ke=nt,Te=nt/he):(ke=Ce*he,Te=Ce);const je={x:_e.width*Ae,y:_e.height*Re,width:ke,height:Te},Ue=(H=D.cornerRadius)!==null&&H!==void 0?H:0,ct=D.page._exportingOrRendering?1:Math.min(2,te.scale),mt=te._elementsPixelRatio*ct;let yt=((Ze,bt,Vt,wt)=>{const Kt=(0,e.useSizeFixer)(Ze.clipSrc||""),[Yt,ut]=q(Kt,"anonymous"),St=Ze.clipSrc?ut:"loaded";(0,e.useImageLoader)(St,Ze.clipSrc,Ze.id);const Et=o.default.useMemo(()=>{if(bt&&Yt)return P()},[bt,Yt]);return o.default.useLayoutEffect(()=>{var et;if(!Yt||!bt||!bt.width||!bt.height||!Yt||!Yt.width||!Yt.height||!Et)return;const qt=P(),gt=Math.max(Ze.a.width/Yt.width*Vt,Ze.a.height/Yt.height*Vt);qt.width=Math.max(Yt.width*gt,1),qt.height=Math.max(Yt.height*gt,1),(et=qt.getContext("2d"))===null||et===void 0||et.drawImage(Yt,0,0,qt.width,qt.height),Et.width=Math.max(bt.width,1),Et.height=Math.max(bt.height,1);const Ft=Et.getContext("2d");Ft&&(Ft.save(),Ft.drawImage(qt,0,0,bt.width,bt.height),v.default.Util.releaseCanvas(qt),Ft.globalCompositeOperation="source-in",Ft.drawImage(bt,0,0,Et.width,Et.height),Ft.restore())},[Et,bt,Yt,Ze.a.width,Ze.a.height,Vt,...wt]),Ze.clipSrc&&Yt?Et:bt})(D,(0,e.useCornerRadiusAndCrop)(D,_e,je,mt,Ue,B||D._cropModeEnabled||D.type==="svg",!0),mt,[je,Ue,mt]);const Je=Math.max(D.a.width/ke,D.a.height/Te);o.default.useEffect(()=>{var Ze;if(!D._cropModeEnabled)return;const bt=(Ze=V.current)===null||Ze===void 0?void 0:Ze.getStage();function Vt(Kt){D._cropModeEnabled&&Kt.target!==j.current&&D.toggleCropMode(!1)}function wt(Kt){D._cropModeEnabled&&Kt.target.parentNode!==bt.content&&D.toggleCropMode(!1)}return document.body.addEventListener("click",wt),bt?.on("click",Vt),bt?.on("tap",Vt),()=>{document.body.removeEventListener("click",wt),document.body.removeEventListener("touchstart",wt),bt?.off("click",Vt),bt?.off("click",Vt)}},[D._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!B&&!D._cropModeEnabled)return(0,_.applyFilter)(V.current,D),(0,u.autorun)(()=>{(0,_.applyFilter)(V.current,D)},{delay:100})},[yt,D.page._exportingOrRendering,B,Pe,ye,D._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ze;B||D._cropModeEnabled?(Ze=V.current)===null||Ze===void 0||Ze.clearCache():(0,_.applyFilter)(V.current,D)},[B,D.a.width,D.a.height,D._cropModeEnabled]),o.default.useEffect(()=>{(0,_.applyFilter)(V.current,D)},[D.shadowEnabled,D.shadowBlur,D.cornerRadius,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);const lt=o.default.useRef(null),ze=o.default.useRef(null),kt=o.default.useRef(null);o.default.useLayoutEffect(()=>{D._cropModeEnabled&&(ze.current.nodes([lt.current]),kt.current.nodes([j.current]))},[D._cropModeEnabled]);var pt=o.default.useRef(null),Ut=o.default.useRef(0),Ht=o.default.useRef(!1);const Me=Ze=>{var bt;((bt=Ze.evt.touches)===null||bt===void 0?void 0:bt.length)>2&&Ze.target.stopDrag(),Math.round(Ze.target.x())>0&&(Ze.target.x(0),Ze.target.scaleX(1)),Math.round(Ze.target.y())>0&&(Ze.target.y(0),Ze.target.scaleY(1));const Vt=Ze.target.width()*Ze.target.scaleX(),wt=Ze.target.height()*Ze.target.scaleY(),Kt=Math.min(1,ke/Vt),Yt=Math.min(1,Te/wt),ut=1-Kt,St=Math.min(ut,Math.max(0,Math.round(-Ze.target.x())/Vt)),Et=1-Yt,et=Math.min(Et,Math.max(0,Math.round(-Ze.target.y())/wt));Ze.target.setAttrs({x:-St*_e.width,y:-et*_e.height,scaleX:1,scaleY:1}),D.set({cropX:St,cropY:et,cropWidth:Kt,cropHeight:Yt})},Oe=()=>{D.type!=="svg"&&D.contentEditable&&(D.stretchEnabled||setTimeout(()=>{D.toggleCropMode(!0)}))},it=D.type==="svg"&&fe,Lt=X==="loading"&&!it,[At]=(0,m.useDelayer)(Lt,100,!1,!1),xt=X==="failed",Jt=!At&&!xt,nr=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Rt=Jt?D.a.opacity:0;(0,y.useFadeIn)(V,Rt);const Xt=D.selectable||te.role==="admin",Rr=(0,p.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,At&&o.default.createElement(O,{element:D}),xt&&o.default.createElement(M,{element:D}),o.default.createElement(c.Image,{ref:V,name:"element",id:D.id,image:yt,x:D.a.x,y:D.a.y,width:D.a.width||1,height:D.a.height||1,rotation:D.a.rotation,opacity:Rt,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,customCrop:je,listening:Xt,draggable:Rr?D.draggable&&z:D.draggable,preventDefault:!Rr||z,hideInExport:!D.showInExport,onDragMove:Ze=>{D.set({x:Ze.target.x(),y:Ze.target.y()})},onDragEnd:Ze=>{D.set({x:Ze.target.x(),y:Ze.target.y()})},onDblClick:Oe,onDblTap:Oe,onTransformStart:()=>{$(!0),nr.current={cropX:D.cropX,cropY:D.cropY,cropWidth:D.cropWidth,cropHeight:D.cropHeight}},onTransform:Ze=>{var bt;const Vt=Ze.currentTarget,wt=Math.abs(Vt.scaleX()-1)<1e-7?1:Vt.scaleX(),Kt=Math.abs(Vt.scaleY()-1)<1e-7?1:Vt.scaleY();Vt.scaleX(1),Vt.scaleY(1);const Yt=(bt=Ze.target.getStage())===null||bt===void 0?void 0:bt.findOne("Transformer"),ut=1-ke/_e.width,St=Math.min(ut,Math.max(0,D.cropX)),Et=1-Te/_e.height,et=Math.min(Et,Math.max(0,D.cropY)),qt=Yt.getActiveAnchor(),gt=!(qt.indexOf("middle")>=0||qt.indexOf("center")>=0),Ft=!gt&&wt<1&&nr.current.cropHeight>Te/_e.height;let br=gt?D.cropWidth:D.cropWidth*wt;Ft&&(br=D.cropWidth);const hr=!gt&&Kt<1&&nr.current.cropWidth>ke/_e.width;let Qr=gt?D.cropHeight:D.cropHeight*Kt;hr&&(Qr=D.cropHeight),Se&&(br=D.cropWidth,Qr=D.cropHeight),D.set({cropX:St,cropY:et,x:Vt.x(),y:Vt.y(),width:Vt.width()*wt,height:Vt.height()*Kt,rotation:Ze.target.rotation(),cropWidth:Math.min(br,1-St),cropHeight:Math.min(Qr,1-et)})},onTransformEnd:Ze=>{const bt=Ze.currentTarget;D.set({width:bt.width(),height:bt.height(),x:bt.x(),y:bt.y(),rotation:Ze.target.rotation(),cropWidth:ke/_e.width,cropHeight:Te/_e.height}),$(!1)}}),o.default.createElement(c.Rect,{x:D.x,y:D.y,width:Math.max(D.a.width-D.borderSize,0),height:Math.max(D.a.height-D.borderSize,0),opacity:Rt,offsetX:-D.borderSize/2,offsetY:-D.borderSize/2,stroke:D.borderColor,strokeWidth:D.borderSize,listening:!1,visible:!!D.borderSize,rotation:D.rotation,cornerRadius:Math.max(0,Ue-D.borderSize),hideInExport:!D.showInExport}),D._cropModeEnabled&&o.default.createElement(g.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/te.scale,y:-window.innerWidth/te.scale,width:window.innerWidth/te.scale*3,height:window.innerWidth/te.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:yt,x:D.x,y:D.y,width:D.a.width,height:D.a.height,rotation:D.rotation,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur}),o.default.createElement(c.Group,{x:D.x,y:D.y,rotation:D.rotation,scaleX:Je,scaleY:Je},o.default.createElement(c.Image,{image:_e,ref:j,opacity:.4,draggable:!0,x:-D.cropX*_e.width,y:-D.cropY*_e.height,onDragMove:Me,onTransform:Me,onTouchMove:Ze=>{Ze.evt.preventDefault();const bt=Ze.target.getStage().getPointersPositions();var Vt=bt[0],wt=bt[1];const Kt=Ze.target;if(Vt&&!wt&&!Kt.isDragging()&&Ht.current&&(Kt.startDrag(),Ht.current=!1),Vt&&wt){v.default.hitOnDragEnabled=!0,Kt.isDragging()&&(Ht.current=!0,Kt.stopDrag());const hr=Ze.target.getAbsoluteTransform().copy();hr.invert();var Yt={x:Vt.x,y:Vt.y},ut={x:wt.x,y:wt.y};if(!pt.current)return void(pt.current=k(Yt,ut));var St=k(Yt,ut),Et=function(Si,fa){return Math.sqrt(Math.pow(fa.x-Si.x,2)+Math.pow(fa.y-Si.y,2))}(Yt,ut);Ut.current||(Ut.current=Et);const Qr=Kt.position();var et={x:St.x-Qr.x,y:St.y-Qr.y},qt=Et/Ut.current;Kt.scaleX(qt),Kt.scaleY(qt);const Sn=hr.point(St),Ni=hr.point(pt.current);var gt=Sn.x-Ni.x,Ft=Sn.y-Ni.y,br={x:Math.min(0,St.x-et.x*qt+gt),y:Math.min(0,St.y-et.y*qt+Ft)};Kt.position(br),Ut.current=Et,pt.current=St,Me(Ze)}},onTouchEnd:Ze=>{Ut.current=0,pt.current=null,v.default.hitOnDragEnabled=!1}}),o.default.createElement(c.Transformer,Object.assign({ref:kt},I)),o.default.createElement(c.Rect,{width:ke,height:Te,ref:lt,listening:!1,onTransform:Ze=>{if(D.cropX<Math.abs(Ze.target.x()/_e.width)&&Ze.target.x()<0&&D.cropX>0){const Et=(D.cropWidth+D.cropX)*_e.width;Ze.target.scaleX(1),Ze.target.width(Et)}if(D.cropY<Math.abs(Ze.target.y()/_e.height)&&Ze.target.y()<0&&D.cropY>0){const Et=(D.cropHeight+D.cropY)*_e.height;Ze.target.scaleY(1),Ze.target.height(Et)}Ze.target.x()<-D.cropX*_e.width-1e-9&&(Ze.target.x(-D.cropX*_e.width),Ze.target.scaleX(1)),Ze.target.y()<-D.cropY*_e.height-1e-9&&(Ze.target.y(-D.cropY*_e.height),Ze.target.scaleY(1));const bt=Math.min(1,Math.max(0,D.cropX+Ze.target.x()/_e.width)),Vt=Math.min(1,Math.max(0,Ze.target.y()/_e.height+D.cropY)),wt=Ze.target.width()*Ze.target.scaleX(),Kt=Ze.target.height()*Ze.target.scaleY(),Yt=Math.min(1-bt,wt/_e.width),ut=Math.min(1-Vt,Kt/_e.height),St=Ze.target.getAbsolutePosition(Ze.target.getParent().getParent());Ze.target.scale({x:1,y:1}),Ze.target.position({x:0,y:0}),D.set({x:St.x,y:St.y,cropX:bt,cropY:Vt,cropWidth:Yt,cropHeight:ut,width:Math.min(wt*Je,_e.width*(1-bt)*Je),height:Math.min(Kt*Je,_e.height*(1-Vt)*Je)})}}),o.default.createElement(c.Transformer,Object.assign({ref:ze},L,{visible:D.resizable})))))})}(Fl)),Fl}var Dl={},y1={exports:{}};/*!
|
|
116
|
+
* Quill Editor v1.3.7
|
|
117
|
+
* https://quilljs.com/
|
|
118
|
+
* Copyright (c) 2014, Jason Chen
|
|
119
|
+
* Copyright (c) 2013, salesforce.com
|
|
120
|
+
*/var BA=y1.exports,zb;function qA(){return zb||(zb=1,function(e,r){(function(n,a){e.exports=a()})(typeof self<"u"?self:BA,function(){return function(t){var n={};function a(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=t,a.c=n,a.d=function(i,o,s){a.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(o,"a",o),o},a.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},a.p="",a(a.s=109)}([function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(17),o=a(18),s=a(19),u=a(45),c=a(46),h=a(47),v=a(48),g=a(49),f=a(12),E=a(32),S=a(33),w=a(31),_=a(1),y={Scope:_.Scope,create:_.create,find:_.find,query:_.query,register:_.register,Container:i.default,Format:o.default,Leaf:s.default,Embed:v.default,Scroll:u.default,Block:h.default,Inline:c.default,Text:g.default,Attributor:{Attribute:f.default,Class:E.default,Style:S.default,Store:w.default}};n.default=y},function(t,n,a){var i=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,y){_.__proto__=y}||function(_,y){for(var p in y)y.hasOwnProperty(p)&&(_[p]=y[p])};return function(_,y){w(_,y);function p(){this.constructor=_}_.prototype=y===null?Object.create(y):(p.prototype=y.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(w){i(_,w);function _(y){var p=this;return y="[Parchment] "+y,p=w.call(this,y)||this,p.message=y,p.name=p.constructor.name,p}return _}(Error);n.ParchmentError=o;var s={},u={},c={},h={};n.DATA_KEY="__blot";var v;(function(w){w[w.TYPE=3]="TYPE",w[w.LEVEL=12]="LEVEL",w[w.ATTRIBUTE=13]="ATTRIBUTE",w[w.BLOT=14]="BLOT",w[w.INLINE=7]="INLINE",w[w.BLOCK=11]="BLOCK",w[w.BLOCK_BLOT=10]="BLOCK_BLOT",w[w.INLINE_BLOT=6]="INLINE_BLOT",w[w.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",w[w.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",w[w.ANY=15]="ANY"})(v=n.Scope||(n.Scope={}));function g(w,_){var y=E(w);if(y==null)throw new o("Unable to create "+w+" blot");var p=y,m=w instanceof Node||w.nodeType===Node.TEXT_NODE?w:p.create(_);return new p(m,_)}n.create=g;function f(w,_){return _===void 0&&(_=!1),w==null?null:w[n.DATA_KEY]!=null?w[n.DATA_KEY].blot:_?f(w.parentNode,_):null}n.find=f;function E(w,_){_===void 0&&(_=v.ANY);var y;if(typeof w=="string")y=h[w]||s[w];else if(w instanceof Text||w.nodeType===Node.TEXT_NODE)y=h.text;else if(typeof w=="number")w&v.LEVEL&v.BLOCK?y=h.block:w&v.LEVEL&v.INLINE&&(y=h.inline);else if(w instanceof HTMLElement){var p=(w.getAttribute("class")||"").split(/\s+/);for(var m in p)if(y=u[p[m]],y)break;y=y||c[w.tagName]}return y==null?null:_&v.LEVEL&y.scope&&_&v.TYPE&y.scope?y:null}n.query=E;function S(){for(var w=[],_=0;_<arguments.length;_++)w[_]=arguments[_];if(w.length>1)return w.map(function(m){return S(m)});var y=w[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new o("Invalid definition");if(y.blotName==="abstract")throw new o("Cannot register abstract class");if(h[y.blotName||y.attrName]=y,typeof y.keyName=="string")s[y.keyName]=y;else if(y.className!=null&&(u[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(m){return m.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var p=Array.isArray(y.tagName)?y.tagName:[y.tagName];p.forEach(function(m){(c[m]==null||y.className==null)&&(c[m]=y)})}return y}n.register=S},function(t,n,a){var i=a(51),o=a(11),s=a(3),u=a(20),c="\0",h=function(v){Array.isArray(v)?this.ops=v:v!=null&&Array.isArray(v.ops)?this.ops=v.ops:this.ops=[]};h.prototype.insert=function(v,g){var f={};return v.length===0?this:(f.insert=v,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(f.attributes=g),this.push(f))},h.prototype.delete=function(v){return v<=0?this:this.push({delete:v})},h.prototype.retain=function(v,g){if(v<=0)return this;var f={retain:v};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(f.attributes=g),this.push(f)},h.prototype.push=function(v){var g=this.ops.length,f=this.ops[g-1];if(v=s(!0,{},v),typeof f=="object"){if(typeof v.delete=="number"&&typeof f.delete=="number")return this.ops[g-1]={delete:f.delete+v.delete},this;if(typeof f.delete=="number"&&v.insert!=null&&(g-=1,f=this.ops[g-1],typeof f!="object"))return this.ops.unshift(v),this;if(o(v.attributes,f.attributes)){if(typeof v.insert=="string"&&typeof f.insert=="string")return this.ops[g-1]={insert:f.insert+v.insert},typeof v.attributes=="object"&&(this.ops[g-1].attributes=v.attributes),this;if(typeof v.retain=="number"&&typeof f.retain=="number")return this.ops[g-1]={retain:f.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},h.prototype.chop=function(){var v=this.ops[this.ops.length-1];return v&&v.retain&&!v.attributes&&this.ops.pop(),this},h.prototype.filter=function(v){return this.ops.filter(v)},h.prototype.forEach=function(v){this.ops.forEach(v)},h.prototype.map=function(v){return this.ops.map(v)},h.prototype.partition=function(v){var g=[],f=[];return this.forEach(function(E){var S=v(E)?g:f;S.push(E)}),[g,f]},h.prototype.reduce=function(v,g){return this.ops.reduce(v,g)},h.prototype.changeLength=function(){return this.reduce(function(v,g){return g.insert?v+u.length(g):g.delete?v-g.delete:v},0)},h.prototype.length=function(){return this.reduce(function(v,g){return v+u.length(g)},0)},h.prototype.slice=function(v,g){v=v||0,typeof g!="number"&&(g=1/0);for(var f=[],E=u.iterator(this.ops),S=0;S<g&&E.hasNext();){var w;S<v?w=E.next(v-S):(w=E.next(g-S),f.push(w)),S+=u.length(w)}return new h(f)},h.prototype.compose=function(v){var g=u.iterator(this.ops),f=u.iterator(v.ops),E=[],S=f.peek();if(S!=null&&typeof S.retain=="number"&&S.attributes==null){for(var w=S.retain;g.peekType()==="insert"&&g.peekLength()<=w;)w-=g.peekLength(),E.push(g.next());S.retain-w>0&&f.next(S.retain-w)}for(var _=new h(E);g.hasNext()||f.hasNext();)if(f.peekType()==="insert")_.push(f.next());else if(g.peekType()==="delete")_.push(g.next());else{var y=Math.min(g.peekLength(),f.peekLength()),p=g.next(y),m=f.next(y);if(typeof m.retain=="number"){var P={};typeof p.retain=="number"?P.retain=y:P.insert=p.insert;var T=u.attributes.compose(p.attributes,m.attributes,typeof p.retain=="number");if(T&&(P.attributes=T),_.push(P),!f.hasNext()&&o(_.ops[_.ops.length-1],P)){var k=new h(g.rest());return _.concat(k).chop()}}else typeof m.delete=="number"&&typeof p.retain=="number"&&_.push(m)}return _.chop()},h.prototype.concat=function(v){var g=new h(this.ops.slice());return v.ops.length>0&&(g.push(v.ops[0]),g.ops=g.ops.concat(v.ops.slice(1))),g},h.prototype.diff=function(v,g){if(this.ops===v.ops)return new h;var f=[this,v].map(function(y){return y.map(function(p){if(p.insert!=null)return typeof p.insert=="string"?p.insert:c;var m=y===v?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),E=new h,S=i(f[0],f[1],g),w=u.iterator(this.ops),_=u.iterator(v.ops);return S.forEach(function(y){for(var p=y[1].length;p>0;){var m=0;switch(y[0]){case i.INSERT:m=Math.min(_.peekLength(),p),E.push(_.next(m));break;case i.DELETE:m=Math.min(p,w.peekLength()),w.next(m),E.delete(m);break;case i.EQUAL:m=Math.min(w.peekLength(),_.peekLength(),p);var P=w.next(m),T=_.next(m);o(P.insert,T.insert)?E.retain(m,u.attributes.diff(P.attributes,T.attributes)):E.push(T).delete(m);break}p-=m}}),E.chop()},h.prototype.eachLine=function(v,g){g=g||`
|
|
121
|
+
`;for(var f=u.iterator(this.ops),E=new h,S=0;f.hasNext();){if(f.peekType()!=="insert")return;var w=f.peek(),_=u.length(w)-f.peekLength(),y=typeof w.insert=="string"?w.insert.indexOf(g,_)-_:-1;if(y<0)E.push(f.next());else if(y>0)E.push(f.next(y));else{if(v(E,f.next(1).attributes||{},S)===!1)return;S+=1,E=new h}}E.length()>0&&v(E,{},S)},h.prototype.transform=function(v,g){if(g=!!g,typeof v=="number")return this.transformPosition(v,g);for(var f=u.iterator(this.ops),E=u.iterator(v.ops),S=new h;f.hasNext()||E.hasNext();)if(f.peekType()==="insert"&&(g||E.peekType()!=="insert"))S.retain(u.length(f.next()));else if(E.peekType()==="insert")S.push(E.next());else{var w=Math.min(f.peekLength(),E.peekLength()),_=f.next(w),y=E.next(w);if(_.delete)continue;y.delete?S.push(y):S.retain(w,u.attributes.transform(_.attributes,y.attributes,g))}return S.chop()},h.prototype.transformPosition=function(v,g){g=!!g;for(var f=u.iterator(this.ops),E=0;f.hasNext()&&E<=v;){var S=f.peekLength(),w=f.peekType();if(f.next(),w==="delete"){v-=Math.min(S,v-E);continue}else w==="insert"&&(E<v||!g)&&(v+=S);E+=S}return v},t.exports=h},function(t,n){var a=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(f){return typeof Array.isArray=="function"?Array.isArray(f):i.call(f)==="[object Array]"},c=function(f){if(!f||i.call(f)!=="[object Object]")return!1;var E=a.call(f,"constructor"),S=f.constructor&&f.constructor.prototype&&a.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!E&&!S)return!1;var w;for(w in f);return typeof w>"u"||a.call(f,w)},h=function(f,E){o&&E.name==="__proto__"?o(f,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):f[E.name]=E.newValue},v=function(f,E){if(E==="__proto__")if(a.call(f,E)){if(s)return s(f,E).value}else return;return f[E]};t.exports=function g(){var f,E,S,w,_,y,p=arguments[0],m=1,P=arguments.length,T=!1;for(typeof p=="boolean"&&(T=p,p=arguments[1]||{},m=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});m<P;++m)if(f=arguments[m],f!=null)for(E in f)S=v(p,E),w=v(f,E),p!==w&&(T&&w&&(c(w)||(_=u(w)))?(_?(_=!1,y=S&&u(S)?S:[]):y=S&&c(S)?S:{},h(p,{name:E,newValue:g(T,y,w)})):typeof w<"u"&&h(p,{name:E,newValue:w}));return p}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var i=function(){function A(O,M){for(var q=0;q<M.length;q++){var D=M[q];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,M,q){return M&&A(O.prototype,M),q&&A(O,q),O}}(),o=function A(O,M,q){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,M);if(D===void 0){var te=Object.getPrototypeOf(O);return te===null?void 0:A(te,M,q)}else{if("value"in D)return D.value;var H=D.get;return H===void 0?void 0:H.call(q)}},s=a(3),u=p(s),c=a(2),h=p(c),v=a(0),g=p(v),f=a(16),E=p(f),S=a(6),w=p(S),_=a(7),y=p(_);function p(A){return A&&A.__esModule?A:{default:A}}function m(A,O){if(!(A instanceof O))throw new TypeError("Cannot call a class as a function")}function P(A,O){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:A}function T(A,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);A.prototype=Object.create(O&&O.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(A,O):A.__proto__=O)}var k=1,L=function(A){T(O,A);function O(){return m(this,O),P(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return i(O,[{key:"attach",value:function(){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"attach",this).call(this),this.attributes=new g.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(q,D){var te=g.default.query(q,g.default.Scope.BLOCK_ATTRIBUTE);te!=null&&this.attributes.attribute(te,D)}},{key:"formatAt",value:function(q,D,te,H){this.format(te,H)}},{key:"insertAt",value:function(q,D,te){if(typeof D=="string"&&D.endsWith(`
|
|
122
|
+
`)){var H=g.default.create(I.blotName);this.parent.insertBefore(H,q===0?this:this.next),H.insertAt(0,D.slice(0,-1))}else o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,q,D,te)}}]),O}(g.default.Embed);L.scope=g.default.Scope.BLOCK_BLOT;var I=function(A){T(O,A);function O(M){m(this,O);var q=P(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,M));return q.cache={},q}return i(O,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(g.default.Leaf).reduce(function(q,D){return D.length()===0?q:q.insert(D.value(),R(D))},new h.default).insert(`
|
|
123
|
+
`,R(this))),this.cache.delta}},{key:"deleteAt",value:function(q,D){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,q,D),this.cache={}}},{key:"formatAt",value:function(q,D,te,H){D<=0||(g.default.query(te,g.default.Scope.BLOCK)?q+D===this.length()&&this.format(te,H):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,q,Math.min(D,this.length()-q-1),te,H),this.cache={})}},{key:"insertAt",value:function(q,D,te){if(te!=null)return o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,q,D,te);if(D.length!==0){var H=D.split(`
|
|
124
|
+
`),B=H.shift();B.length>0&&(q<this.length()-1||this.children.tail==null?o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(q,this.length()-1),B):this.children.tail.insertAt(this.children.tail.length(),B),this.cache={});var $=this;H.reduce(function(V,j){return $=$.split(V,!0),$.insertAt(0,j),j.length},q+B.length)}}},{key:"insertBefore",value:function(q,D){var te=this.children.head;o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,q,D),te instanceof E.default&&te.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+k),this.cache.length}},{key:"moveChildren",value:function(q,D){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,q,D),this.cache={}}},{key:"optimize",value:function(q){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,q),this.cache={}}},{key:"path",value:function(q){return o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,q,!0)}},{key:"removeChild",value:function(q){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"removeChild",this).call(this,q),this.cache={}}},{key:"split",value:function(q){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D&&(q===0||q>=this.length()-k)){var te=this.clone();return q===0?(this.parent.insertBefore(te,this),this):(this.parent.insertBefore(te,this.next),te)}else{var H=o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,q,D);return this.cache={},H}}}]),O}(g.default.Block);I.blotName="block",I.tagName="P",I.defaultChild="break",I.allowedChildren=[w.default,g.default.Embed,y.default];function R(A){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(O=(0,u.default)(O,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?O:R(A.parent,O)}n.bubbleFormats=R,n.BlockEmbed=L,n.default=I},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(V,j){var z=[],F=!0,Y=!1,J=void 0;try{for(var X=V[Symbol.iterator](),Q;!(F=(Q=X.next()).done)&&(z.push(Q.value),!(j&&z.length===j));F=!0);}catch(ae){Y=!0,J=ae}finally{try{!F&&X.return&&X.return()}finally{if(Y)throw J}}return z}return function(V,j){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return $(V,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function $(V,j){for(var z=0;z<j.length;z++){var F=j[z];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(V,F.key,F)}}return function(V,j,z){return j&&$(V.prototype,j),z&&$(V,z),V}}();a(50);var u=a(2),c=R(u),h=a(14),v=R(h),g=a(8),f=R(g),E=a(9),S=R(E),w=a(0),_=R(w),y=a(15),p=R(y),m=a(3),P=R(m),T=a(10),k=R(T),L=a(34),I=R(L);function R($){return $&&$.__esModule?$:{default:$}}function A($,V,j){return V in $?Object.defineProperty($,V,{value:j,enumerable:!0,configurable:!0,writable:!0}):$[V]=j,$}function O($,V){if(!($ instanceof V))throw new TypeError("Cannot call a class as a function")}var M=(0,k.default)("quill"),q=function(){s($,null,[{key:"debug",value:function(j){j===!0&&(j="log"),k.default.level(j)}},{key:"find",value:function(j){return j.__quill||_.default.find(j)}},{key:"import",value:function(j){return this.imports[j]==null&&M.error("Cannot import "+j+". Are you sure it was registered?"),this.imports[j]}},{key:"register",value:function(j,z){var F=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof j!="string"){var J=j.attrName||j.blotName;typeof J=="string"?this.register("formats/"+J,j,z):Object.keys(j).forEach(function(X){F.register(X,j[X],z)})}else this.imports[j]!=null&&!Y&&M.warn("Overwriting "+j+" with",z),this.imports[j]=z,(j.startsWith("blots/")||j.startsWith("formats/"))&&z.blotName!=="abstract"?_.default.register(z):j.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function $(V){var j=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,$),this.options=D(V,z),this.container=this.options.container,this.container==null)return M.error("Invalid Quill container",V);this.options.debug&&$.debug(this.options.debug);var F=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new f.default,this.scroll=_.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new p.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(f.default.events.EDITOR_CHANGE,function(J){J===f.default.events.TEXT_CHANGE&&j.root.classList.toggle("ql-blank",j.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(J,X){var Q=j.selection.lastRange,ae=Q&&Q.length===0?Q.index:void 0;te.call(j,function(){return j.editor.update(null,X,ae)},J)});var Y=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+F+"<p><br></p></div>");this.setContents(Y),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s($,[{key:"addContainer",value:function(j){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof j=="string"){var F=j;j=document.createElement("div"),j.classList.add(F)}return this.container.insertBefore(j,z),j}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(j,z,F){var Y=this,J=H(j,z,F),X=o(J,4);return j=X[0],z=X[1],F=X[3],te.call(this,function(){return Y.editor.deleteText(j,z)},F,j,-1*z)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(j),this.container.classList.toggle("ql-disabled",!j)}},{key:"focus",value:function(){var j=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=j,this.scrollIntoView()}},{key:"format",value:function(j,z){var F=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return te.call(this,function(){var J=F.getSelection(!0),X=new c.default;if(J==null)return X;if(_.default.query(j,_.default.Scope.BLOCK))X=F.editor.formatLine(J.index,J.length,A({},j,z));else{if(J.length===0)return F.selection.format(j,z),X;X=F.editor.formatText(J.index,J.length,A({},j,z))}return F.setSelection(J,f.default.sources.SILENT),X},Y)}},{key:"formatLine",value:function(j,z,F,Y,J){var X=this,Q=void 0,ae=H(j,z,F,Y,J),se=o(ae,4);return j=se[0],z=se[1],Q=se[2],J=se[3],te.call(this,function(){return X.editor.formatLine(j,z,Q)},J,j,0)}},{key:"formatText",value:function(j,z,F,Y,J){var X=this,Q=void 0,ae=H(j,z,F,Y,J),se=o(ae,4);return j=se[0],z=se[1],Q=se[2],J=se[3],te.call(this,function(){return X.editor.formatText(j,z,Q)},J,j,0)}},{key:"getBounds",value:function(j){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=void 0;typeof j=="number"?F=this.selection.getBounds(j,z):F=this.selection.getBounds(j.index,j.length);var Y=this.container.getBoundingClientRect();return{bottom:F.bottom-Y.top,height:F.height,left:F.left-Y.left,right:F.right-Y.left,top:F.top-Y.top,width:F.width}}},{key:"getContents",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-j,F=H(j,z),Y=o(F,2);return j=Y[0],z=Y[1],this.editor.getContents(j,z)}},{key:"getFormat",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof j=="number"?this.editor.getFormat(j,z):this.editor.getFormat(j.index,j.length)}},{key:"getIndex",value:function(j){return j.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(j){return this.scroll.leaf(j)}},{key:"getLine",value:function(j){return this.scroll.line(j)}},{key:"getLines",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof j!="number"?this.scroll.lines(j.index,j.length):this.scroll.lines(j,z)}},{key:"getModule",value:function(j){return this.theme.modules[j]}},{key:"getSelection",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return j&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-j,F=H(j,z),Y=o(F,2);return j=Y[0],z=Y[1],this.editor.getText(j,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(j,z,F){var Y=this,J=arguments.length>3&&arguments[3]!==void 0?arguments[3]:$.sources.API;return te.call(this,function(){return Y.editor.insertEmbed(j,z,F)},J,j)}},{key:"insertText",value:function(j,z,F,Y,J){var X=this,Q=void 0,ae=H(j,0,F,Y,J),se=o(ae,4);return j=se[0],Q=se[2],J=se[3],te.call(this,function(){return X.editor.insertText(j,z,Q)},J,j,z.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(j,z,F){this.clipboard.dangerouslyPasteHTML(j,z,F)}},{key:"removeFormat",value:function(j,z,F){var Y=this,J=H(j,z,F),X=o(J,4);return j=X[0],z=X[1],F=X[3],te.call(this,function(){return Y.editor.removeFormat(j,z)},F,j)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(j){var z=this,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return te.call(this,function(){j=new c.default(j);var Y=z.getLength(),J=z.editor.deleteText(0,Y),X=z.editor.applyDelta(j),Q=X.ops[X.ops.length-1];Q!=null&&typeof Q.insert=="string"&&Q.insert[Q.insert.length-1]===`
|
|
125
|
+
`&&(z.editor.deleteText(z.getLength()-1,1),X.delete(1));var ae=J.compose(X);return ae},F)}},{key:"setSelection",value:function(j,z,F){if(j==null)this.selection.setRange(null,z||$.sources.API);else{var Y=H(j,z,F),J=o(Y,4);j=J[0],z=J[1],F=J[3],this.selection.setRange(new y.Range(j,z),F),F!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(j){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,F=new c.default().insert(j);return this.setContents(F,z)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,z=this.scroll.update(j);return this.selection.update(j),z}},{key:"updateContents",value:function(j){var z=this,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return te.call(this,function(){return j=new c.default(j),z.editor.applyDelta(j,F)},F,!0)}}]),$}();q.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},q.events=f.default.events,q.sources=f.default.sources,q.version="1.3.7",q.imports={delta:c.default,parchment:_.default,"core/module":S.default,"core/theme":I.default};function D($,V){if(V=(0,P.default)(!0,{container:$,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===q.DEFAULTS.theme)V.theme=I.default;else if(V.theme=q.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var j=(0,P.default)(!0,{},V.theme.DEFAULTS);[j,V].forEach(function(Y){Y.modules=Y.modules||{},Object.keys(Y.modules).forEach(function(J){Y.modules[J]===!0&&(Y.modules[J]={})})});var z=Object.keys(j.modules).concat(Object.keys(V.modules)),F=z.reduce(function(Y,J){var X=q.import("modules/"+J);return X==null?M.error("Cannot load "+J+" module. Are you sure you registered it?"):Y[J]=X.DEFAULTS||{},Y},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,P.default)(!0,{},q.DEFAULTS,{modules:F},j,V),["bounds","container","scrollingContainer"].forEach(function(Y){typeof V[Y]=="string"&&(V[Y]=document.querySelector(V[Y]))}),V.modules=Object.keys(V.modules).reduce(function(Y,J){return V.modules[J]&&(Y[J]=V.modules[J]),Y},{}),V}function te($,V,j,z){if(this.options.strict&&!this.isEnabled()&&V===f.default.sources.USER)return new c.default;var F=j==null?null:this.getSelection(),Y=this.editor.delta,J=$();if(F!=null&&(j===!0&&(j=F.index),z==null?F=B(F,J,V):z!==0&&(F=B(F,j,z,V)),this.setSelection(F,f.default.sources.SILENT)),J.length()>0){var X,Q=[f.default.events.TEXT_CHANGE,J,Y,V];if((X=this.emitter).emit.apply(X,[f.default.events.EDITOR_CHANGE].concat(Q)),V!==f.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,Q)}}return J}function H($,V,j,z,F){var Y={};return typeof $.index=="number"&&typeof $.length=="number"?typeof V!="number"?(F=z,z=j,j=V,V=$.length,$=$.index):(V=$.length,$=$.index):typeof V!="number"&&(F=z,z=j,j=V,V=0),(typeof j>"u"?"undefined":i(j))==="object"?(Y=j,F=z):typeof j=="string"&&(z!=null?Y[j]=z:F=j),F=F||f.default.sources.API,[$,V,Y,F]}function B($,V,j,z){if($==null)return null;var F=void 0,Y=void 0;if(V instanceof c.default){var J=[$.index,$.index+$.length].map(function(se){return V.transformPosition(se,z!==f.default.sources.USER)}),X=o(J,2);F=X[0],Y=X[1]}else{var Q=[$.index,$.index+$.length].map(function(se){return se<V||se===V&&z===f.default.sources.USER?se:j>=0?se+j:Math.max(V,se+j)}),ae=o(Q,2);F=ae[0],Y=ae[1]}return new y.Range(F,Y-F)}n.expandConfig=D,n.overload=H,n.default=q},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(_,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,y,p){return y&&w(_.prototype,y),p&&w(_,p),_}}(),o=function w(_,y,p){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,y);if(m===void 0){var P=Object.getPrototypeOf(_);return P===null?void 0:w(P,y,p)}else{if("value"in m)return m.value;var T=m.get;return T===void 0?void 0:T.call(p)}},s=a(7),u=v(s),c=a(0),h=v(c);function v(w){return w&&w.__esModule?w:{default:w}}function g(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function f(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 g(this,_),f(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,[{key:"formatAt",value:function(p,m,P,T){if(_.compare(this.statics.blotName,P)<0&&h.default.query(P,h.default.Scope.BLOT)){var k=this.isolate(p,m);T&&k.wrap(P,T)}else o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"formatAt",this).call(this,p,m,P,T)}},{key:"optimize",value:function(p){if(o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,p),this.parent instanceof _&&_.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(p,m){var P=_.order.indexOf(p),T=_.order.indexOf(m);return P>=0||T>=0?P-T:p===m?0:p<m?-1:1}}]),_}(h.default.Inline);S.allowedChildren=[S,h.default.Embed,u.default],S.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function h(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var v=function(g){h(f,g);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default.Text);n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function y(p,m){for(var P=0;P<m.length;P++){var T=m[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(p,T.key,T)}}return function(p,m,P){return m&&y(p.prototype,m),P&&y(p,P),p}}(),o=function y(p,m,P){p===null&&(p=Function.prototype);var T=Object.getOwnPropertyDescriptor(p,m);if(T===void 0){var k=Object.getPrototypeOf(p);return k===null?void 0:y(k,m,P)}else{if("value"in T)return T.value;var L=T.get;return L===void 0?void 0:L.call(P)}},s=a(54),u=v(s),c=a(10),h=v(c);function v(y){return y&&y.__esModule?y:{default:y}}function g(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function f(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function E(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var S=(0,h.default)("quill:events"),w=["selectionchange","mousedown","mouseup","click"];w.forEach(function(y){document.addEventListener(y,function(){for(var p=arguments.length,m=Array(p),P=0;P<p;P++)m[P]=arguments[P];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(T){if(T.__quill&&T.__quill.emitter){var k;(k=T.__quill.emitter).handleDOM.apply(k,m)}})})});var _=function(y){E(p,y);function p(){g(this,p);var m=f(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return m.listeners={},m.on("error",S.error),m}return i(p,[{key:"emit",value:function(){S.log.apply(S,arguments),o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(P){for(var T=arguments.length,k=Array(T>1?T-1:0),L=1;L<T;L++)k[L-1]=arguments[L];(this.listeners[P.type]||[]).forEach(function(I){var R=I.node,A=I.handler;(P.target===R||R.contains(P.target))&&A.apply(void 0,[P].concat(k))})}},{key:"listenDOM",value:function(P,T,k){this.listeners[P]||(this.listeners[P]=[]),this.listeners[P].push({node:T,handler:k})}}]),p}(u.default);_.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"},_.sources={API:"api",SILENT:"silent",USER:"user"},n.default=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});function i(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i(this,s),this.quill=u,this.options=c};o.DEFAULTS={},n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=["error","warn","log","info"],o="warn";function s(c){if(i.indexOf(c)<=i.indexOf(o)){for(var h,v=arguments.length,g=Array(v>1?v-1:0),f=1;f<v;f++)g[f-1]=arguments[f];(h=console)[c].apply(h,g)}}function u(c){return i.reduce(function(h,v){return h[v]=s.bind(console,v,c),h},{})}s.level=u.level=function(c){o=c},n.default=u},function(t,n,a){var i=Array.prototype.slice,o=a(52),s=a(53),u=t.exports=function(g,f,E){return E||(E={}),g===f?!0:g instanceof Date&&f instanceof Date?g.getTime()===f.getTime():!g||!f||typeof g!="object"&&typeof f!="object"?E.strict?g===f:g==f:v(g,f,E)};function c(g){return g==null}function h(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,f,E){var S,w;if(c(g)||c(f)||g.prototype!==f.prototype)return!1;if(s(g))return s(f)?(g=i.call(g),f=i.call(f),u(g,f,E)):!1;if(h(g)){if(!h(f)||g.length!==f.length)return!1;for(S=0;S<g.length;S++)if(g[S]!==f[S])return!1;return!0}try{var _=o(g),y=o(f)}catch{return!1}if(_.length!=y.length)return!1;for(_.sort(),y.sort(),S=_.length-1;S>=0;S--)if(_[S]!=y[S])return!1;for(S=_.length-1;S>=0;S--)if(w=_[S],!u(g[w],f[w],E))return!1;return typeof g==typeof f}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(u,c,h){h===void 0&&(h={}),this.attrName=u,this.keyName=c;var v=i.Scope.TYPE&i.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&i.Scope.LEVEL|v:this.scope=i.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(c){return c.name})},s.prototype.add=function(u,c){return this.canAdd(u,c)?(u.setAttribute(this.keyName,c),!0):!1},s.prototype.canAdd=function(u,c){var h=i.query(u,i.Scope.BLOT&(this.scope|i.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof c=="string"?this.whitelist.indexOf(c.replace(/["']/g,""))>-1:this.whitelist.indexOf(c)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var c=u.getAttribute(this.keyName);return this.canAdd(u,c)&&c?c:""},s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var i=function(){function L(I,R){var A=[],O=!0,M=!1,q=void 0;try{for(var D=I[Symbol.iterator](),te;!(O=(te=D.next()).done)&&(A.push(te.value),!(R&&A.length===R));O=!0);}catch(H){M=!0,q=H}finally{try{!O&&D.return&&D.return()}finally{if(M)throw q}}return A}return function(I,R){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return L(I,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function L(I,R){for(var A=0;A<R.length;A++){var O=R[A];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(I,O.key,O)}}return function(I,R,A){return R&&L(I.prototype,R),A&&L(I,A),I}}(),s=function L(I,R,A){I===null&&(I=Function.prototype);var O=Object.getOwnPropertyDescriptor(I,R);if(O===void 0){var M=Object.getPrototypeOf(I);return M===null?void 0:L(M,R,A)}else{if("value"in O)return O.value;var q=O.get;return q===void 0?void 0:q.call(A)}},u=a(2),c=y(u),h=a(0),v=y(h),g=a(4),f=y(g),E=a(6),S=y(E),w=a(7),_=y(w);function y(L){return L&&L.__esModule?L:{default:L}}function p(L,I){if(!(L instanceof I))throw new TypeError("Cannot call a class as a function")}function m(L,I){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:L}function P(L,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);L.prototype=Object.create(I&&I.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(L,I):L.__proto__=I)}var T=function(L){P(I,L);function I(){return p(this,I),m(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return I}(S.default);T.blotName="code",T.tagName="CODE";var k=function(L){P(I,L);function I(){return p(this,I),m(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return o(I,[{key:"delta",value:function(){var A=this,O=this.domNode.textContent;return O.endsWith(`
|
|
126
|
+
`)&&(O=O.slice(0,-1)),O.split(`
|
|
127
|
+
`).reduce(function(M,q){return M.insert(q).insert(`
|
|
128
|
+
`,A.formats())},new c.default)}},{key:"format",value:function(A,O){if(!(A===this.statics.blotName&&O)){var M=this.descendant(_.default,this.length()-1),q=i(M,1),D=q[0];D?.deleteAt(D.length()-1,1),s(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"format",this).call(this,A,O)}}},{key:"formatAt",value:function(A,O,M,q){if(O!==0&&!(v.default.query(M,v.default.Scope.BLOCK)==null||M===this.statics.blotName&&q===this.statics.formats(this.domNode))){var D=this.newlineIndex(A);if(!(D<0||D>=A+O)){var te=this.newlineIndex(A,!0)+1,H=D-te+1,B=this.isolate(te,H),$=B.next;B.format(M,q),$ instanceof I&&$.formatAt(0,A-te+O-H,M,q)}}}},{key:"insertAt",value:function(A,O,M){if(M==null){var q=this.descendant(_.default,A),D=i(q,2),te=D[0],H=D[1];te.insertAt(H,O)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
129
|
+
`)?A:A+1}},{key:"newlineIndex",value:function(A){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,A).lastIndexOf(`
|
|
130
|
+
`);var M=this.domNode.textContent.slice(A).indexOf(`
|
|
131
|
+
`);return M>-1?A+M:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
|
|
132
|
+
`)||this.appendChild(v.default.create("text",`
|
|
133
|
+
`)),s(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"optimize",this).call(this,A);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===O.statics.formats(O.domNode)&&(O.optimize(A),O.moveChildren(this),O.remove())}},{key:"replace",value:function(A){s(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(O){var M=v.default.find(O);M==null?O.parentNode.removeChild(O):M instanceof v.default.Embed?M.remove():M.unwrap()})}}],[{key:"create",value:function(A){var O=s(I.__proto__||Object.getPrototypeOf(I),"create",this).call(this,A);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),I}(f.default);k.blotName="code-block",k.tagName="PRE",k.TAB=" ",n.Code=T,n.default=k},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(V,j){var z=[],F=!0,Y=!1,J=void 0;try{for(var X=V[Symbol.iterator](),Q;!(F=(Q=X.next()).done)&&(z.push(Q.value),!(j&&z.length===j));F=!0);}catch(ae){Y=!0,J=ae}finally{try{!F&&X.return&&X.return()}finally{if(Y)throw J}}return z}return function(V,j){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return $(V,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function $(V,j){for(var z=0;z<j.length;z++){var F=j[z];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(V,F.key,F)}}return function(V,j,z){return j&&$(V.prototype,j),z&&$(V,z),V}}(),u=a(2),c=O(u),h=a(20),v=O(h),g=a(0),f=O(g),E=a(13),S=O(E),w=a(24),_=O(w),y=a(4),p=O(y),m=a(16),P=O(m),T=a(21),k=O(T),L=a(11),I=O(L),R=a(3),A=O(R);function O($){return $&&$.__esModule?$:{default:$}}function M($,V,j){return V in $?Object.defineProperty($,V,{value:j,enumerable:!0,configurable:!0,writable:!0}):$[V]=j,$}function q($,V){if(!($ instanceof V))throw new TypeError("Cannot call a class as a function")}var D=/^[ -~]*$/,te=function(){function $(V){q(this,$),this.scroll=V,this.delta=this.getDelta()}return s($,[{key:"applyDelta",value:function(j){var z=this,F=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),j=B(j),j.reduce(function(J,X){var Q=X.retain||X.delete||X.insert.length||1,ae=X.attributes||{};if(X.insert!=null){if(typeof X.insert=="string"){var se=X.insert;se.endsWith(`
|
|
134
|
+
`)&&F&&(F=!1,se=se.slice(0,-1)),J>=Y&&!se.endsWith(`
|
|
135
|
+
`)&&(F=!0),z.scroll.insertAt(J,se);var fe=z.scroll.line(J),be=o(fe,2),_e=be[0],Ae=be[1],Re=(0,A.default)({},(0,y.bubbleFormats)(_e));if(_e instanceof p.default){var Pe=_e.descendant(f.default.Leaf,Ae),ye=o(Pe,1),nt=ye[0];Re=(0,A.default)(Re,(0,y.bubbleFormats)(nt))}ae=v.default.attributes.diff(Re,ae)||{}}else if(i(X.insert)==="object"){var Ce=Object.keys(X.insert)[0];if(Ce==null)return J;z.scroll.insertAt(J,Ce,X.insert[Ce])}Y+=Q}return Object.keys(ae).forEach(function(he){z.scroll.formatAt(J,Q,he,ae[he])}),J+Q},0),j.reduce(function(J,X){return typeof X.delete=="number"?(z.scroll.deleteAt(J,X.delete),J):J+(X.retain||X.insert.length||1)},0),this.scroll.batchEnd(),this.update(j)}},{key:"deleteText",value:function(j,z){return this.scroll.deleteAt(j,z),this.update(new c.default().retain(j).delete(z))}},{key:"formatLine",value:function(j,z){var F=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(J){if(!(F.scroll.whitelist!=null&&!F.scroll.whitelist[J])){var X=F.scroll.lines(j,Math.max(z,1)),Q=z;X.forEach(function(ae){var se=ae.length();if(!(ae instanceof S.default))ae.format(J,Y[J]);else{var fe=j-ae.offset(F.scroll),be=ae.newlineIndex(fe+Q)-fe+1;ae.formatAt(fe,be,J,Y[J])}Q-=se})}}),this.scroll.optimize(),this.update(new c.default().retain(j).retain(z,(0,k.default)(Y)))}},{key:"formatText",value:function(j,z){var F=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(J){F.scroll.formatAt(j,z,J,Y[J])}),this.update(new c.default().retain(j).retain(z,(0,k.default)(Y)))}},{key:"getContents",value:function(j,z){return this.delta.slice(j,j+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(j,z){return j.concat(z.delta())},new c.default)}},{key:"getFormat",value:function(j){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=[],Y=[];z===0?this.scroll.path(j).forEach(function(X){var Q=o(X,1),ae=Q[0];ae instanceof p.default?F.push(ae):ae instanceof f.default.Leaf&&Y.push(ae)}):(F=this.scroll.lines(j,z),Y=this.scroll.descendants(f.default.Leaf,j,z));var J=[F,Y].map(function(X){if(X.length===0)return{};for(var Q=(0,y.bubbleFormats)(X.shift());Object.keys(Q).length>0;){var ae=X.shift();if(ae==null)return Q;Q=H((0,y.bubbleFormats)(ae),Q)}return Q});return A.default.apply(A.default,J)}},{key:"getText",value:function(j,z){return this.getContents(j,z).filter(function(F){return typeof F.insert=="string"}).map(function(F){return F.insert}).join("")}},{key:"insertEmbed",value:function(j,z,F){return this.scroll.insertAt(j,z,F),this.update(new c.default().retain(j).insert(M({},z,F)))}},{key:"insertText",value:function(j,z){var F=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
|
|
136
|
+
`).replace(/\r/g,`
|
|
137
|
+
`),this.scroll.insertAt(j,z),Object.keys(Y).forEach(function(J){F.scroll.formatAt(j,z.length,J,Y[J])}),this.update(new c.default().retain(j).insert(z,(0,k.default)(Y)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var j=this.scroll.children.head;return j.statics.blotName!==p.default.blotName||j.children.length>1?!1:j.children.head instanceof P.default}},{key:"removeFormat",value:function(j,z){var F=this.getText(j,z),Y=this.scroll.line(j+z),J=o(Y,2),X=J[0],Q=J[1],ae=0,se=new c.default;X!=null&&(X instanceof S.default?ae=X.newlineIndex(Q)-Q+1:ae=X.length()-Q,se=X.delta().slice(Q,Q+ae-1).insert(`
|
|
138
|
+
`));var fe=this.getContents(j,z+ae),be=fe.diff(new c.default().insert(F).concat(se)),_e=new c.default().retain(j).concat(be);return this.applyDelta(_e)}},{key:"update",value:function(j){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(D)&&f.default.find(z[0].target)){var J=f.default.find(z[0].target),X=(0,y.bubbleFormats)(J),Q=J.offset(this.scroll),ae=z[0].oldValue.replace(_.default.CONTENTS,""),se=new c.default().insert(ae),fe=new c.default().insert(J.value()),be=new c.default().retain(Q).concat(se.diff(fe,F));j=be.reduce(function(_e,Ae){return Ae.insert?_e.insert(Ae.insert,X):_e.push(Ae)},new c.default),this.delta=Y.compose(j)}else this.delta=this.getDelta(),(!j||!(0,I.default)(Y.compose(j),this.delta))&&(j=Y.diff(this.delta,F));return j}}]),$}();function H($,V){return Object.keys(V).reduce(function(j,z){return $[z]==null||(V[z]===$[z]?j[z]=V[z]:Array.isArray(V[z])?V[z].indexOf($[z])<0&&(j[z]=V[z].concat([$[z]])):j[z]=[V[z],$[z]]),j},{})}function B($){return $.reduce(function(V,j){if(j.insert===1){var z=(0,k.default)(j.attributes);return delete z.image,V.insert({image:j.attributes.image},z)}if(j.attributes!=null&&(j.attributes.list===!0||j.attributes.bullet===!0)&&(j=(0,k.default)(j),j.attributes.list?j.attributes.list="ordered":(j.attributes.list="bullet",delete j.attributes.bullet)),typeof j.insert=="string"){var F=j.insert.replace(/\r\n/g,`
|
|
139
|
+
`).replace(/\r/g,`
|
|
140
|
+
`);return V.insert(F,j.attributes)}return V.push(j)},new c.default)}n.default=te},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var i=function(){function L(I,R){var A=[],O=!0,M=!1,q=void 0;try{for(var D=I[Symbol.iterator](),te;!(O=(te=D.next()).done)&&(A.push(te.value),!(R&&A.length===R));O=!0);}catch(H){M=!0,q=H}finally{try{!O&&D.return&&D.return()}finally{if(M)throw q}}return A}return function(I,R){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return L(I,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function L(I,R){for(var A=0;A<R.length;A++){var O=R[A];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(I,O.key,O)}}return function(I,R,A){return R&&L(I.prototype,R),A&&L(I,A),I}}(),s=a(0),u=_(s),c=a(21),h=_(c),v=a(11),g=_(v),f=a(8),E=_(f),S=a(10),w=_(S);function _(L){return L&&L.__esModule?L:{default:L}}function y(L){if(Array.isArray(L)){for(var I=0,R=Array(L.length);I<L.length;I++)R[I]=L[I];return R}else return Array.from(L)}function p(L,I){if(!(L instanceof I))throw new TypeError("Cannot call a class as a function")}var m=(0,w.default)("quill:selection"),P=function L(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;p(this,L),this.index=I,this.length=R},T=function(){function L(I,R){var A=this;p(this,L),this.emitter=R,this.scroll=I,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new P(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(O,M){O===E.default.events.TEXT_CHANGE&&M.length()>0&&A.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var O=A.getNativeRange();O!=null&&O.start.node!==A.cursor.textNode&&A.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(O.start.node,O.start.offset,O.end.node,O.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(O,M){if(M.range){var q=M.range,D=q.startNode,te=q.startOffset,H=q.endNode,B=q.endOffset;A.setNativeRange(D,te,H,B)}}),this.update(E.default.sources.SILENT)}return o(L,[{key:"handleComposition",value:function(){var R=this;this.root.addEventListener("compositionstart",function(){R.composing=!0}),this.root.addEventListener("compositionend",function(){if(R.composing=!1,R.cursor.parent){var A=R.cursor.restore();if(!A)return;setTimeout(function(){R.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var R=this;this.emitter.listenDOM("mousedown",document.body,function(){R.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){R.mouseDown=!1,R.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(R,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[R])){this.scroll.update();var O=this.getNativeRange();if(!(O==null||!O.native.collapsed||u.default.query(R,u.default.Scope.BLOCK))){if(O.start.node!==this.cursor.textNode){var M=u.default.find(O.start.node,!1);if(M==null)return;if(M instanceof u.default.Leaf){var q=M.split(O.start.offset);M.parent.insertBefore(this.cursor,q)}else M.insertBefore(this.cursor,O.start.node);this.cursor.attach()}this.cursor.format(R,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=this.scroll.length();R=Math.min(R,O-1),A=Math.min(R+A,O-1)-R;var M=void 0,q=this.scroll.leaf(R),D=i(q,2),te=D[0],H=D[1];if(te==null)return null;var B=te.position(H,!0),$=i(B,2);M=$[0],H=$[1];var V=document.createRange();if(A>0){V.setStart(M,H);var j=this.scroll.leaf(R+A),z=i(j,2);if(te=z[0],H=z[1],te==null)return null;var F=te.position(H,!0),Y=i(F,2);return M=Y[0],H=Y[1],V.setEnd(M,H),V.getBoundingClientRect()}else{var J="left",X=void 0;return M instanceof Text?(H<M.data.length?(V.setStart(M,H),V.setEnd(M,H+1)):(V.setStart(M,H-1),V.setEnd(M,H),J="right"),X=V.getBoundingClientRect()):(X=te.domNode.getBoundingClientRect(),H>0&&(J="right")),{bottom:X.top+X.height,height:X.height,left:X[J],right:X[J],top:X.top,width:0}}}},{key:"getNativeRange",value:function(){var R=document.getSelection();if(R==null||R.rangeCount<=0)return null;var A=R.getRangeAt(0);if(A==null)return null;var O=this.normalizeNative(A);return m.info("getNativeRange",O),O}},{key:"getRange",value:function(){var R=this.getNativeRange();if(R==null)return[null,null];var A=this.normalizedToRange(R);return[A,R]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(R){var A=this,O=[[R.start.node,R.start.offset]];R.native.collapsed||O.push([R.end.node,R.end.offset]);var M=O.map(function(te){var H=i(te,2),B=H[0],$=H[1],V=u.default.find(B,!0),j=V.offset(A.scroll);return $===0?j:V instanceof u.default.Container?j+V.length():j+V.index(B,$)}),q=Math.min(Math.max.apply(Math,y(M)),this.scroll.length()-1),D=Math.min.apply(Math,[q].concat(y(M)));return new P(D,q-D)}},{key:"normalizeNative",value:function(R){if(!k(this.root,R.startContainer)||!R.collapsed&&!k(this.root,R.endContainer))return null;var A={start:{node:R.startContainer,offset:R.startOffset},end:{node:R.endContainer,offset:R.endOffset},native:R};return[A.start,A.end].forEach(function(O){for(var M=O.node,q=O.offset;!(M instanceof Text)&&M.childNodes.length>0;)if(M.childNodes.length>q)M=M.childNodes[q],q=0;else if(M.childNodes.length===q)M=M.lastChild,q=M instanceof Text?M.data.length:M.childNodes.length+1;else break;O.node=M,O.offset=q}),A}},{key:"rangeToNative",value:function(R){var A=this,O=R.collapsed?[R.index]:[R.index,R.index+R.length],M=[],q=this.scroll.length();return O.forEach(function(D,te){D=Math.min(q-1,D);var H=void 0,B=A.scroll.leaf(D),$=i(B,2),V=$[0],j=$[1],z=V.position(j,te!==0),F=i(z,2);H=F[0],j=F[1],M.push(H,j)}),M.length<2&&(M=M.concat(M)),M}},{key:"scrollIntoView",value:function(R){var A=this.lastRange;if(A!=null){var O=this.getBounds(A.index,A.length);if(O!=null){var M=this.scroll.length()-1,q=this.scroll.line(Math.min(A.index,M)),D=i(q,1),te=D[0],H=te;if(A.length>0){var B=this.scroll.line(Math.min(A.index+A.length,M)),$=i(B,1);H=$[0]}if(!(te==null||H==null)){var V=R.getBoundingClientRect();O.top<V.top?R.scrollTop-=V.top-O.top:O.bottom>V.bottom&&(R.scrollTop+=O.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(R,A){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",R,A,O,M),!(R!=null&&(this.root.parentNode==null||R.parentNode==null||O.parentNode==null))){var D=document.getSelection();if(D!=null)if(R!=null){this.hasFocus()||this.root.focus();var te=(this.getNativeRange()||{}).native;if(te==null||q||R!==te.startContainer||A!==te.startOffset||O!==te.endContainer||M!==te.endOffset){R.tagName=="BR"&&(A=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode),O.tagName=="BR"&&(M=[].indexOf.call(O.parentNode.childNodes,O),O=O.parentNode);var H=document.createRange();H.setStart(R,A),H.setEnd(O,M),D.removeAllRanges(),D.addRange(H)}}else D.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof A=="string"&&(O=A,A=!1),m.info("setRange",R),R!=null){var M=this.rangeToNative(R);this.setNativeRange.apply(this,y(M).concat([A]))}else this.setNativeRange(null);this.update(O)}},{key:"update",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,A=this.lastRange,O=this.getRange(),M=i(O,2),q=M[0],D=M[1];if(this.lastRange=q,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,g.default)(A,this.lastRange)){var te;!this.composing&&D!=null&&D.native.collapsed&&D.start.node!==this.cursor.textNode&&this.cursor.restore();var H=[E.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(A),R];if((te=this.emitter).emit.apply(te,[E.default.events.EDITOR_CHANGE].concat(H)),R!==E.default.sources.SILENT){var B;(B=this.emitter).emit.apply(B,H)}}}}]),L}();function k(L,I){try{I.parentNode}catch{return!1}return I instanceof Text&&(I=I.parentNode),L.contains(I)}n.Range=P,n.default=T},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function E(S,w){for(var _=0;_<w.length;_++){var y=w[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}return function(S,w,_){return w&&E(S.prototype,w),_&&E(S,_),S}}(),o=function E(S,w,_){S===null&&(S=Function.prototype);var y=Object.getOwnPropertyDescriptor(S,w);if(y===void 0){var p=Object.getPrototypeOf(S);return p===null?void 0:E(p,w,_)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(_)}},s=a(0),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"insertInto",value:function(_,y){_.children.length===0?o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertInto",this).call(this,_,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),S}(u.default.Embed);f.blotName="break",f.tagName="BR",n.default=f},function(t,n,a){var i=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,f){g.__proto__=f}||function(g,f){for(var E in f)f.hasOwnProperty(E)&&(g[E]=f[E])};return function(g,f){v(g,f);function E(){this.constructor=g}g.prototype=f===null?Object.create(f):(E.prototype=f.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(44),s=a(30),u=a(1),c=function(v){i(g,v);function g(f){var E=v.call(this,f)||this;return E.build(),E}return g.prototype.appendChild=function(f){this.insertBefore(f)},g.prototype.attach=function(){v.prototype.attach.call(this),this.children.forEach(function(f){f.attach()})},g.prototype.build=function(){var f=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var S=h(E);f.insertBefore(S,f.children.head||void 0)}catch(w){if(w instanceof u.ParchmentError)return;throw w}})},g.prototype.deleteAt=function(f,E){if(f===0&&E===this.length())return this.remove();this.children.forEachAt(f,E,function(S,w,_){S.deleteAt(w,_)})},g.prototype.descendant=function(f,E){var S=this.children.find(E),w=S[0],_=S[1];return f.blotName==null&&f(w)||f.blotName!=null&&w instanceof f?[w,_]:w instanceof g?w.descendant(f,_):[null,-1]},g.prototype.descendants=function(f,E,S){E===void 0&&(E=0),S===void 0&&(S=Number.MAX_VALUE);var w=[],_=S;return this.children.forEachAt(E,S,function(y,p,m){(f.blotName==null&&f(y)||f.blotName!=null&&y instanceof f)&&w.push(y),y instanceof g&&(w=w.concat(y.descendants(f,p,_))),_-=m}),w},g.prototype.detach=function(){this.children.forEach(function(f){f.detach()}),v.prototype.detach.call(this)},g.prototype.formatAt=function(f,E,S,w){this.children.forEachAt(f,E,function(_,y,p){_.formatAt(y,p,S,w)})},g.prototype.insertAt=function(f,E,S){var w=this.children.find(f),_=w[0],y=w[1];if(_)_.insertAt(y,E,S);else{var p=S==null?u.create("text",E):u.create(E,S);this.appendChild(p)}},g.prototype.insertBefore=function(f,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(S){return f instanceof S}))throw new u.ParchmentError("Cannot insert "+f.statics.blotName+" into "+this.statics.blotName);f.insertInto(this,E)},g.prototype.length=function(){return this.children.reduce(function(f,E){return f+E.length()},0)},g.prototype.moveChildren=function(f,E){this.children.forEach(function(S){f.insertBefore(S,E)})},g.prototype.optimize=function(f){if(v.prototype.optimize.call(this,f),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(f)}else this.remove()},g.prototype.path=function(f,E){E===void 0&&(E=!1);var S=this.children.find(f,E),w=S[0],_=S[1],y=[[this,f]];return w instanceof g?y.concat(w.path(_,E)):(w!=null&&y.push([w,_]),y)},g.prototype.removeChild=function(f){this.children.remove(f)},g.prototype.replace=function(f){f instanceof g&&f.moveChildren(this),v.prototype.replace.call(this,f)},g.prototype.split=function(f,E){if(E===void 0&&(E=!1),!E){if(f===0)return this;if(f===this.length())return this.next}var S=this.clone();return this.parent.insertBefore(S,this.next),this.children.forEachAt(f,this.length(),function(w,_,y){w=w.split(_,E),S.appendChild(w)}),S},g.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},g.prototype.update=function(f,E){var S=this,w=[],_=[];f.forEach(function(y){y.target===S.domNode&&y.type==="childList"&&(w.push.apply(w,y.addedNodes),_.push.apply(_,y.removedNodes))}),_.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var p=u.find(y);p!=null&&(p.domNode.parentNode==null||p.domNode.parentNode===S.domNode)&&p.detach()}}),w.filter(function(y){return y.parentNode==S.domNode}).sort(function(y,p){return y===p?0:y.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var p=null;y.nextSibling!=null&&(p=u.find(y.nextSibling));var m=h(y);(m.next!=p||m.next==null)&&(m.parent!=null&&m.parent.removeChild(S),S.insertBefore(m,p||void 0))})},g}(s.default);function h(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(E){g.domNode.appendChild(E)}),v.parentNode&&v.parentNode.replaceChild(g.domNode,v),g.attach()}return g}n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,f){g.__proto__=f}||function(g,f){for(var E in f)f.hasOwnProperty(E)&&(g[E]=f[E])};return function(g,f){v(g,f);function E(){this.constructor=g}g.prototype=f===null?Object.create(f):(E.prototype=f.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12),s=a(31),u=a(17),c=a(1),h=function(v){i(g,v);function g(f){var E=v.call(this,f)||this;return E.attributes=new s.default(E.domNode),E}return g.formats=function(f){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return f.tagName.toLowerCase()},g.prototype.format=function(f,E){var S=c.query(f);S instanceof o.default?this.attributes.attribute(S,E):E&&S!=null&&(f!==this.statics.blotName||this.formats()[f]!==E)&&this.replaceWith(f,E)},g.prototype.formats=function(){var f=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(f[this.statics.blotName]=E),f},g.prototype.replaceWith=function(f,E){var S=v.prototype.replaceWith.call(this,f,E);return this.attributes.copy(S),S},g.prototype.update=function(f,E){var S=this;v.prototype.update.call(this,f,E),f.some(function(w){return w.target===S.domNode&&w.type==="attributes"})&&this.attributes.build()},g.prototype.wrap=function(f,E){var S=v.prototype.wrap.call(this,f,E);return S instanceof g&&S.statics.scope===this.statics.scope&&this.attributes.move(S),S},g}(u.default);n.default=h},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var g in v)v.hasOwnProperty(g)&&(h[g]=v[g])};return function(h,v){c(h,v);function g(){this.constructor=h}h.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(30),s=a(1),u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.value=function(v){return!0},h.prototype.index=function(v,g){return this.domNode===v||this.domNode.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(g,1):-1},h.prototype.position=function(v,g){var f=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return v>0&&(f+=1),[this.parent.domNode,f]},h.prototype.value=function(){var v;return v={},v[this.statics.blotName]=this.statics.value(this.domNode)||!0,v},h.scope=s.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(t,n,a){var i=a(11),o=a(3),s={attributes:{compose:function(c,h,v){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});var g=o(!0,{},h);v||(g=Object.keys(g).reduce(function(E,S){return g[S]!=null&&(E[S]=g[S]),E},{}));for(var f in c)c[f]!==void 0&&h[f]===void 0&&(g[f]=c[f]);return Object.keys(g).length>0?g:void 0},diff:function(c,h){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});var v=Object.keys(c).concat(Object.keys(h)).reduce(function(g,f){return i(c[f],h[f])||(g[f]=h[f]===void 0?null:h[f]),g},{});return Object.keys(v).length>0?v:void 0},transform:function(c,h,v){if(typeof c!="object")return h;if(typeof h=="object"){if(!v)return h;var g=Object.keys(h).reduce(function(f,E){return c[E]===void 0&&(f[E]=h[E]),f},{});return Object.keys(g).length>0?g:void 0}}},iterator:function(c){return new u(c)},length:function(c){return typeof c.delete=="number"?c.delete:typeof c.retain=="number"?c.retain:typeof c.insert=="string"?c.insert.length:1}};function u(c){this.ops=c,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(c){c||(c=1/0);var h=this.ops[this.index];if(h){var v=this.offset,g=s.length(h);if(c>=g-v?(c=g-v,this.index+=1,this.offset=0):this.offset+=c,typeof h.delete=="number")return{delete:c};var f={};return h.attributes&&(f.attributes=h.attributes),typeof h.retain=="number"?f.retain=c:typeof h.insert=="string"?f.insert=h.insert.substr(v,c):f.insert=h.insert,f}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var c=this.offset,h=this.index,v=this.next(),g=this.ops.slice(this.index);return this.offset=c,this.index=h,[v].concat(g)}else return[]},t.exports=s},function(t,n){var a=function(){function i(S,w){return w!=null&&S instanceof w}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function c(S,w,_,y,p){typeof w=="object"&&(_=w.depth,y=w.prototype,p=w.includeNonEnumerable,w=w.circular);var m=[],P=[],T=typeof Buffer<"u";typeof w>"u"&&(w=!0),typeof _>"u"&&(_=1/0);function k(L,I){if(L===null)return null;if(I===0)return L;var R,A;if(typeof L!="object")return L;if(i(L,o))R=new o;else if(i(L,s))R=new s;else if(i(L,u))R=new u(function(V,j){L.then(function(z){V(k(z,I-1))},function(z){j(k(z,I-1))})});else if(c.__isArray(L))R=[];else if(c.__isRegExp(L))R=new RegExp(L.source,E(L)),L.lastIndex&&(R.lastIndex=L.lastIndex);else if(c.__isDate(L))R=new Date(L.getTime());else{if(T&&Buffer.isBuffer(L))return Buffer.allocUnsafe?R=Buffer.allocUnsafe(L.length):R=new Buffer(L.length),L.copy(R),R;i(L,Error)?R=Object.create(L):typeof y>"u"?(A=Object.getPrototypeOf(L),R=Object.create(A)):(R=Object.create(y),A=y)}if(w){var O=m.indexOf(L);if(O!=-1)return P[O];m.push(L),P.push(R)}i(L,o)&&L.forEach(function(V,j){var z=k(j,I-1),F=k(V,I-1);R.set(z,F)}),i(L,s)&&L.forEach(function(V){var j=k(V,I-1);R.add(j)});for(var M in L){var q;A&&(q=Object.getOwnPropertyDescriptor(A,M)),!(q&&q.set==null)&&(R[M]=k(L[M],I-1))}if(Object.getOwnPropertySymbols)for(var D=Object.getOwnPropertySymbols(L),M=0;M<D.length;M++){var te=D[M],H=Object.getOwnPropertyDescriptor(L,te);H&&!H.enumerable&&!p||(R[te]=k(L[te],I-1),H.enumerable||Object.defineProperty(R,te,{enumerable:!1}))}if(p)for(var B=Object.getOwnPropertyNames(L),M=0;M<B.length;M++){var $=B[M],H=Object.getOwnPropertyDescriptor(L,$);H&&H.enumerable||(R[$]=k(L[$],I-1),Object.defineProperty(R,$,{enumerable:!1}))}return R}return k(S,_)}c.clonePrototype=function(w){if(w===null)return null;var _=function(){};return _.prototype=w,new _};function h(S){return Object.prototype.toString.call(S)}c.__objToStr=h;function v(S){return typeof S=="object"&&h(S)==="[object Date]"}c.__isDate=v;function g(S){return typeof S=="object"&&h(S)==="[object Array]"}c.__isArray=g;function f(S){return typeof S=="object"&&h(S)==="[object RegExp]"}c.__isRegExp=f;function E(S){var w="";return S.global&&(w+="g"),S.ignoreCase&&(w+="i"),S.multiline&&(w+="m"),w}return c.__getRegExpFlags=E,c}();typeof t=="object"&&t.exports&&(t.exports=a)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function R(A,O){var M=[],q=!0,D=!1,te=void 0;try{for(var H=A[Symbol.iterator](),B;!(q=(B=H.next()).done)&&(M.push(B.value),!(O&&M.length===O));q=!0);}catch($){D=!0,te=$}finally{try{!q&&H.return&&H.return()}finally{if(D)throw te}}return M}return function(A,O){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return R(A,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(A,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(A,q.key,q)}}return function(A,O,M){return O&&R(A.prototype,O),M&&R(A,M),A}}(),s=function R(A,O,M){A===null&&(A=Function.prototype);var q=Object.getOwnPropertyDescriptor(A,O);if(q===void 0){var D=Object.getPrototypeOf(A);return D===null?void 0:R(D,O,M)}else{if("value"in q)return q.value;var te=q.get;return te===void 0?void 0:te.call(M)}},u=a(0),c=m(u),h=a(8),v=m(h),g=a(4),f=m(g),E=a(16),S=m(E),w=a(13),_=m(w),y=a(25),p=m(y);function m(R){return R&&R.__esModule?R:{default:R}}function P(R,A){if(!(R instanceof A))throw new TypeError("Cannot call a class as a function")}function T(R,A){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:R}function k(R,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);R.prototype=Object.create(A&&A.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(R,A):R.__proto__=A)}function L(R){return R instanceof f.default||R instanceof g.BlockEmbed}var I=function(R){k(A,R);function A(O,M){P(this,A);var q=T(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,O));return q.emitter=M.emitter,Array.isArray(M.whitelist)&&(q.whitelist=M.whitelist.reduce(function(D,te){return D[te]=!0,D},{})),q.domNode.addEventListener("DOMNodeInserted",function(){}),q.optimize(),q.enable(),q}return o(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(M,q){var D=this.line(M),te=i(D,2),H=te[0],B=te[1],$=this.line(M+q),V=i($,1),j=V[0];if(s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,M,q),j!=null&&H!==j&&B>0){if(H instanceof g.BlockEmbed||j instanceof g.BlockEmbed){this.optimize();return}if(H instanceof _.default){var z=H.newlineIndex(H.length(),!0);if(z>-1&&(H=H.split(z+1),H===j)){this.optimize();return}}else if(j instanceof _.default){var F=j.newlineIndex(0);F>-1&&j.split(F+1)}var Y=j.children.head instanceof S.default?null:j.children.head;H.moveChildren(j,Y),H.remove()}this.optimize()}},{key:"enable",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",M)}},{key:"formatAt",value:function(M,q,D,te){this.whitelist!=null&&!this.whitelist[D]||(s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,M,q,D,te),this.optimize())}},{key:"insertAt",value:function(M,q,D){if(!(D!=null&&this.whitelist!=null&&!this.whitelist[q])){if(M>=this.length())if(D==null||c.default.query(q,c.default.Scope.BLOCK)==null){var te=c.default.create(this.statics.defaultChild);this.appendChild(te),D==null&&q.endsWith(`
|
|
141
|
+
`)&&(q=q.slice(0,-1)),te.insertAt(0,q,D)}else{var H=c.default.create(q,D);this.appendChild(H)}else s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,M,q,D);this.optimize()}}},{key:"insertBefore",value:function(M,q){if(M.statics.scope===c.default.Scope.INLINE_BLOT){var D=c.default.create(this.statics.defaultChild);D.appendChild(M),M=D}s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,M,q)}},{key:"leaf",value:function(M){return this.path(M).pop()||[null,-1]}},{key:"line",value:function(M){return M===this.length()?this.line(M-1):this.descendant(L,M)}},{key:"lines",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,D=function te(H,B,$){var V=[],j=$;return H.children.forEachAt(B,$,function(z,F,Y){L(z)?V.push(z):z instanceof c.default.Container&&(V=V.concat(te(z,F,j))),j-=Y}),V};return D(this,M,q)}},{key:"optimize",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,M,q),M.length>0&&this.emitter.emit(v.default.events.SCROLL_OPTIMIZE,M,q))}},{key:"path",value:function(M){return s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,M).slice(1)}},{key:"update",value:function(M){if(this.batch!==!0){var q=v.default.sources.USER;typeof M=="string"&&(q=M),Array.isArray(M)||(M=this.observer.takeRecords()),M.length>0&&this.emitter.emit(v.default.events.SCROLL_BEFORE_UPDATE,q,M),s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,M.concat([])),M.length>0&&this.emitter.emit(v.default.events.SCROLL_UPDATE,q,M)}}}]),A}(c.default.Scroll);I.blotName="scroll",I.className="ql-editor",I.tagName="DIV",I.defaultChild="block",I.allowedChildren=[f.default,g.BlockEmbed,p.default],n.default=I},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},o=function(){function X(Q,ae){var se=[],fe=!0,be=!1,_e=void 0;try{for(var Ae=Q[Symbol.iterator](),Re;!(fe=(Re=Ae.next()).done)&&(se.push(Re.value),!(ae&&se.length===ae));fe=!0);}catch(Pe){be=!0,_e=Pe}finally{try{!fe&&Ae.return&&Ae.return()}finally{if(be)throw _e}}return se}return function(Q,ae){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return X(Q,ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function X(Q,ae){for(var se=0;se<ae.length;se++){var fe=ae[se];fe.enumerable=fe.enumerable||!1,fe.configurable=!0,"value"in fe&&(fe.writable=!0),Object.defineProperty(Q,fe.key,fe)}}return function(Q,ae,se){return ae&&X(Q.prototype,ae),se&&X(Q,se),Q}}(),u=a(21),c=R(u),h=a(11),v=R(h),g=a(3),f=R(g),E=a(2),S=R(E),w=a(20),_=R(w),y=a(0),p=R(y),m=a(5),P=R(m),T=a(10),k=R(T),L=a(9),I=R(L);function R(X){return X&&X.__esModule?X:{default:X}}function A(X,Q,ae){return Q in X?Object.defineProperty(X,Q,{value:ae,enumerable:!0,configurable:!0,writable:!0}):X[Q]=ae,X}function O(X,Q){if(!(X instanceof Q))throw new TypeError("Cannot call a class as a function")}function M(X,Q){if(!X)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q&&(typeof Q=="object"||typeof Q=="function")?Q:X}function q(X,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Q);X.prototype=Object.create(Q&&Q.prototype,{constructor:{value:X,enumerable:!1,writable:!0,configurable:!0}}),Q&&(Object.setPrototypeOf?Object.setPrototypeOf(X,Q):X.__proto__=Q)}var D=(0,k.default)("quill:keyboard"),te=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",H=function(X){q(Q,X),s(Q,null,[{key:"match",value:function(se,fe){return fe=J(fe),["altKey","ctrlKey","metaKey","shiftKey"].some(function(be){return!!fe[be]!==se[be]&&fe[be]!==null})?!1:fe.key===(se.which||se.keyCode)}}]);function Q(ae,se){O(this,Q);var fe=M(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,ae,se));return fe.bindings={},Object.keys(fe.options.bindings).forEach(function(be){be==="list autofill"&&ae.scroll.whitelist!=null&&!ae.scroll.whitelist.list||fe.options.bindings[be]&&fe.addBinding(fe.options.bindings[be])}),fe.addBinding({key:Q.keys.ENTER,shiftKey:null},z),fe.addBinding({key:Q.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(fe.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0},$),fe.addBinding({key:Q.keys.DELETE},{collapsed:!0},V)):(fe.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},$),fe.addBinding({key:Q.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),fe.addBinding({key:Q.keys.BACKSPACE},{collapsed:!1},j),fe.addBinding({key:Q.keys.DELETE},{collapsed:!1},j),fe.addBinding({key:Q.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},$),fe.listen(),fe}return s(Q,[{key:"addBinding",value:function(se){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_e=J(se);if(_e==null||_e.key==null)return D.warn("Attempted to add invalid keyboard binding",_e);typeof fe=="function"&&(fe={handler:fe}),typeof be=="function"&&(be={handler:be}),_e=(0,f.default)(_e,fe,be),this.bindings[_e.key]=this.bindings[_e.key]||[],this.bindings[_e.key].push(_e)}},{key:"listen",value:function(){var se=this;this.quill.root.addEventListener("keydown",function(fe){if(!fe.defaultPrevented){var be=fe.which||fe.keyCode,_e=(se.bindings[be]||[]).filter(function(lt){return Q.match(fe,lt)});if(_e.length!==0){var Ae=se.quill.getSelection();if(!(Ae==null||!se.quill.hasFocus())){var Re=se.quill.getLine(Ae.index),Pe=o(Re,2),ye=Pe[0],nt=Pe[1],Ce=se.quill.getLeaf(Ae.index),he=o(Ce,2),ke=he[0],Te=he[1],ve=Ae.length===0?[ke,Te]:se.quill.getLeaf(Ae.index+Ae.length),Se=o(ve,2),je=Se[0],Ue=Se[1],ct=ke instanceof p.default.Text?ke.value().slice(0,Te):"",mt=je instanceof p.default.Text?je.value().slice(Ue):"",yt={collapsed:Ae.length===0,empty:Ae.length===0&&ye.length()<=1,format:se.quill.getFormat(Ae),offset:nt,prefix:ct,suffix:mt},Je=_e.some(function(lt){if(lt.collapsed!=null&<.collapsed!==yt.collapsed||lt.empty!=null&<.empty!==yt.empty||lt.offset!=null&<.offset!==yt.offset)return!1;if(Array.isArray(lt.format)){if(lt.format.every(function(ze){return yt.format[ze]==null}))return!1}else if(i(lt.format)==="object"&&!Object.keys(lt.format).every(function(ze){return lt.format[ze]===!0?yt.format[ze]!=null:lt.format[ze]===!1?yt.format[ze]==null:(0,v.default)(lt.format[ze],yt.format[ze])}))return!1;return lt.prefix!=null&&!lt.prefix.test(yt.prefix)||lt.suffix!=null&&!lt.suffix.test(yt.suffix)?!1:lt.handler.call(se,Ae,yt)!==!0});Je&&fe.preventDefault()}}}})}}]),Q}(I.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:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:H.keys.TAB,format:["blockquote","indent","list"],handler:function(Q,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","+1",P.default.sources.USER)}},outdent:{key:H.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Q,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","-1",P.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,ae){ae.format.indent!=null?this.quill.format("indent","-1",P.default.sources.USER):ae.format.list!=null&&this.quill.format("list",!1,P.default.sources.USER)}},"indent code-block":F(!0),"outdent code-block":F(!1),"remove tab":{key:H.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Q){this.quill.deleteText(Q.index-1,1,P.default.sources.USER)}},tab:{key:H.keys.TAB,handler:function(Q){this.quill.history.cutoff();var ae=new S.default().retain(Q.index).delete(Q.length).insert(" ");this.quill.updateContents(ae,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index+1,P.default.sources.SILENT)}},"list empty enter":{key:H.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Q,ae){this.quill.format("list",!1,P.default.sources.USER),ae.format.indent&&this.quill.format("indent",!1,P.default.sources.USER)}},"checklist enter":{key:H.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Q){var ae=this.quill.getLine(Q.index),se=o(ae,2),fe=se[0],be=se[1],_e=(0,f.default)({},fe.formats(),{list:"checked"}),Ae=new S.default().retain(Q.index).insert(`
|
|
142
|
+
`,_e).retain(fe.length()-be-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ae,P.default.sources.USER),this.quill.setSelection(Q.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:H.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Q,ae){var se=this.quill.getLine(Q.index),fe=o(se,2),be=fe[0],_e=fe[1],Ae=new S.default().retain(Q.index).insert(`
|
|
143
|
+
`,ae.format).retain(be.length()-_e-1).retain(1,{header:null});this.quill.updateContents(Ae,P.default.sources.USER),this.quill.setSelection(Q.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Q,ae){var se=ae.prefix.length,fe=this.quill.getLine(Q.index),be=o(fe,2),_e=be[0],Ae=be[1];if(Ae>se)return!0;var Re=void 0;switch(ae.prefix.trim()){case"[]":case"[ ]":Re="unchecked";break;case"[x]":Re="checked";break;case"-":case"*":Re="bullet";break;default:Re="ordered"}this.quill.insertText(Q.index," ",P.default.sources.USER),this.quill.history.cutoff();var Pe=new S.default().retain(Q.index-Ae).delete(se+1).retain(_e.length()-2-Ae).retain(1,{list:Re});this.quill.updateContents(Pe,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index-se,P.default.sources.SILENT)}},"code exit":{key:H.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Q){var ae=this.quill.getLine(Q.index),se=o(ae,2),fe=se[0],be=se[1],_e=new S.default().retain(Q.index+fe.length()-be-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(_e,P.default.sources.USER)}},"embed left":B(H.keys.LEFT,!1),"embed left shift":B(H.keys.LEFT,!0),"embed right":B(H.keys.RIGHT,!1),"embed right shift":B(H.keys.RIGHT,!0)}};function B(X,Q){var ae,se=X===H.keys.LEFT?"prefix":"suffix";return ae={key:X,shiftKey:Q,altKey:null},A(ae,se,/^$/),A(ae,"handler",function(be){var _e=be.index;X===H.keys.RIGHT&&(_e+=be.length+1);var Ae=this.quill.getLeaf(_e),Re=o(Ae,1),Pe=Re[0];return Pe instanceof p.default.Embed?(X===H.keys.LEFT?Q?this.quill.setSelection(be.index-1,be.length+1,P.default.sources.USER):this.quill.setSelection(be.index-1,P.default.sources.USER):Q?this.quill.setSelection(be.index,be.length+1,P.default.sources.USER):this.quill.setSelection(be.index+be.length+1,P.default.sources.USER),!1):!0}),ae}function $(X,Q){if(!(X.index===0||this.quill.getLength()<=1)){var ae=this.quill.getLine(X.index),se=o(ae,1),fe=se[0],be={};if(Q.offset===0){var _e=this.quill.getLine(X.index-1),Ae=o(_e,1),Re=Ae[0];if(Re!=null&&Re.length()>1){var Pe=fe.formats(),ye=this.quill.getFormat(X.index-1,1);be=_.default.attributes.diff(Pe,ye)||{}}}var nt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Q.prefix)?2:1;this.quill.deleteText(X.index-nt,nt,P.default.sources.USER),Object.keys(be).length>0&&this.quill.formatLine(X.index-nt,nt,be,P.default.sources.USER),this.quill.focus()}}function V(X,Q){var ae=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Q.suffix)?2:1;if(!(X.index>=this.quill.getLength()-ae)){var se={},fe=0,be=this.quill.getLine(X.index),_e=o(be,1),Ae=_e[0];if(Q.offset>=Ae.length()-1){var Re=this.quill.getLine(X.index+1),Pe=o(Re,1),ye=Pe[0];if(ye){var nt=Ae.formats(),Ce=this.quill.getFormat(X.index,1);se=_.default.attributes.diff(nt,Ce)||{},fe=ye.length()}}this.quill.deleteText(X.index,ae,P.default.sources.USER),Object.keys(se).length>0&&this.quill.formatLine(X.index+fe-1,ae,se,P.default.sources.USER)}}function j(X){var Q=this.quill.getLines(X),ae={};if(Q.length>1){var se=Q[0].formats(),fe=Q[Q.length-1].formats();ae=_.default.attributes.diff(fe,se)||{}}this.quill.deleteText(X,P.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(X.index,1,ae,P.default.sources.USER),this.quill.setSelection(X.index,P.default.sources.SILENT),this.quill.focus()}function z(X,Q){var ae=this;X.length>0&&this.quill.scroll.deleteAt(X.index,X.length);var se=Object.keys(Q.format).reduce(function(fe,be){return p.default.query(be,p.default.Scope.BLOCK)&&!Array.isArray(Q.format[be])&&(fe[be]=Q.format[be]),fe},{});this.quill.insertText(X.index,`
|
|
144
|
+
`,se,P.default.sources.USER),this.quill.setSelection(X.index+1,P.default.sources.SILENT),this.quill.focus(),Object.keys(Q.format).forEach(function(fe){se[fe]==null&&(Array.isArray(Q.format[fe])||fe!=="link"&&ae.quill.format(fe,Q.format[fe],P.default.sources.USER))})}function F(X){return{key:H.keys.TAB,shiftKey:!X,format:{"code-block":!0},handler:function(ae){var se=p.default.query("code-block"),fe=ae.index,be=ae.length,_e=this.quill.scroll.descendant(se,fe),Ae=o(_e,2),Re=Ae[0],Pe=Ae[1];if(Re!=null){var ye=this.quill.getIndex(Re),nt=Re.newlineIndex(Pe,!0)+1,Ce=Re.newlineIndex(ye+Pe+be),he=Re.domNode.textContent.slice(nt,Ce).split(`
|
|
145
|
+
`);Pe=0,he.forEach(function(ke,Te){X?(Re.insertAt(nt+Pe,se.TAB),Pe+=se.TAB.length,Te===0?fe+=se.TAB.length:be+=se.TAB.length):ke.startsWith(se.TAB)&&(Re.deleteAt(nt+Pe,se.TAB.length),Pe-=se.TAB.length,Te===0?fe-=se.TAB.length:be-=se.TAB.length),Pe+=ke.length+1}),this.quill.update(P.default.sources.USER),this.quill.setSelection(fe,be,P.default.sources.SILENT)}}}}function Y(X){return{key:X[0].toUpperCase(),shortKey:!0,handler:function(ae,se){this.quill.format(X,!se.format[X],P.default.sources.USER)}}}function J(X){if(typeof X=="string"||typeof X=="number")return J({key:X});if((typeof X>"u"?"undefined":i(X))==="object"&&(X=(0,c.default)(X,!1)),typeof X.key=="string")if(H.keys[X.key.toUpperCase()]!=null)X.key=H.keys[X.key.toUpperCase()];else if(X.key.length===1)X.key=X.key.toUpperCase().charCodeAt(0);else return null;return X.shortKey&&(X[te]=X.shortKey,delete X.shortKey),X}n.default=H,n.SHORTKEY=te},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(y,p){var m=[],P=!0,T=!1,k=void 0;try{for(var L=y[Symbol.iterator](),I;!(P=(I=L.next()).done)&&(m.push(I.value),!(p&&m.length===p));P=!0);}catch(R){T=!0,k=R}finally{try{!P&&L.return&&L.return()}finally{if(T)throw k}}return m}return function(y,p){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return _(y,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function _(y,p,m){y===null&&(y=Function.prototype);var P=Object.getOwnPropertyDescriptor(y,p);if(P===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:_(T,p,m)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(m)}},s=function(){function _(y,p){for(var m=0;m<p.length;m++){var P=p[m];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(y,P.key,P)}}return function(y,p,m){return p&&_(y.prototype,p),m&&_(y,m),y}}(),u=a(0),c=g(u),h=a(7),v=g(h);function g(_){return _&&_.__esModule?_:{default:_}}function f(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function E(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var w=function(_){S(y,_),s(y,null,[{key:"value",value:function(){}}]);function y(p,m){f(this,y);var P=E(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p));return P.selection=m,P.textNode=document.createTextNode(y.CONTENTS),P.domNode.appendChild(P.textNode),P._length=0,P}return s(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,P){if(this._length!==0)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,P);for(var T=this,k=0;T!=null&&T.statics.scope!==c.default.Scope.BLOCK_BLOT;)k+=T.offset(T.parent),T=T.parent;T!=null&&(this._length=y.CONTENTS.length,T.optimize(),T.formatAt(k,y.CONTENTS.length,m,P),this._length=0)}},{key:"index",value:function(m,P){return m===this.textNode?0:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,P)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var m=this.textNode,P=this.selection.getNativeRange(),T=void 0,k=void 0,L=void 0;if(P!=null&&P.start.node===m&&P.end.node===m){var I=[m,P.start.offset,P.end.offset];T=I[0],k=I[1],L=I[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var R=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof v.default?(T=this.next.domNode,this.next.insertAt(0,R),this.textNode.data=y.CONTENTS):(this.textNode.data=R,this.parent.insertBefore(c.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),k!=null){var A=[k,L].map(function(M){return Math.max(0,Math.min(T.data.length,M-1))}),O=i(A,2);return k=O[0],L=O[1],{startNode:T,startOffset:k,endNode:T,endOffset:L}}}}},{key:"update",value:function(m,P){var T=this;if(m.some(function(L){return L.type==="characterData"&&L.target===T.textNode})){var k=this.restore();k&&(P.range=k)}}},{key:"value",value:function(){return""}}]),y}(c.default.Embed);w.blotName="cursor",w.className="ql-cursor",w.tagName="span",w.CONTENTS="\uFEFF",n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=c(i),s=a(4),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return S}(o.default.Container);f.allowedChildren=[u.default,s.BlockEmbed,f],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var i=function(){function w(_,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,y,p){return y&&w(_.prototype,y),p&&w(_,p),_}}(),o=function w(_,y,p){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,y);if(m===void 0){var P=Object.getPrototypeOf(_);return P===null?void 0:w(P,y,p)}else{if("value"in m)return m.value;var T=m.get;return T===void 0?void 0:T.call(p)}},s=a(0),u=c(s);function c(w){return w&&w.__esModule?w:{default:w}}function h(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function v(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function g(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 f=function(w){g(_,w);function _(){return h(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,[{key:"value",value:function(p){var m=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,p);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(P){return("00"+parseInt(P).toString(16)).slice(-2)}).join("")):m}}]),_}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),S=new f("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=f,n.ColorClass=E,n.ColorStyle=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var i=function(){function S(w,_){for(var y=0;y<_.length;y++){var p=_[y];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}return function(w,_,y){return _&&S(w.prototype,_),y&&S(w,y),w}}(),o=function S(w,_,y){w===null&&(w=Function.prototype);var p=Object.getOwnPropertyDescriptor(w,_);if(p===void 0){var m=Object.getPrototypeOf(w);return m===null?void 0:S(m,_,y)}else{if("value"in p)return p.value;var P=p.get;return P===void 0?void 0:P.call(y)}},s=a(6),u=c(s);function c(S){return S&&S.__esModule?S:{default:S}}function h(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function v(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function g(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var f=function(S){g(w,S);function w(){return h(this,w),v(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"format",value:function(y,p){if(y!==this.statics.blotName||!p)return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,y,p);p=this.constructor.sanitize(p),this.domNode.setAttribute("href",p)}}],[{key:"create",value:function(y){var p=o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,y);return y=this.sanitize(y),p.setAttribute("href",y),p.setAttribute("rel","noopener noreferrer"),p.setAttribute("target","_blank"),p}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return E(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),w}(u.default);f.blotName="link",f.tagName="A",f.SANITIZED_URL="about:blank",f.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(S,w){var _=document.createElement("a");_.href=S;var y=_.href.slice(0,_.href.indexOf(":"));return w.indexOf(y)>-1}n.default=f,n.sanitize=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},o=function(){function w(_,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,y,p){return y&&w(_.prototype,y),p&&w(_,p),_}}(),s=a(23),u=v(s),c=a(107),h=v(c);function v(w){return w&&w.__esModule?w:{default:w}}function g(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}var f=0;function E(w,_){w.setAttribute(_,w.getAttribute(_)!=="true")}var S=function(){function w(_){var y=this;g(this,w),this.select=_,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(){y.togglePicker()}),this.label.addEventListener("keydown",function(p){switch(p.keyCode){case u.default.keys.ENTER:y.togglePicker();break;case u.default.keys.ESCAPE:y.escape(),p.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(w,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var p=this,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),y.hasAttribute("value")&&m.setAttribute("data-value",y.getAttribute("value")),y.textContent&&m.setAttribute("data-label",y.textContent),m.addEventListener("click",function(){p.selectItem(m,!0)}),m.addEventListener("keydown",function(P){switch(P.keyCode){case u.default.keys.ENTER:p.selectItem(m,!0),P.preventDefault();break;case u.default.keys.ESCAPE:p.escape(),P.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=h.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,p=document.createElement("span");p.classList.add("ql-picker-options"),p.setAttribute("aria-hidden","true"),p.tabIndex="-1",p.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",p.id),this.options=p,[].slice.call(this.select.options).forEach(function(m){var P=y.buildItem(m);p.appendChild(P),m.selected===!0&&y.selectItem(P)}),this.container.appendChild(p)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(p){y.container.setAttribute(p.name,p.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.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(y){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=this.container.querySelector(".ql-selected");if(y!==m&&(m?.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),p))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":i(Event))==="object"){var P=document.createEvent("Event");P.initEvent("change",!0,!0),this.select.dispatchEvent(P)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var p=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(p)}else this.selectItem(null);var m=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),w}();n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=D(i),s=a(5),u=D(s),c=a(4),h=D(c),v=a(16),g=D(v),f=a(25),E=D(f),S=a(24),w=D(S),_=a(35),y=D(_),p=a(6),m=D(p),P=a(22),T=D(P),k=a(7),L=D(k),I=a(55),R=D(I),A=a(42),O=D(A),M=a(23),q=D(M);function D(te){return te&&te.__esModule?te:{default:te}}u.default.register({"blots/block":h.default,"blots/block/embed":c.BlockEmbed,"blots/break":g.default,"blots/container":E.default,"blots/cursor":w.default,"blots/embed":y.default,"blots/inline":m.default,"blots/scroll":T.default,"blots/text":L.default,"modules/clipboard":R.default,"modules/history":O.default,"modules/keyboard":q.default}),o.default.register(h.default,g.default,w.default,m.default,T.default,L.default),n.default=u.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(u){this.domNode=u,this.domNode[i.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new i.ParchmentError("Blot definition missing tagName");var c;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?c=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?c=document.createElement(u):c=document.createElement(this.tagName[0])):c=document.createElement(this.tagName),this.className&&c.classList.add(this.className),c},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return i.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[i.DATA_KEY]},s.prototype.deleteAt=function(u,c){var h=this.isolate(u,c);h.remove()},s.prototype.formatAt=function(u,c,h,v){var g=this.isolate(u,c);if(i.query(h,i.Scope.BLOT)!=null&&v)g.wrap(h,v);else if(i.query(h,i.Scope.ATTRIBUTE)!=null){var f=i.create(this.statics.scope);g.wrap(f),f.format(h,v)}},s.prototype.insertAt=function(u,c,h){var v=h==null?i.create("text",c):i.create(c,h),g=this.split(u);this.parent.insertBefore(v,g)},s.prototype.insertInto=function(u,c){c===void 0&&(c=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,c),c!=null&&(h=c.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},s.prototype.isolate=function(u,c){var h=this.split(u);return h.split(c),h},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[i.DATA_KEY]!=null&&delete this.domNode[i.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,c){var h=typeof u=="string"?i.create(u,c):u;return h.replace(this),h},s.prototype.split=function(u,c){return u===0?this:this.next},s.prototype.update=function(u,c){},s.prototype.wrap=function(u,c){var h=typeof u=="string"?i.create(u,c):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},s.blotName="abstract",s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(12),o=a(32),s=a(33),u=a(1),c=function(){function h(v){this.attributes={},this.domNode=v,this.build()}return h.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])},h.prototype.build=function(){var v=this;this.attributes={};var g=i.default.keys(this.domNode),f=o.default.keys(this.domNode),E=s.default.keys(this.domNode);g.concat(f).concat(E).forEach(function(S){var w=u.query(S,u.Scope.ATTRIBUTE);w instanceof i.default&&(v.attributes[w.attrName]=w)})},h.prototype.copy=function(v){var g=this;Object.keys(this.attributes).forEach(function(f){var E=g.attributes[f].value(g.domNode);v.format(f,E)})},h.prototype.move=function(v){var g=this;this.copy(v),Object.keys(this.attributes).forEach(function(f){g.attributes[f].remove(g.domNode)}),this.attributes={}},h.prototype.values=function(){var v=this;return Object.keys(this.attributes).reduce(function(g,f){return g[f]=v.attributes[f].value(v.domNode),g},{})},h}();n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var g in v)v.hasOwnProperty(g)&&(h[g]=v[g])};return function(h,v){c(h,v);function g(){this.constructor=h}h.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(c,h){var v=c.getAttribute("class")||"";return v.split(/\s+/).filter(function(g){return g.indexOf(h+"-")===0})}var u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.keys=function(v){return(v.getAttribute("class")||"").split(/\s+/).map(function(g){return g.split("-").slice(0,-1).join("-")})},h.prototype.add=function(v,g){return this.canAdd(v,g)?(this.remove(v),v.classList.add(this.keyName+"-"+g),!0):!1},h.prototype.remove=function(v){var g=s(v,this.keyName);g.forEach(function(f){v.classList.remove(f)}),v.classList.length===0&&v.removeAttribute("class")},h.prototype.value=function(v){var g=s(v,this.keyName)[0]||"",f=g.slice(this.keyName.length+1);return this.canAdd(v,f)?f:""},h}(o.default);n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var g in v)v.hasOwnProperty(g)&&(h[g]=v[g])};return function(h,v){c(h,v);function g(){this.constructor=h}h.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(c){var h=c.split("-"),v=h.slice(1).map(function(g){return g[0].toUpperCase()+g.slice(1)}).join("");return h[0]+v}var u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.keys=function(v){return(v.getAttribute("style")||"").split(";").map(function(g){var f=g.split(":");return f[0].trim()})},h.prototype.add=function(v,g){return this.canAdd(v,g)?(v.style[s(this.keyName)]=g,!0):!1},h.prototype.remove=function(v){v.style[s(this.keyName)]="",v.getAttribute("style")||v.removeAttribute("style")},h.prototype.value=function(v){var g=v.style[s(this.keyName)];return this.canAdd(v,g)?g:""},h}(o.default);n.default=u},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function u(c,h){for(var v=0;v<h.length;v++){var g=h[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,h,v){return h&&u(c.prototype,h),v&&u(c,v),c}}();function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(c,h){o(this,u),this.quill=c,this.options=h,this.modules={}}return i(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(v){h.modules[v]==null&&h.addModule(v)})}},{key:"addModule",value:function(h){var v=this.quill.constructor.import("modules/"+h);return this.modules[h]=new v(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();s.DEFAULTS={modules:{}},s.themes={default:s},n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(y,p){for(var m=0;m<p.length;m++){var P=p[m];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(y,P.key,P)}}return function(y,p,m){return p&&_(y.prototype,p),m&&_(y,m),y}}(),o=function _(y,p,m){y===null&&(y=Function.prototype);var P=Object.getOwnPropertyDescriptor(y,p);if(P===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:_(T,p,m)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(m)}},s=a(0),u=v(s),c=a(7),h=v(c);function v(_){return _&&_.__esModule?_:{default:_}}function g(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function f(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function E(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var S="\uFEFF",w=function(_){E(y,_);function y(p){g(this,y);var m=f(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(P){m.contentNode.appendChild(P)}),m.leftGuard=document.createTextNode(S),m.rightGuard=document.createTextNode(S),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return i(y,[{key:"index",value:function(m,P){return m===this.leftGuard?0:m===this.rightGuard?1:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,P)}},{key:"restore",value:function(m){var P=void 0,T=void 0,k=m.data.split(S).join("");if(m===this.leftGuard)if(this.prev instanceof h.default){var L=this.prev.length();this.prev.insertAt(L,k),P={startNode:this.prev.domNode,startOffset:L+k.length}}else T=document.createTextNode(k),this.parent.insertBefore(u.default.create(T),this),P={startNode:T,startOffset:k.length};else m===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,k),P={startNode:this.next.domNode,startOffset:k.length}):(T=document.createTextNode(k),this.parent.insertBefore(u.default.create(T),this.next),P={startNode:T,startOffset:k.length}));return m.data=S,P}},{key:"update",value:function(m,P){var T=this;m.forEach(function(k){if(k.type==="characterData"&&(k.target===T.leftGuard||k.target===T.rightGuard)){var L=T.restore(k.target);L&&(P.range=L)}})}}]),y}(u.default.Embed);n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var i=a(0),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},c=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),v=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=c,n.AlignClass=h,n.AlignStyle=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var i=a(0),o=u(i),s=a(26);function u(v){return v&&v.__esModule?v:{default:v}}var c=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=c,n.BackgroundStyle=h},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var i=a(0),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},c=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),v=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=c,n.DirectionClass=h,n.DirectionStyle=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var i=function(){function _(y,p){for(var m=0;m<p.length;m++){var P=p[m];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(y,P.key,P)}}return function(y,p,m){return p&&_(y.prototype,p),m&&_(y,m),y}}(),o=function _(y,p,m){y===null&&(y=Function.prototype);var P=Object.getOwnPropertyDescriptor(y,p);if(P===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:_(T,p,m)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(m)}},s=a(0),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function v(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function g(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var f={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",f),S=function(_){g(y,_);function y(){return h(this,y),v(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"value",value:function(m){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),y}(u.default.Attributor.Style),w=new S("font","font-family",f);n.FontStyle=w,n.FontClass=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var i=a(0),o=s(i);function s(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),c=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=c},function(t,n,a){t.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var i=function(){function p(m,P){for(var T=0;T<P.length;T++){var k=P[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(m,k.key,k)}}return function(m,P,T){return P&&p(m.prototype,P),T&&p(m,T),m}}(),o=a(0),s=g(o),u=a(5),c=g(u),h=a(9),v=g(h);function g(p){return p&&p.__esModule?p:{default:p}}function f(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function E(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function S(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var w=function(p){S(m,p);function m(P,T){f(this,m);var k=E(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,P,T));return k.lastRecorded=0,k.ignoreChange=!1,k.clear(),k.quill.on(c.default.events.EDITOR_CHANGE,function(L,I,R,A){L!==c.default.events.TEXT_CHANGE||k.ignoreChange||(!k.options.userOnly||A===c.default.sources.USER?k.record(I,R):k.transform(I))}),k.quill.keyboard.addBinding({key:"Z",shortKey:!0},k.undo.bind(k)),k.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},k.redo.bind(k)),/Win/i.test(navigator.platform)&&k.quill.keyboard.addBinding({key:"Y",shortKey:!0},k.redo.bind(k)),k}return i(m,[{key:"change",value:function(T,k){if(this.stack[T].length!==0){var L=this.stack[T].pop();this.stack[k].push(L),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(L[T],c.default.sources.USER),this.ignoreChange=!1;var I=y(L[T]);this.quill.setSelection(I)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(T,k){if(T.ops.length!==0){this.stack.redo=[];var L=this.quill.getContents().diff(k),I=Date.now();if(this.lastRecorded+this.options.delay>I&&this.stack.undo.length>0){var R=this.stack.undo.pop();L=L.compose(R.undo),T=R.redo.compose(T)}else this.lastRecorded=I;this.stack.undo.push({redo:T,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(T){this.stack.undo.forEach(function(k){k.undo=T.transform(k.undo,!0),k.redo=T.transform(k.redo,!0)}),this.stack.redo.forEach(function(k){k.undo=T.transform(k.undo,!0),k.redo=T.transform(k.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(v.default);w.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function _(p){var m=p.ops[p.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
|
|
146
|
+
`):m.attributes!=null?Object.keys(m.attributes).some(function(P){return s.default.query(P,s.default.Scope.BLOCK)!=null}):!1}function y(p){var m=p.reduce(function(T,k){return T+=k.delete||0,T},0),P=p.length()-m;return _(p)&&(P-=1),P}n.default=w,n.getLastChangeIndex=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var i=function(){function z(F,Y){for(var J=0;J<Y.length;J++){var X=Y[J];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(F,X.key,X)}}return function(F,Y,J){return Y&&z(F.prototype,Y),J&&z(F,J),F}}(),o=function z(F,Y,J){F===null&&(F=Function.prototype);var X=Object.getOwnPropertyDescriptor(F,Y);if(X===void 0){var Q=Object.getPrototypeOf(F);return Q===null?void 0:z(Q,Y,J)}else{if("value"in X)return X.value;var ae=X.get;return ae===void 0?void 0:ae.call(J)}},s=a(3),u=I(s),c=a(2),h=I(c),v=a(8),g=I(v),f=a(23),E=I(f),S=a(34),w=I(S),_=a(59),y=I(_),p=a(60),m=I(p),P=a(28),T=I(P),k=a(61),L=I(k);function I(z){return z&&z.__esModule?z:{default:z}}function R(z,F){if(!(z instanceof F))throw new TypeError("Cannot call a class as a function")}function A(z,F){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:z}function O(z,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);z.prototype=Object.create(F&&F.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(z,F):z.__proto__=F)}var M=[!1,"center","right","justify"],q=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],D=[!1,"serif","monospace"],te=["1","2","3",!1],H=["small",!1,"large","huge"],B=function(z){O(F,z);function F(Y,J){R(this,F);var X=A(this,(F.__proto__||Object.getPrototypeOf(F)).call(this,Y,J)),Q=function ae(se){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",ae);X.tooltip!=null&&!X.tooltip.root.contains(se.target)&&document.activeElement!==X.tooltip.textbox&&!X.quill.hasFocus()&&X.tooltip.hide(),X.pickers!=null&&X.pickers.forEach(function(fe){fe.container.contains(se.target)||fe.close()})};return Y.emitter.listenDOM("click",document.body,Q),X}return i(F,[{key:"addModule",value:function(J){var X=o(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"addModule",this).call(this,J);return J==="toolbar"&&this.extendToolbar(X),X}},{key:"buildButtons",value:function(J,X){J.forEach(function(Q){var ae=Q.getAttribute("class")||"";ae.split(/\s+/).forEach(function(se){if(se.startsWith("ql-")&&(se=se.slice(3),X[se]!=null))if(se==="direction")Q.innerHTML=X[se][""]+X[se].rtl;else if(typeof X[se]=="string")Q.innerHTML=X[se];else{var fe=Q.value||"";fe!=null&&X[se][fe]&&(Q.innerHTML=X[se][fe])}})})}},{key:"buildPickers",value:function(J,X){var Q=this;this.pickers=J.map(function(se){if(se.classList.contains("ql-align"))return se.querySelector("option")==null&&j(se,M),new m.default(se,X.align);if(se.classList.contains("ql-background")||se.classList.contains("ql-color")){var fe=se.classList.contains("ql-background")?"background":"color";return se.querySelector("option")==null&&j(se,q,fe==="background"?"#ffffff":"#000000"),new y.default(se,X[fe])}else return se.querySelector("option")==null&&(se.classList.contains("ql-font")?j(se,D):se.classList.contains("ql-header")?j(se,te):se.classList.contains("ql-size")&&j(se,H)),new T.default(se)});var ae=function(){Q.pickers.forEach(function(fe){fe.update()})};this.quill.on(g.default.events.EDITOR_CHANGE,ae)}}]),F}(w.default);B.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var F=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var J=new FileReader;J.onload=function(X){var Q=F.quill.getSelection(!0);F.quill.updateContents(new h.default().retain(Q.index).delete(Q.length).insert({image:X.target.result}),g.default.sources.USER),F.quill.setSelection(Q.index+1,g.default.sources.SILENT),Y.value=""},J.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var $=function(z){O(F,z);function F(Y,J){R(this,F);var X=A(this,(F.__proto__||Object.getPrototypeOf(F)).call(this,Y,J));return X.textbox=X.root.querySelector('input[type="text"]'),X.listen(),X}return i(F,[{key:"listen",value:function(){var J=this;this.textbox.addEventListener("keydown",function(X){E.default.match(X,"enter")?(J.save(),X.preventDefault()):E.default.match(X,"escape")&&(J.cancel(),X.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),X!=null?this.textbox.value=X:J!==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-"+J)||""),this.root.setAttribute("data-mode",J)}},{key:"restoreFocus",value:function(){var J=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=J}},{key:"save",value:function(){var J=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var X=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",J,g.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",J,g.default.sources.USER)),this.quill.root.scrollTop=X;break}case"video":J=V(J);case"formula":{if(!J)break;var Q=this.quill.getSelection(!0);if(Q!=null){var ae=Q.index+Q.length;this.quill.insertEmbed(ae,this.root.getAttribute("data-mode"),J,g.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ae+1," ",g.default.sources.USER),this.quill.setSelection(ae+2,g.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),F}(L.default);function V(z){var F=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return F?(F[1]||"https")+"://www.youtube.com/embed/"+F[2]+"?showinfo=0":(F=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(F[1]||"https")+"://player.vimeo.com/video/"+F[2]+"/":z}function j(z,F){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;F.forEach(function(J){var X=document.createElement("option");J===Y?X.setAttribute("selected","selected"):X.setAttribute("value",J),z.appendChild(X)})}n.BaseTooltip=$,n.default=B},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,c=this.iterator();u=c();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var u=0,c=this.head;c!=null;){if(c===s)return u;u+=c.length(),c=c.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var c,h=this.iterator();c=h();){var v=c.length();if(s<v||u&&s===v&&(c.next==null||c.next.length()!==0))return[c,s];s-=v}return[null,0]},o.prototype.forEach=function(s){for(var u,c=this.iterator();u=c();)s(u)},o.prototype.forEachAt=function(s,u,c){if(!(u<=0))for(var h=this.find(s),v=h[0],g=h[1],f,E=s-g,S=this.iterator(v);(f=S())&&E<s+u;){var w=f.length();s>E?c(f,s-E,Math.min(u,E+w-s)):c(f,0,Math.min(w,s+u-E)),E+=w}},o.prototype.map=function(s){return this.reduce(function(u,c){return u.push(s(c)),u},[])},o.prototype.reduce=function(s,u){for(var c,h=this.iterator();c=h();)u=s(u,c);return u},o}();n.default=i},function(t,n,a){var i=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,f){g.__proto__=f}||function(g,f){for(var E in f)f.hasOwnProperty(E)&&(g[E]=f[E])};return function(g,f){v(g,f);function E(){this.constructor=g}g.prototype=f===null?Object.create(f):(E.prototype=f.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(17),s=a(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},c=100,h=function(v){i(g,v);function g(f){var E=v.call(this,f)||this;return E.scroll=E,E.observer=new MutationObserver(function(S){E.update(S)}),E.observer.observe(E.domNode,u),E.attach(),E}return g.prototype.detach=function(){v.prototype.detach.call(this),this.observer.disconnect()},g.prototype.deleteAt=function(f,E){this.update(),f===0&&E===this.length()?this.children.forEach(function(S){S.remove()}):v.prototype.deleteAt.call(this,f,E)},g.prototype.formatAt=function(f,E,S,w){this.update(),v.prototype.formatAt.call(this,f,E,S,w)},g.prototype.insertAt=function(f,E,S){this.update(),v.prototype.insertAt.call(this,f,E,S)},g.prototype.optimize=function(f,E){var S=this;f===void 0&&(f=[]),E===void 0&&(E={}),v.prototype.optimize.call(this,E);for(var w=[].slice.call(this.observer.takeRecords());w.length>0;)f.push(w.pop());for(var _=function(P,T){T===void 0&&(T=!0),!(P==null||P===S)&&P.domNode.parentNode!=null&&(P.domNode[s.DATA_KEY].mutations==null&&(P.domNode[s.DATA_KEY].mutations=[]),T&&_(P.parent))},y=function(P){P.domNode[s.DATA_KEY]==null||P.domNode[s.DATA_KEY].mutations==null||(P instanceof o.default&&P.children.forEach(y),P.optimize(E))},p=f,m=0;p.length>0;m+=1){if(m>=c)throw new Error("[Parchment] Maximum optimize iterations reached");for(p.forEach(function(P){var T=s.find(P.target,!0);T!=null&&(T.domNode===P.target&&(P.type==="childList"?(_(s.find(P.previousSibling,!1)),[].forEach.call(P.addedNodes,function(k){var L=s.find(k,!1);_(L,!1),L instanceof o.default&&L.children.forEach(function(I){_(I,!1)})})):P.type==="attributes"&&_(T.prev)),_(T))}),this.children.forEach(y),p=[].slice.call(this.observer.takeRecords()),w=p.slice();w.length>0;)f.push(w.pop())}},g.prototype.update=function(f,E){var S=this;E===void 0&&(E={}),f=f||this.observer.takeRecords(),f.map(function(w){var _=s.find(w.target,!0);return _==null?null:_.domNode[s.DATA_KEY].mutations==null?(_.domNode[s.DATA_KEY].mutations=[w],_):(_.domNode[s.DATA_KEY].mutations.push(w),null)}).forEach(function(w){w==null||w===S||w.domNode[s.DATA_KEY]==null||w.update(w.domNode[s.DATA_KEY].mutations||[],E)}),this.domNode[s.DATA_KEY].mutations!=null&&v.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,E),this.optimize(f,E)},g.blotName="scroll",g.defaultChild="block",g.scope=s.Scope.BLOCK_BLOT,g.tagName="DIV",g}(o.default);n.default=h},function(t,n,a){var i=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var f in g)g.hasOwnProperty(f)&&(v[f]=g[f])};return function(v,g){h(v,g);function f(){this.constructor=v}v.prototype=g===null?Object.create(g):(f.prototype=g.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1);function u(h,v){if(Object.keys(h).length!==Object.keys(v).length)return!1;for(var g in h)if(h[g]!==v[g])return!1;return!0}var c=function(h){i(v,h);function v(){return h!==null&&h.apply(this,arguments)||this}return v.formats=function(g){if(g.tagName!==v.tagName)return h.formats.call(this,g)},v.prototype.format=function(g,f){var E=this;g===this.statics.blotName&&!f?(this.children.forEach(function(S){S instanceof o.default||(S=S.wrap(v.blotName,!0)),E.attributes.copy(S)}),this.unwrap()):h.prototype.format.call(this,g,f)},v.prototype.formatAt=function(g,f,E,S){if(this.formats()[E]!=null||s.query(E,s.Scope.ATTRIBUTE)){var w=this.isolate(g,f);w.format(E,S)}else h.prototype.formatAt.call(this,g,f,E,S)},v.prototype.optimize=function(g){h.prototype.optimize.call(this,g);var f=this.formats();if(Object.keys(f).length===0)return this.unwrap();var E=this.next;E instanceof v&&E.prev===this&&u(f,E.formats())&&(E.moveChildren(this),E.remove())},v.blotName="inline",v.scope=s.Scope.INLINE_BLOT,v.tagName="SPAN",v}(o.default);n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var g in v)v.hasOwnProperty(g)&&(h[g]=v[g])};return function(h,v){c(h,v);function g(){this.constructor=h}h.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1),u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.formats=function(v){var g=s.query(h.blotName).tagName;if(v.tagName!==g)return c.formats.call(this,v)},h.prototype.format=function(v,g){s.query(v,s.Scope.BLOCK)!=null&&(v===this.statics.blotName&&!g?this.replaceWith(h.blotName):c.prototype.format.call(this,v,g))},h.prototype.formatAt=function(v,g,f,E){s.query(f,s.Scope.BLOCK)!=null?this.format(f,E):c.prototype.formatAt.call(this,v,g,f,E)},h.prototype.insertAt=function(v,g,f){if(f==null||s.query(g,s.Scope.INLINE)!=null)c.prototype.insertAt.call(this,v,g,f);else{var E=this.split(v),S=s.create(g,f);E.parent.insertBefore(S,E)}},h.prototype.update=function(v,g){navigator.userAgent.match(/Trident/)?this.build():c.prototype.update.call(this,v,g)},h.blotName="block",h.scope=s.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var v in h)h.hasOwnProperty(v)&&(c[v]=h[v])};return function(c,h){u(c,h);function v(){this.constructor=c}c.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=function(u){i(c,u);function c(){return u!==null&&u.apply(this,arguments)||this}return c.formats=function(h){},c.prototype.format=function(h,v){u.prototype.formatAt.call(this,0,this.length(),h,v)},c.prototype.formatAt=function(h,v,g,f){h===0&&v===this.length()?this.format(g,f):u.prototype.formatAt.call(this,h,v,g,f)},c.prototype.formats=function(){return this.statics.formats(this.domNode)},c}(o.default);n.default=s},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var g in v)v.hasOwnProperty(g)&&(h[g]=v[g])};return function(h,v){c(h,v);function g(){this.constructor=h}h.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=a(1),u=function(c){i(h,c);function h(v){var g=c.call(this,v)||this;return g.text=g.statics.value(g.domNode),g}return h.create=function(v){return document.createTextNode(v)},h.value=function(v){var g=v.data;return g.normalize&&(g=g.normalize()),g},h.prototype.deleteAt=function(v,g){this.domNode.data=this.text=this.text.slice(0,v)+this.text.slice(v+g)},h.prototype.index=function(v,g){return this.domNode===v?g:-1},h.prototype.insertAt=function(v,g,f){f==null?(this.text=this.text.slice(0,v)+g+this.text.slice(v),this.domNode.data=this.text):c.prototype.insertAt.call(this,v,g,f)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(v){c.prototype.optimize.call(this,v),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(v,g){return[this.domNode,v]},h.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 f=s.create(this.domNode.splitText(v));return this.parent.insertBefore(f,this.next),this.text=this.statics.value(this.domNode),f},h.prototype.update=function(v,g){var f=this;v.some(function(E){return E.type==="characterData"&&E.target===f.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=s.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(t,n,a){var i=document.createElement("div");if(i.classList.toggle("test-class",!1),i.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var c=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>c.length)&&(u=c.length),u-=s.length;var h=c.indexOf(s,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var c=Object(this),h=c.length>>>0,v=arguments[1],g,f=0;f<h;f++)if(g=c[f],u.call(v,g,f,c))return g}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,n){var a=-1,i=1,o=0;function s(m,P,T){if(m==P)return m?[[o,m]]:[];(T<0||m.length<T)&&(T=null);var k=v(m,P),L=m.substring(0,k);m=m.substring(k),P=P.substring(k),k=g(m,P);var I=m.substring(m.length-k);m=m.substring(0,m.length-k),P=P.substring(0,P.length-k);var R=u(m,P);return L&&R.unshift([o,L]),I&&R.push([o,I]),E(R),T!=null&&(R=_(R,T)),R=y(R),R}function u(m,P){var T;if(!m)return[[i,P]];if(!P)return[[a,m]];var k=m.length>P.length?m:P,L=m.length>P.length?P:m,I=k.indexOf(L);if(I!=-1)return T=[[i,k.substring(0,I)],[o,L],[i,k.substring(I+L.length)]],m.length>P.length&&(T[0][0]=T[2][0]=a),T;if(L.length==1)return[[a,m],[i,P]];var R=f(m,P);if(R){var A=R[0],O=R[1],M=R[2],q=R[3],D=R[4],te=s(A,M),H=s(O,q);return te.concat([[o,D]],H)}return c(m,P)}function c(m,P){for(var T=m.length,k=P.length,L=Math.ceil((T+k)/2),I=L,R=2*L,A=new Array(R),O=new Array(R),M=0;M<R;M++)A[M]=-1,O[M]=-1;A[I+1]=0,O[I+1]=0;for(var q=T-k,D=q%2!=0,te=0,H=0,B=0,$=0,V=0;V<L;V++){for(var j=-V+te;j<=V-H;j+=2){var z=I+j,F;j==-V||j!=V&&A[z-1]<A[z+1]?F=A[z+1]:F=A[z-1]+1;for(var Y=F-j;F<T&&Y<k&&m.charAt(F)==P.charAt(Y);)F++,Y++;if(A[z]=F,F>T)H+=2;else if(Y>k)te+=2;else if(D){var J=I+q-j;if(J>=0&&J<R&&O[J]!=-1){var X=T-O[J];if(F>=X)return h(m,P,F,Y)}}}for(var Q=-V+B;Q<=V-$;Q+=2){var J=I+Q,X;Q==-V||Q!=V&&O[J-1]<O[J+1]?X=O[J+1]:X=O[J-1]+1;for(var ae=X-Q;X<T&&ae<k&&m.charAt(T-X-1)==P.charAt(k-ae-1);)X++,ae++;if(O[J]=X,X>T)$+=2;else if(ae>k)B+=2;else if(!D){var z=I+q-Q;if(z>=0&&z<R&&A[z]!=-1){var F=A[z],Y=I+F-z;if(X=T-X,F>=X)return h(m,P,F,Y)}}}}return[[a,m],[i,P]]}function h(m,P,T,k){var L=m.substring(0,T),I=P.substring(0,k),R=m.substring(T),A=P.substring(k),O=s(L,I),M=s(R,A);return O.concat(M)}function v(m,P){if(!m||!P||m.charAt(0)!=P.charAt(0))return 0;for(var T=0,k=Math.min(m.length,P.length),L=k,I=0;T<L;)m.substring(I,L)==P.substring(I,L)?(T=L,I=T):k=L,L=Math.floor((k-T)/2+T);return L}function g(m,P){if(!m||!P||m.charAt(m.length-1)!=P.charAt(P.length-1))return 0;for(var T=0,k=Math.min(m.length,P.length),L=k,I=0;T<L;)m.substring(m.length-L,m.length-I)==P.substring(P.length-L,P.length-I)?(T=L,I=T):k=L,L=Math.floor((k-T)/2+T);return L}function f(m,P){var T=m.length>P.length?m:P,k=m.length>P.length?P:m;if(T.length<4||k.length*2<T.length)return null;function L(H,B,$){for(var V=H.substring($,$+Math.floor(H.length/4)),j=-1,z="",F,Y,J,X;(j=B.indexOf(V,j+1))!=-1;){var Q=v(H.substring($),B.substring(j)),ae=g(H.substring(0,$),B.substring(0,j));z.length<ae+Q&&(z=B.substring(j-ae,j)+B.substring(j,j+Q),F=H.substring(0,$-ae),Y=H.substring($+Q),J=B.substring(0,j-ae),X=B.substring(j+Q))}return z.length*2>=H.length?[F,Y,J,X,z]:null}var I=L(T,k,Math.ceil(T.length/4)),R=L(T,k,Math.ceil(T.length/2)),A;if(!I&&!R)return null;R?I?A=I[4].length>R[4].length?I:R:A=R:A=I;var O,M,q,D;m.length>P.length?(O=A[0],M=A[1],q=A[2],D=A[3]):(q=A[0],D=A[1],O=A[2],M=A[3]);var te=A[4];return[O,M,q,D,te]}function E(m){m.push([o,""]);for(var P=0,T=0,k=0,L="",I="",R;P<m.length;)switch(m[P][0]){case i:k++,I+=m[P][1],P++;break;case a:T++,L+=m[P][1],P++;break;case o:T+k>1?(T!==0&&k!==0&&(R=v(I,L),R!==0&&(P-T-k>0&&m[P-T-k-1][0]==o?m[P-T-k-1][1]+=I.substring(0,R):(m.splice(0,0,[o,I.substring(0,R)]),P++),I=I.substring(R),L=L.substring(R)),R=g(I,L),R!==0&&(m[P][1]=I.substring(I.length-R)+m[P][1],I=I.substring(0,I.length-R),L=L.substring(0,L.length-R))),T===0?m.splice(P-k,T+k,[i,I]):k===0?m.splice(P-T,T+k,[a,L]):m.splice(P-T-k,T+k,[a,L],[i,I]),P=P-T-k+(T?1:0)+(k?1:0)+1):P!==0&&m[P-1][0]==o?(m[P-1][1]+=m[P][1],m.splice(P,1)):P++,k=0,T=0,L="",I="";break}m[m.length-1][1]===""&&m.pop();var A=!1;for(P=1;P<m.length-1;)m[P-1][0]==o&&m[P+1][0]==o&&(m[P][1].substring(m[P][1].length-m[P-1][1].length)==m[P-1][1]?(m[P][1]=m[P-1][1]+m[P][1].substring(0,m[P][1].length-m[P-1][1].length),m[P+1][1]=m[P-1][1]+m[P+1][1],m.splice(P-1,1),A=!0):m[P][1].substring(0,m[P+1][1].length)==m[P+1][1]&&(m[P-1][1]+=m[P+1][1],m[P][1]=m[P][1].substring(m[P+1][1].length)+m[P+1][1],m.splice(P+1,1),A=!0)),P++;A&&E(m)}var S=s;S.INSERT=i,S.DELETE=a,S.EQUAL=o,t.exports=S;function w(m,P){if(P===0)return[o,m];for(var T=0,k=0;k<m.length;k++){var L=m[k];if(L[0]===a||L[0]===o){var I=T+L[1].length;if(P===I)return[k+1,m];if(P<I){m=m.slice();var R=P-T,A=[L[0],L[1].slice(0,R)],O=[L[0],L[1].slice(R)];return m.splice(k,1,A,O),[k+1,m]}else T=I}}throw new Error("cursor_pos is out of bounds!")}function _(m,P){var T=w(m,P),k=T[1],L=T[0],I=k[L],R=k[L+1];if(I==null)return m;if(I[0]!==o)return m;if(R!=null&&I[1]+R[1]===R[1]+I[1])return k.splice(L,2,R,I),p(k,L,2);if(R!=null&&R[1].indexOf(I[1])===0){k.splice(L,2,[R[0],I[1]],[0,I[1]]);var A=R[1].slice(I[1].length);return A.length>0&&k.splice(L+2,0,[R[0],A]),p(k,L,3)}else return m}function y(m){for(var P=!1,T=function(R){return R.charCodeAt(0)>=56320&&R.charCodeAt(0)<=57343},k=function(R){return R.charCodeAt(R.length-1)>=55296&&R.charCodeAt(R.length-1)<=56319},L=2;L<m.length;L+=1)m[L-2][0]===o&&k(m[L-2][1])&&m[L-1][0]===a&&T(m[L-1][1])&&m[L][0]===i&&T(m[L][1])&&(P=!0,m[L-1][1]=m[L-2][1].slice(-1)+m[L-1][1],m[L][1]=m[L-2][1].slice(-1)+m[L][1],m[L-2][1]=m[L-2][1].slice(0,-1));if(!P)return m;for(var I=[],L=0;L<m.length;L+=1)m[L][1].length>0&&I.push(m[L]);return I}function p(m,P,T){for(var k=P+T-1;k>=0&&k>=P-1;k--)if(k+1<m.length){var L=m[k],I=m[k+1];L[0]===I[1]&&m.splice(k,2,[L[0],L[1]+I[1]])}return m}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(i){var o=[];for(var s in i)o.push(s);return o}},function(t,n){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=t.exports=a?i:o,n.supported=i;function i(s){return Object.prototype.toString.call(s)=="[object Arguments]"}n.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}},function(t,n){var a=Object.prototype.hasOwnProperty,i="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1));function s(c,h,v){this.fn=c,this.context=h,this.once=v||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],v,g;if(this._eventsCount===0)return h;for(g in v=this._events)a.call(v,g)&&h.push(i?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},u.prototype.listeners=function(h,v){var g=i?i+h:h,f=this._events[g];if(v)return!!f;if(!f)return[];if(f.fn)return[f.fn];for(var E=0,S=f.length,w=new Array(S);E<S;E++)w[E]=f[E].fn;return w},u.prototype.emit=function(h,v,g,f,E,S){var w=i?i+h:h;if(!this._events[w])return!1;var _=this._events[w],y=arguments.length,p,m;if(_.fn){switch(_.once&&this.removeListener(h,_.fn,void 0,!0),y){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,v),!0;case 3:return _.fn.call(_.context,v,g),!0;case 4:return _.fn.call(_.context,v,g,f),!0;case 5:return _.fn.call(_.context,v,g,f,E),!0;case 6:return _.fn.call(_.context,v,g,f,E,S),!0}for(m=1,p=new Array(y-1);m<y;m++)p[m-1]=arguments[m];_.fn.apply(_.context,p)}else{var P=_.length,T;for(m=0;m<P;m++)switch(_[m].once&&this.removeListener(h,_[m].fn,void 0,!0),y){case 1:_[m].fn.call(_[m].context);break;case 2:_[m].fn.call(_[m].context,v);break;case 3:_[m].fn.call(_[m].context,v,g);break;case 4:_[m].fn.call(_[m].context,v,g,f);break;default:if(!p)for(T=1,p=new Array(y-1);T<y;T++)p[T-1]=arguments[T];_[m].fn.apply(_[m].context,p)}}return!0},u.prototype.on=function(h,v,g){var f=new s(v,g||this),E=i?i+h:h;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],f]:this._events[E].push(f):(this._events[E]=f,this._eventsCount++),this},u.prototype.once=function(h,v,g){var f=new s(v,g||this,!0),E=i?i+h:h;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],f]:this._events[E].push(f):(this._events[E]=f,this._eventsCount++),this},u.prototype.removeListener=function(h,v,g,f){var E=i?i+h:h;if(!this._events[E])return this;if(!v)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var S=this._events[E];if(S.fn)S.fn===v&&(!f||S.once)&&(!g||S.context===g)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var w=0,_=[],y=S.length;w<y;w++)(S[w].fn!==v||f&&!S[w].once||g&&S[w].context!==g)&&_.push(S[w]);_.length?this._events[E]=_.length===1?_[0]:_:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(h){var v;return h?(v=i?i+h:h,this._events[v]&&(--this._eventsCount===0?this._events=new o:delete this._events[v])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},o=function(){function Ce(he,ke){var Te=[],ve=!0,Se=!1,je=void 0;try{for(var Ue=he[Symbol.iterator](),ct;!(ve=(ct=Ue.next()).done)&&(Te.push(ct.value),!(ke&&Te.length===ke));ve=!0);}catch(mt){Se=!0,je=mt}finally{try{!ve&&Ue.return&&Ue.return()}finally{if(Se)throw je}}return Te}return function(he,ke){if(Array.isArray(he))return he;if(Symbol.iterator in Object(he))return Ce(he,ke);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Ce(he,ke){for(var Te=0;Te<ke.length;Te++){var ve=ke[Te];ve.enumerable=ve.enumerable||!1,ve.configurable=!0,"value"in ve&&(ve.writable=!0),Object.defineProperty(he,ve.key,ve)}}return function(he,ke,Te){return ke&&Ce(he.prototype,ke),Te&&Ce(he,Te),he}}(),u=a(3),c=O(u),h=a(2),v=O(h),g=a(0),f=O(g),E=a(5),S=O(E),w=a(10),_=O(w),y=a(9),p=O(y),m=a(36),P=a(37),T=a(13),k=O(T),L=a(26),I=a(38),R=a(39),A=a(40);function O(Ce){return Ce&&Ce.__esModule?Ce:{default:Ce}}function M(Ce,he,ke){return he in Ce?Object.defineProperty(Ce,he,{value:ke,enumerable:!0,configurable:!0,writable:!0}):Ce[he]=ke,Ce}function q(Ce,he){if(!(Ce instanceof he))throw new TypeError("Cannot call a class as a function")}function D(Ce,he){if(!Ce)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return he&&(typeof he=="object"||typeof he=="function")?he:Ce}function te(Ce,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof he);Ce.prototype=Object.create(he&&he.prototype,{constructor:{value:Ce,enumerable:!1,writable:!0,configurable:!0}}),he&&(Object.setPrototypeOf?Object.setPrototypeOf(Ce,he):Ce.__proto__=he)}var H=(0,_.default)("quill:clipboard"),B="__ql-matcher",$=[[Node.TEXT_NODE,nt],[Node.TEXT_NODE,Re],["br",be],[Node.ELEMENT_NODE,Re],[Node.ELEMENT_NODE,fe],[Node.ELEMENT_NODE,Pe],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,ye],["li",Ae],["b",ae.bind(ae,"bold")],["i",ae.bind(ae,"italic")],["style",_e]],V=[m.AlignAttribute,I.DirectionAttribute].reduce(function(Ce,he){return Ce[he.keyName]=he,Ce},{}),j=[m.AlignStyle,P.BackgroundStyle,L.ColorStyle,I.DirectionStyle,R.FontStyle,A.SizeStyle].reduce(function(Ce,he){return Ce[he.keyName]=he,Ce},{}),z=function(Ce){te(he,Ce);function he(ke,Te){q(this,he);var ve=D(this,(he.__proto__||Object.getPrototypeOf(he)).call(this,ke,Te));return ve.quill.root.addEventListener("paste",ve.onPaste.bind(ve)),ve.container=ve.quill.addContainer("ql-clipboard"),ve.container.setAttribute("contenteditable",!0),ve.container.setAttribute("tabindex",-1),ve.matchers=[],$.concat(ve.options.matchers).forEach(function(Se){var je=o(Se,2),Ue=je[0],ct=je[1];!Te.matchVisual&&ct===Pe||ve.addMatcher(Ue,ct)}),ve}return s(he,[{key:"addMatcher",value:function(Te,ve){this.matchers.push([Te,ve])}},{key:"convert",value:function(Te){if(typeof Te=="string")return this.container.innerHTML=Te.replace(/\>\r?\n +\</g,"><"),this.convert();var ve=this.quill.getFormat(this.quill.selection.savedRange.index);if(ve[k.default.blotName]){var Se=this.container.innerText;return this.container.innerHTML="",new v.default().insert(Se,M({},k.default.blotName,ve[k.default.blotName]))}var je=this.prepareMatching(),Ue=o(je,2),ct=Ue[0],mt=Ue[1],yt=Q(this.container,ct,mt);return J(yt,`
|
|
147
|
+
`)&&yt.ops[yt.ops.length-1].attributes==null&&(yt=yt.compose(new v.default().retain(yt.length()-1).delete(1))),H.log("convert",this.container.innerHTML,yt),this.container.innerHTML="",yt}},{key:"dangerouslyPasteHTML",value:function(Te,ve){var Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof Te=="string")this.quill.setContents(this.convert(Te),ve),this.quill.setSelection(0,S.default.sources.SILENT);else{var je=this.convert(ve);this.quill.updateContents(new v.default().retain(Te).concat(je),Se),this.quill.setSelection(Te+je.length(),S.default.sources.SILENT)}}},{key:"onPaste",value:function(Te){var ve=this;if(!(Te.defaultPrevented||!this.quill.isEnabled())){var Se=this.quill.getSelection(),je=new v.default().retain(Se.index),Ue=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(S.default.sources.SILENT),setTimeout(function(){je=je.concat(ve.convert()).delete(Se.length),ve.quill.updateContents(je,S.default.sources.USER),ve.quill.setSelection(je.length()-Se.length,S.default.sources.SILENT),ve.quill.scrollingContainer.scrollTop=Ue,ve.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Te=this,ve=[],Se=[];return this.matchers.forEach(function(je){var Ue=o(je,2),ct=Ue[0],mt=Ue[1];switch(ct){case Node.TEXT_NODE:Se.push(mt);break;case Node.ELEMENT_NODE:ve.push(mt);break;default:[].forEach.call(Te.container.querySelectorAll(ct),function(yt){yt[B]=yt[B]||[],yt[B].push(mt)});break}}),[ve,Se]}}]),he}(p.default);z.DEFAULTS={matchers:[],matchVisual:!0};function F(Ce,he,ke){return(typeof he>"u"?"undefined":i(he))==="object"?Object.keys(he).reduce(function(Te,ve){return F(Te,ve,he[ve])},Ce):Ce.reduce(function(Te,ve){return ve.attributes&&ve.attributes[he]?Te.push(ve):Te.insert(ve.insert,(0,c.default)({},M({},he,ke),ve.attributes))},new v.default)}function Y(Ce){if(Ce.nodeType!==Node.ELEMENT_NODE)return{};var he="__ql-computed-style";return Ce[he]||(Ce[he]=window.getComputedStyle(Ce))}function J(Ce,he){for(var ke="",Te=Ce.ops.length-1;Te>=0&&ke.length<he.length;--Te){var ve=Ce.ops[Te];if(typeof ve.insert!="string")break;ke=ve.insert+ke}return ke.slice(-1*he.length)===he}function X(Ce){if(Ce.childNodes.length===0)return!1;var he=Y(Ce);return["block","list-item"].indexOf(he.display)>-1}function Q(Ce,he,ke){return Ce.nodeType===Ce.TEXT_NODE?ke.reduce(function(Te,ve){return ve(Ce,Te)},new v.default):Ce.nodeType===Ce.ELEMENT_NODE?[].reduce.call(Ce.childNodes||[],function(Te,ve){var Se=Q(ve,he,ke);return ve.nodeType===Ce.ELEMENT_NODE&&(Se=he.reduce(function(je,Ue){return Ue(ve,je)},Se),Se=(ve[B]||[]).reduce(function(je,Ue){return Ue(ve,je)},Se)),Te.concat(Se)},new v.default):new v.default}function ae(Ce,he,ke){return F(ke,Ce,!0)}function se(Ce,he){var ke=f.default.Attributor.Attribute.keys(Ce),Te=f.default.Attributor.Class.keys(Ce),ve=f.default.Attributor.Style.keys(Ce),Se={};return ke.concat(Te).concat(ve).forEach(function(je){var Ue=f.default.query(je,f.default.Scope.ATTRIBUTE);Ue!=null&&(Se[Ue.attrName]=Ue.value(Ce),Se[Ue.attrName])||(Ue=V[je],Ue!=null&&(Ue.attrName===je||Ue.keyName===je)&&(Se[Ue.attrName]=Ue.value(Ce)||void 0),Ue=j[je],Ue!=null&&(Ue.attrName===je||Ue.keyName===je)&&(Ue=j[je],Se[Ue.attrName]=Ue.value(Ce)||void 0))}),Object.keys(Se).length>0&&(he=F(he,Se)),he}function fe(Ce,he){var ke=f.default.query(Ce);if(ke==null)return he;if(ke.prototype instanceof f.default.Embed){var Te={},ve=ke.value(Ce);ve!=null&&(Te[ke.blotName]=ve,he=new v.default().insert(Te,ke.formats(Ce)))}else typeof ke.formats=="function"&&(he=F(he,ke.blotName,ke.formats(Ce)));return he}function be(Ce,he){return J(he,`
|
|
148
|
+
`)||he.insert(`
|
|
149
|
+
`),he}function _e(){return new v.default}function Ae(Ce,he){var ke=f.default.query(Ce);if(ke==null||ke.blotName!=="list-item"||!J(he,`
|
|
150
|
+
`))return he;for(var Te=-1,ve=Ce.parentNode;!ve.classList.contains("ql-clipboard");)(f.default.query(ve)||{}).blotName==="list"&&(Te+=1),ve=ve.parentNode;return Te<=0?he:he.compose(new v.default().retain(he.length()-1).retain(1,{indent:Te}))}function Re(Ce,he){return J(he,`
|
|
151
|
+
`)||(X(Ce)||he.length()>0&&Ce.nextSibling&&X(Ce.nextSibling))&&he.insert(`
|
|
152
|
+
`),he}function Pe(Ce,he){if(X(Ce)&&Ce.nextElementSibling!=null&&!J(he,`
|
|
153
|
+
|
|
154
|
+
`)){var ke=Ce.offsetHeight+parseFloat(Y(Ce).marginTop)+parseFloat(Y(Ce).marginBottom);Ce.nextElementSibling.offsetTop>Ce.offsetTop+ke*1.5&&he.insert(`
|
|
155
|
+
`)}return he}function ye(Ce,he){var ke={},Te=Ce.style||{};return Te.fontStyle&&Y(Ce).fontStyle==="italic"&&(ke.italic=!0),Te.fontWeight&&(Y(Ce).fontWeight.startsWith("bold")||parseInt(Y(Ce).fontWeight)>=700)&&(ke.bold=!0),Object.keys(ke).length>0&&(he=F(he,ke)),parseFloat(Te.textIndent||0)>0&&(he=new v.default().insert(" ").concat(he)),he}function nt(Ce,he){var ke=Ce.data;if(Ce.parentNode.tagName==="O:P")return he.insert(ke.trim());if(ke.trim().length===0&&Ce.parentNode.classList.contains("ql-clipboard"))return he;if(!Y(Ce.parentNode).whiteSpace.startsWith("pre")){var Te=function(Se,je){return je=je.replace(/[^\u00a0]/g,""),je.length<1&&Se?" ":je};ke=ke.replace(/\r\n/g," ").replace(/\n/g," "),ke=ke.replace(/\s\s+/g,Te.bind(Te,!0)),(Ce.previousSibling==null&&X(Ce.parentNode)||Ce.previousSibling!=null&&X(Ce.previousSibling))&&(ke=ke.replace(/^\s+/,Te.bind(Te,!1))),(Ce.nextSibling==null&&X(Ce.parentNode)||Ce.nextSibling!=null&&X(Ce.nextSibling))&&(ke=ke.replace(/\s+$/,Te.bind(Te,!1)))}return he.insert(ke)}n.default=z,n.matchAttributor=se,n.matchBlot=fe,n.matchNewline=Re,n.matchSpacing=Pe,n.matchText=nt},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function E(S,w){for(var _=0;_<w.length;_++){var y=w[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}return function(S,w,_){return w&&E(S.prototype,w),_&&E(S,_),S}}(),o=function E(S,w,_){S===null&&(S=Function.prototype);var y=Object.getOwnPropertyDescriptor(S,w);if(y===void 0){var p=Object.getPrototypeOf(S);return p===null?void 0:E(p,w,_)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(_)}},s=a(6),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"optimize",value:function(_){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,_),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),S}(u.default);f.blotName="bold",f.tagName=["STRONG","B"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var i=function(){function A(O,M){var q=[],D=!0,te=!1,H=void 0;try{for(var B=O[Symbol.iterator](),$;!(D=($=B.next()).done)&&(q.push($.value),!(M&&q.length===M));D=!0);}catch(V){te=!0,H=V}finally{try{!D&&B.return&&B.return()}finally{if(te)throw H}}return q}return function(O,M){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return A(O,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(O,M){for(var q=0;q<M.length;q++){var D=M[q];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,M,q){return M&&A(O.prototype,M),q&&A(O,q),O}}(),s=a(2),u=_(s),c=a(0),h=_(c),v=a(5),g=_(v),f=a(10),E=_(f),S=a(9),w=_(S);function _(A){return A&&A.__esModule?A:{default:A}}function y(A,O,M){return O in A?Object.defineProperty(A,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[O]=M,A}function p(A,O){if(!(A instanceof O))throw new TypeError("Cannot call a class as a function")}function m(A,O){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:A}function P(A,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);A.prototype=Object.create(O&&O.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(A,O):A.__proto__=O)}var T=(0,E.default)("quill:toolbar"),k=function(A){P(O,A);function O(M,q){p(this,O);var D=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,M,q));if(Array.isArray(D.options.container)){var te=document.createElement("div");I(te,D.options.container),M.container.parentNode.insertBefore(te,M.container),D.container=te}else typeof D.options.container=="string"?D.container=document.querySelector(D.options.container):D.container=D.options.container;if(!(D.container instanceof HTMLElement)){var H;return H=T.error("Container required for toolbar",D.options),m(D,H)}return D.container.classList.add("ql-toolbar"),D.controls=[],D.handlers={},Object.keys(D.options.handlers).forEach(function(B){D.addHandler(B,D.options.handlers[B])}),[].forEach.call(D.container.querySelectorAll("button, select"),function(B){D.attach(B)}),D.quill.on(g.default.events.EDITOR_CHANGE,function(B,$){B===g.default.events.SELECTION_CHANGE&&D.update($)}),D.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){var B=D.quill.selection.getRange(),$=i(B,1),V=$[0];D.update(V)}),D}return o(O,[{key:"addHandler",value:function(q,D){this.handlers[q]=D}},{key:"attach",value:function(q){var D=this,te=[].find.call(q.classList,function(B){return B.indexOf("ql-")===0});if(te){if(te=te.slice(3),q.tagName==="BUTTON"&&q.setAttribute("type","button"),this.handlers[te]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[te]==null){T.warn("ignoring attaching to disabled format",te,q);return}if(h.default.query(te)==null){T.warn("ignoring attaching to nonexistent format",te,q);return}}var H=q.tagName==="SELECT"?"change":"click";q.addEventListener(H,function(B){var $=void 0;if(q.tagName==="SELECT"){if(q.selectedIndex<0)return;var V=q.options[q.selectedIndex];V.hasAttribute("selected")?$=!1:$=V.value||!1}else q.classList.contains("ql-active")?$=!1:$=q.value||!q.hasAttribute("value"),B.preventDefault();D.quill.focus();var j=D.quill.selection.getRange(),z=i(j,1),F=z[0];if(D.handlers[te]!=null)D.handlers[te].call(D,$);else if(h.default.query(te).prototype instanceof h.default.Embed){if($=prompt("Enter "+te),!$)return;D.quill.updateContents(new u.default().retain(F.index).delete(F.length).insert(y({},te,$)),g.default.sources.USER)}else D.quill.format(te,$,g.default.sources.USER);D.update(F)}),this.controls.push([te,q])}}},{key:"update",value:function(q){var D=q==null?{}:this.quill.getFormat(q);this.controls.forEach(function(te){var H=i(te,2),B=H[0],$=H[1];if($.tagName==="SELECT"){var V=void 0;if(q==null)V=null;else if(D[B]==null)V=$.querySelector("option[selected]");else if(!Array.isArray(D[B])){var j=D[B];typeof j=="string"&&(j=j.replace(/\"/g,'\\"')),V=$.querySelector('option[value="'+j+'"]')}V==null?($.value="",$.selectedIndex=-1):V.selected=!0}else if(q==null)$.classList.remove("ql-active");else if($.hasAttribute("value")){var z=D[B]===$.getAttribute("value")||D[B]!=null&&D[B].toString()===$.getAttribute("value")||D[B]==null&&!$.getAttribute("value");$.classList.toggle("ql-active",z)}else $.classList.toggle("ql-active",D[B]!=null)})}}]),O}(w.default);k.DEFAULTS={};function L(A,O,M){var q=document.createElement("button");q.setAttribute("type","button"),q.classList.add("ql-"+O),M!=null&&(q.value=M),A.appendChild(q)}function I(A,O){Array.isArray(O[0])||(O=[O]),O.forEach(function(M){var q=document.createElement("span");q.classList.add("ql-formats"),M.forEach(function(D){if(typeof D=="string")L(q,D);else{var te=Object.keys(D)[0],H=D[te];Array.isArray(H)?R(q,te,H):L(q,te,H)}}),A.appendChild(q)})}function R(A,O,M){var q=document.createElement("select");q.classList.add("ql-"+O),M.forEach(function(D){var te=document.createElement("option");D!==!1?te.setAttribute("value",D):te.setAttribute("selected","selected"),q.appendChild(te)}),A.appendChild(q)}k.DEFAULTS={container:null,handlers:{clean:function(){var O=this,M=this.quill.getSelection();if(M!=null)if(M.length==0){var q=this.quill.getFormat();Object.keys(q).forEach(function(D){h.default.query(D,h.default.Scope.INLINE)!=null&&O.quill.format(D,!1)})}else this.quill.removeFormat(M,g.default.sources.USER)},direction:function(O){var M=this.quill.getFormat().align;O==="rtl"&&M==null?this.quill.format("align","right",g.default.sources.USER):!O&&M==="right"&&this.quill.format("align",!1,g.default.sources.USER),this.quill.format("direction",O,g.default.sources.USER)},indent:function(O){var M=this.quill.getSelection(),q=this.quill.getFormat(M),D=parseInt(q.indent||0);if(O==="+1"||O==="-1"){var te=O==="+1"?1:-1;q.direction==="rtl"&&(te*=-1),this.quill.format("indent",D+te,g.default.sources.USER)}},link:function(O){O===!0&&(O=prompt("Enter link URL:")),this.quill.format("link",O,g.default.sources.USER)},list:function(O){var M=this.quill.getSelection(),q=this.quill.getFormat(M);O==="check"?q.list==="checked"||q.list==="unchecked"?this.quill.format("list",!1,g.default.sources.USER):this.quill.format("list","unchecked",g.default.sources.USER):this.quill.format("list",O,g.default.sources.USER)}}},n.default=k,n.addControls=I},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function E(S,w){for(var _=0;_<w.length;_++){var y=w[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}return function(S,w,_){return w&&E(S.prototype,w),_&&E(S,_),S}}(),o=function E(S,w,_){S===null&&(S=Function.prototype);var y=Object.getOwnPropertyDescriptor(S,w);if(y===void 0){var p=Object.getPrototypeOf(S);return p===null?void 0:E(p,w,_)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(_)}},s=a(28),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(w,_){h(this,S);var y=v(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,w));return y.label.innerHTML=_,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(p){p.classList.add("ql-primary")}),y}return i(S,[{key:"buildItem",value:function(_){var y=o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"buildItem",this).call(this,_);return y.style.backgroundColor=_.getAttribute("value")||"",y}},{key:"selectItem",value:function(_,y){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"selectItem",this).call(this,_,y);var p=this.label.querySelector(".ql-color-label"),m=_&&_.getAttribute("data-value")||"";p&&(p.tagName==="line"?p.style.stroke=m:p.style.fill=m)}}]),S}(u.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function E(S,w){for(var _=0;_<w.length;_++){var y=w[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}return function(S,w,_){return w&&E(S.prototype,w),_&&E(S,_),S}}(),o=function E(S,w,_){S===null&&(S=Function.prototype);var y=Object.getOwnPropertyDescriptor(S,w);if(y===void 0){var p=Object.getPrototypeOf(S);return p===null?void 0:E(p,w,_)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(_)}},s=a(28),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(w,_){h(this,S);var y=v(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,w));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(p){p.innerHTML=_[p.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return i(S,[{key:"selectItem",value:function(_,y){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"selectItem",this).call(this,_,y),_=_||this.defaultItem,this.label.innerHTML=_.innerHTML}}]),S}(u.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function u(c,h){for(var v=0;v<h.length;v++){var g=h[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,h,v){return h&&u(c.prototype,h),v&&u(c,v),c}}();function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(c,h){var v=this;o(this,u),this.quill=c,this.boundsContainer=h||document.body,this.root=c.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 i(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var v=h.left+h.width/2-this.root.offsetWidth/2,g=h.bottom+this.quill.root.scrollTop;this.root.style.left=v+"px",this.root.style.top=g+"px",this.root.classList.remove("ql-flip");var f=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),S=0;if(E.right>f.right&&(S=f.right-E.right,this.root.style.left=v+S+"px"),E.left<f.left&&(S=f.left-E.left,this.root.style.left=v+S+"px"),E.bottom>f.bottom){var w=E.bottom-E.top,_=h.bottom-h.top+w;this.root.style.top=g-_+"px",this.root.classList.add("ql-flip")}return S}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function R(A,O){var M=[],q=!0,D=!1,te=void 0;try{for(var H=A[Symbol.iterator](),B;!(q=(B=H.next()).done)&&(M.push(B.value),!(O&&M.length===O));q=!0);}catch($){D=!0,te=$}finally{try{!q&&H.return&&H.return()}finally{if(D)throw te}}return M}return function(A,O){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return R(A,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function R(A,O,M){A===null&&(A=Function.prototype);var q=Object.getOwnPropertyDescriptor(A,O);if(q===void 0){var D=Object.getPrototypeOf(A);return D===null?void 0:R(D,O,M)}else{if("value"in q)return q.value;var te=q.get;return te===void 0?void 0:te.call(M)}},s=function(){function R(A,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(A,q.key,q)}}return function(A,O,M){return O&&R(A.prototype,O),M&&R(A,M),A}}(),u=a(3),c=p(u),h=a(8),v=p(h),g=a(43),f=p(g),E=a(27),S=p(E),w=a(15),_=a(41),y=p(_);function p(R){return R&&R.__esModule?R:{default:R}}function m(R,A){if(!(R instanceof A))throw new TypeError("Cannot call a class as a function")}function P(R,A){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:R}function T(R,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);R.prototype=Object.create(A&&A.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(R,A):R.__proto__=A)}var k=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],L=function(R){T(A,R);function A(O,M){m(this,A),M.modules.toolbar!=null&&M.modules.toolbar.container==null&&(M.modules.toolbar.container=k);var q=P(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,O,M));return q.quill.container.classList.add("ql-snow"),q}return s(A,[{key:"extendToolbar",value:function(M){M.container.classList.add("ql-snow"),this.buildButtons([].slice.call(M.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(M.container.querySelectorAll("select")),y.default),this.tooltip=new I(this.quill,this.options.bounds),M.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(q,D){M.handlers.link.call(M,!D.format.link)})}}]),A}(f.default);L.DEFAULTS=(0,c.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var O=this.quill.getSelection();if(O==null||O.length==0)return;var M=this.quill.getText(O);/^\S+@\S+\.\S+$/.test(M)&&M.indexOf("mailto:")!==0&&(M="mailto:"+M);var q=this.quill.theme.tooltip;q.edit("link",M)}else this.quill.format("link",!1)}}}}});var I=function(R){T(A,R);function A(O,M){m(this,A);var q=P(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,O,M));return q.preview=q.root.querySelector("a.ql-preview"),q}return s(A,[{key:"listen",value:function(){var M=this;o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(q){M.root.classList.contains("ql-editing")?M.save():M.edit("link",M.preview.textContent),q.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(q){if(M.linkRange!=null){var D=M.linkRange;M.restoreFocus(),M.quill.formatText(D,"link",!1,v.default.sources.USER),delete M.linkRange}q.preventDefault(),M.hide()}),this.quill.on(v.default.events.SELECTION_CHANGE,function(q,D,te){if(q!=null){if(q.length===0&&te===v.default.sources.USER){var H=M.quill.scroll.descendant(S.default,q.index),B=i(H,2),$=B[0],V=B[1];if($!=null){M.linkRange=new w.Range(q.index-V,$.length());var j=S.default.formats($.domNode);M.preview.textContent=j,M.preview.setAttribute("href",j),M.show(),M.position(M.quill.getBounds(M.linkRange));return}}else delete M.linkRange;M.hide()}})}},{key:"show",value:function(){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(g.BaseTooltip);I.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(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(29),o=ve(i),s=a(36),u=a(38),c=a(64),h=a(65),v=ve(h),g=a(66),f=ve(g),E=a(67),S=ve(E),w=a(37),_=a(26),y=a(39),p=a(40),m=a(56),P=ve(m),T=a(68),k=ve(T),L=a(27),I=ve(L),R=a(69),A=ve(R),O=a(70),M=ve(O),q=a(71),D=ve(q),te=a(72),H=ve(te),B=a(73),$=ve(B),V=a(13),j=ve(V),z=a(74),F=ve(z),Y=a(75),J=ve(Y),X=a(57),Q=ve(X),ae=a(41),se=ve(ae),fe=a(28),be=ve(fe),_e=a(59),Ae=ve(_e),Re=a(60),Pe=ve(Re),ye=a(61),nt=ve(ye),Ce=a(108),he=ve(Ce),ke=a(62),Te=ve(ke);function ve(Se){return Se&&Se.__esModule?Se:{default:Se}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":w.BackgroundClass,"attributors/class/color":_.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":w.BackgroundStyle,"attributors/style/color":_.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":p.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":c.IndentClass,"formats/background":w.BackgroundStyle,"formats/color":_.ColorStyle,"formats/font":y.FontClass,"formats/size":p.SizeClass,"formats/blockquote":v.default,"formats/code-block":j.default,"formats/header":f.default,"formats/list":S.default,"formats/bold":P.default,"formats/code":V.Code,"formats/italic":k.default,"formats/link":I.default,"formats/script":A.default,"formats/strike":M.default,"formats/underline":D.default,"formats/image":H.default,"formats/video":$.default,"formats/list/item":E.ListItem,"modules/formula":F.default,"modules/syntax":J.default,"modules/toolbar":Q.default,"themes/bubble":he.default,"themes/snow":Te.default,"ui/icons":se.default,"ui/picker":be.default,"ui/icon-picker":Pe.default,"ui/color-picker":Ae.default,"ui/tooltip":nt.default},!0),n.default=o.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var i=function(){function S(w,_){for(var y=0;y<_.length;y++){var p=_[y];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}return function(w,_,y){return _&&S(w.prototype,_),y&&S(w,y),w}}(),o=function S(w,_,y){w===null&&(w=Function.prototype);var p=Object.getOwnPropertyDescriptor(w,_);if(p===void 0){var m=Object.getPrototypeOf(w);return m===null?void 0:S(m,_,y)}else{if("value"in p)return p.value;var P=p.get;return P===void 0?void 0:P.call(y)}},s=a(0),u=c(s);function c(S){return S&&S.__esModule?S:{default:S}}function h(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function v(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function g(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var f=function(S){g(w,S);function w(){return h(this,w),v(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"add",value:function(y,p){if(p==="+1"||p==="-1"){var m=this.value(y)||0;p=p==="+1"?m+1:m-1}return p===0?(this.remove(y),!0):o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"add",this).call(this,y,p)}},{key:"canAdd",value:function(y,p){return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,y,p)||o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,y,parseInt(p))}},{key:"value",value:function(y){return parseInt(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,y))||void 0}}]),w}(u.default.Attributor.Class),E=new f("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(4),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function h(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var v=function(g){h(f,g);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);v.blotName="blockquote",v.tagName="blockquote",n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function f(E,S){for(var w=0;w<S.length;w++){var _=S[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(E,_.key,_)}}return function(E,S,w){return S&&f(E.prototype,S),w&&f(E,w),E}}(),o=a(4),s=u(o);function u(f){return f&&f.__esModule?f:{default:f}}function c(f,E){if(!(f instanceof E))throw new TypeError("Cannot call a class as a function")}function h(f,E){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:f}function v(f,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);f.prototype=Object.create(E&&E.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(f,E):f.__proto__=E)}var g=function(f){v(E,f);function E(){return c(this,E),h(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,null,[{key:"formats",value:function(w){return this.tagName.indexOf(w.tagName)+1}}]),E}(s.default);g.blotName="header",g.tagName=["H1","H2","H3","H4","H5","H6"],n.default=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var i=function(){function m(P,T){for(var k=0;k<T.length;k++){var L=T[k];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,L.key,L)}}return function(P,T,k){return T&&m(P.prototype,T),k&&m(P,k),P}}(),o=function m(P,T,k){P===null&&(P=Function.prototype);var L=Object.getOwnPropertyDescriptor(P,T);if(L===void 0){var I=Object.getPrototypeOf(P);return I===null?void 0:m(I,T,k)}else{if("value"in L)return L.value;var R=L.get;return R===void 0?void 0:R.call(k)}},s=a(0),u=f(s),c=a(4),h=f(c),v=a(25),g=f(v);function f(m){return m&&m.__esModule?m:{default:m}}function E(m,P,T){return P in m?Object.defineProperty(m,P,{value:T,enumerable:!0,configurable:!0,writable:!0}):m[P]=T,m}function S(m,P){if(!(m instanceof P))throw new TypeError("Cannot call a class as a function")}function w(m,P){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:m}function _(m,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);m.prototype=Object.create(P&&P.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(m,P):m.__proto__=P)}var y=function(m){_(P,m);function P(){return S(this,P),w(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return i(P,[{key:"format",value:function(k,L){k===p.blotName&&!L?this.replaceWith(u.default.create(this.statics.scope)):o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,k,L)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(k,L){return this.parent.isolate(this.offset(this.parent),this.length()),k===this.parent.statics.blotName?(this.parent.replaceWith(k,L),this):(this.parent.unwrap(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,k,L))}}],[{key:"formats",value:function(k){return k.tagName===this.tagName?void 0:o(P.__proto__||Object.getPrototypeOf(P),"formats",this).call(this,k)}}]),P}(h.default);y.blotName="list-item",y.tagName="LI";var p=function(m){_(P,m),i(P,null,[{key:"create",value:function(k){var L=k==="ordered"?"OL":"UL",I=o(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,L);return(k==="checked"||k==="unchecked")&&I.setAttribute("data-checked",k==="checked"),I}},{key:"formats",value:function(k){if(k.tagName==="OL")return"ordered";if(k.tagName==="UL")return k.hasAttribute("data-checked")?k.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function P(T){S(this,P);var k=w(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T)),L=function(R){if(R.target.parentNode===T){var A=k.statics.formats(T),O=u.default.find(R.target);A==="checked"?O.format("list","unchecked"):A==="unchecked"&&O.format("list","checked")}};return T.addEventListener("touchstart",L),T.addEventListener("mousedown",L),k}return i(P,[{key:"format",value:function(k,L){this.children.length>0&&this.children.tail.format(k,L)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(k,L){if(k instanceof y)o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,k,L);else{var I=L==null?this.length():L.offset(this),R=this.split(I);R.parent.insertBefore(k,R)}}},{key:"optimize",value:function(k){o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,k);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(k){if(k.statics.blotName!==this.statics.blotName){var L=u.default.create(this.statics.defaultChild);k.moveChildren(L),this.appendChild(L)}o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,k)}}]),P}(g.default);p.blotName="list",p.scope=u.default.Scope.BLOCK_BLOT,p.tagName=["OL","UL"],p.defaultChild="list-item",p.allowedChildren=[y],n.ListItem=y,n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(56),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function h(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var v=function(g){h(f,g);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);v.blotName="italic",v.tagName=["EM","I"],n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function E(S,w){for(var _=0;_<w.length;_++){var y=w[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}return function(S,w,_){return w&&E(S.prototype,w),_&&E(S,_),S}}(),o=function E(S,w,_){S===null&&(S=Function.prototype);var y=Object.getOwnPropertyDescriptor(S,w);if(y===void 0){var p=Object.getPrototypeOf(S);return p===null?void 0:E(p,w,_)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(_)}},s=a(6),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(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 f=function(E){g(S,E);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,null,[{key:"create",value:function(_){return _==="super"?document.createElement("sup"):_==="sub"?document.createElement("sub"):o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,_)}},{key:"formats",value:function(_){if(_.tagName==="SUB")return"sub";if(_.tagName==="SUP")return"super"}}]),S}(u.default);f.blotName="script",f.tagName=["SUB","SUP"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function h(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var v=function(g){h(f,g);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);v.blotName="strike",v.tagName="S",n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function h(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var v=function(g){h(f,g);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);v.blotName="underline",v.tagName="U",n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(_,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,y,p){return y&&w(_.prototype,y),p&&w(_,p),_}}(),o=function w(_,y,p){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,y);if(m===void 0){var P=Object.getPrototypeOf(_);return P===null?void 0:w(P,y,p)}else{if("value"in m)return m.value;var T=m.get;return T===void 0?void 0:T.call(p)}},s=a(0),u=h(s),c=a(27);function h(w){return w&&w.__esModule?w:{default:w}}function v(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function g(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function f(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=["alt","height","width"],S=function(w){f(_,w);function _(){return v(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,[{key:"format",value:function(p,m){E.indexOf(p)>-1?m?this.domNode.setAttribute(p,m):this.domNode.removeAttribute(p):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,p,m)}}],[{key:"create",value:function(p){var m=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,p);return typeof p=="string"&&m.setAttribute("src",this.sanitize(p)),m}},{key:"formats",value:function(p){return E.reduce(function(m,P){return p.hasAttribute(P)&&(m[P]=p.getAttribute(P)),m},{})}},{key:"match",value:function(p){return/\.(jpe?g|gif|png)$/.test(p)||/^data:image\/.+;base64/.test(p)}},{key:"sanitize",value:function(p){return(0,c.sanitize)(p,["http","https","data"])?p:"//:0"}},{key:"value",value:function(p){return p.getAttribute("src")}}]),_}(u.default.Embed);S.blotName="image",S.tagName="IMG",n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(_,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,y,p){return y&&w(_.prototype,y),p&&w(_,p),_}}(),o=function w(_,y,p){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,y);if(m===void 0){var P=Object.getPrototypeOf(_);return P===null?void 0:w(P,y,p)}else{if("value"in m)return m.value;var T=m.get;return T===void 0?void 0:T.call(p)}},s=a(4),u=a(27),c=h(u);function h(w){return w&&w.__esModule?w:{default:w}}function v(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function g(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function f(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=["height","width"],S=function(w){f(_,w);function _(){return v(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,[{key:"format",value:function(p,m){E.indexOf(p)>-1?m?this.domNode.setAttribute(p,m):this.domNode.removeAttribute(p):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,p,m)}}],[{key:"create",value:function(p){var m=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,p);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(p)),m}},{key:"formats",value:function(p){return E.reduce(function(m,P){return p.hasAttribute(P)&&(m[P]=p.getAttribute(P)),m},{})}},{key:"sanitize",value:function(p){return c.default.sanitize(p)}},{key:"value",value:function(p){return p.getAttribute("src")}}]),_}(s.BlockEmbed);S.blotName="video",S.className="ql-video",S.tagName="IFRAME",n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var i=function(){function p(m,P){for(var T=0;T<P.length;T++){var k=P[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(m,k.key,k)}}return function(m,P,T){return P&&p(m.prototype,P),T&&p(m,T),m}}(),o=function p(m,P,T){m===null&&(m=Function.prototype);var k=Object.getOwnPropertyDescriptor(m,P);if(k===void 0){var L=Object.getPrototypeOf(m);return L===null?void 0:p(L,P,T)}else{if("value"in k)return k.value;var I=k.get;return I===void 0?void 0:I.call(T)}},s=a(35),u=f(s),c=a(5),h=f(c),v=a(9),g=f(v);function f(p){return p&&p.__esModule?p:{default:p}}function E(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function S(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function w(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var _=function(p){w(m,p);function m(){return E(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return i(m,null,[{key:"create",value:function(T){var k=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,T);return typeof T=="string"&&(window.katex.render(T,k,{throwOnError:!1,errorColor:"#f00"}),k.setAttribute("data-value",T)),k}},{key:"value",value:function(T){return T.getAttribute("data-value")}}]),m}(u.default);_.blotName="formula",_.className="ql-formula",_.tagName="SPAN";var y=function(p){w(m,p),i(m,null,[{key:"register",value:function(){h.default.register(_,!0)}}]);function m(){E(this,m);var P=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return P}return m}(g.default);n.FormulaBlot=_,n.default=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var i=function(){function T(k,L){for(var I=0;I<L.length;I++){var R=L[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(k,R.key,R)}}return function(k,L,I){return L&&T(k.prototype,L),I&&T(k,I),k}}(),o=function T(k,L,I){k===null&&(k=Function.prototype);var R=Object.getOwnPropertyDescriptor(k,L);if(R===void 0){var A=Object.getPrototypeOf(k);return A===null?void 0:T(A,L,I)}else{if("value"in R)return R.value;var O=R.get;return O===void 0?void 0:O.call(I)}},s=a(0),u=S(s),c=a(5),h=S(c),v=a(9),g=S(v),f=a(13),E=S(f);function S(T){return T&&T.__esModule?T:{default:T}}function w(T,k){if(!(T instanceof k))throw new TypeError("Cannot call a class as a function")}function _(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 y(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 p=function(T){y(k,T);function k(){return w(this,k),_(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}return i(k,[{key:"replaceWith",value:function(I){this.domNode.textContent=this.domNode.textContent,this.attach(),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replaceWith",this).call(this,I)}},{key:"highlight",value:function(I){var R=this.domNode.textContent;this.cachedText!==R&&((R.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=I(R),this.domNode.normalize(),this.attach()),this.cachedText=R)}}]),k}(E.default);p.className="ql-syntax";var m=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),P=function(T){y(k,T),i(k,null,[{key:"register",value:function(){h.default.register(m,!0),h.default.register(p,!0)}}]);function k(L,I){w(this,k);var R=_(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,L,I));if(typeof R.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return R.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){R.highlight(),A=null},R.options.interval)}),R.highlight(),R}return i(k,[{key:"highlight",value:function(){var I=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var R=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(A){A.highlight(I.options.highlight)}),this.quill.update(h.default.sources.SILENT),R!=null&&this.quill.setSelection(R,h.default.sources.SILENT)}}}]),k}(g.default);P.DEFAULTS={highlight:function(){return window.hljs==null?null:function(T){var k=window.hljs.highlightAuto(T);return k.value}}(),interval:1e3},n.CodeBlock=p,n.CodeToken=m,n.default=P},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(t,n){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(t,n){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(t,n){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(t,n){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var i=function k(L,I,R){L===null&&(L=Function.prototype);var A=Object.getOwnPropertyDescriptor(L,I);if(A===void 0){var O=Object.getPrototypeOf(L);return O===null?void 0:k(O,I,R)}else{if("value"in A)return A.value;var M=A.get;return M===void 0?void 0:M.call(R)}},o=function(){function k(L,I){for(var R=0;R<I.length;R++){var A=I[R];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(L,A.key,A)}}return function(L,I,R){return I&&k(L.prototype,I),R&&k(L,R),L}}(),s=a(3),u=w(s),c=a(8),h=w(c),v=a(43),g=w(v),f=a(15),E=a(41),S=w(E);function w(k){return k&&k.__esModule?k:{default:k}}function _(k,L){if(!(k instanceof L))throw new TypeError("Cannot call a class as a function")}function y(k,L){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:k}function p(k,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);k.prototype=Object.create(L&&L.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(k,L):k.__proto__=L)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],P=function(k){p(L,k);function L(I,R){_(this,L),R.modules.toolbar!=null&&R.modules.toolbar.container==null&&(R.modules.toolbar.container=m);var A=y(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,I,R));return A.quill.container.classList.add("ql-bubble"),A}return o(L,[{key:"extendToolbar",value:function(R){this.tooltip=new T(this.quill,this.options.bounds),this.tooltip.root.appendChild(R.container),this.buildButtons([].slice.call(R.container.querySelectorAll("button")),S.default),this.buildPickers([].slice.call(R.container.querySelectorAll("select")),S.default)}}]),L}(g.default);P.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 T=function(k){p(L,k);function L(I,R){_(this,L);var A=y(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,I,R));return A.quill.on(h.default.events.EDITOR_CHANGE,function(O,M,q,D){if(O===h.default.events.SELECTION_CHANGE)if(M!=null&&M.length>0&&D===h.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var te=A.quill.getLines(M.index,M.length);if(te.length===1)A.position(A.quill.getBounds(M));else{var H=te[te.length-1],B=A.quill.getIndex(H),$=Math.min(H.length()-1,M.index+M.length-B),V=A.quill.getBounds(new f.Range(B,$));A.position(V)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return o(L,[{key:"listen",value:function(){var R=this;i(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){R.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!R.root.classList.contains("ql-hidden")){var A=R.quill.getSelection();A!=null&&R.position(R.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(R){var A=i(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"position",this).call(this,R),O=this.root.querySelector(".ql-tooltip-arrow");if(O.style.marginLeft="",A===0)return A;O.style.marginLeft=-1*A-O.offsetWidth/2+"px"}}]),L}(v.BaseTooltip);T.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=T,n.default=P},function(t,n,a){t.exports=a(63)}]).default})}(y1)),y1.exports}var ic={},b1={exports:{}},wf={},ip={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var zA=ip.exports,Ub;function UA(){return Ub||(Ub=1,function(e,r){(function(t){var n=r&&!r.nodeType&&r,a=e&&!e.nodeType&&e,i=typeof bh=="object"&&bh;(i.global===i||i.window===i||i.self===i)&&(t=i);var o,s=2147483647,u=36,c=1,h=26,v=38,g=700,f=72,E=128,S="-",w=/^xn--/,_=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=u-c,P=Math.floor,T=String.fromCharCode,k;function L(V){throw new RangeError(p[V])}function I(V,j){for(var z=V.length,F=[];z--;)F[z]=j(V[z]);return F}function R(V,j){var z=V.split("@"),F="";z.length>1&&(F=z[0]+"@",V=z[1]),V=V.replace(y,".");var Y=V.split("."),J=I(Y,j).join(".");return F+J}function A(V){for(var j=[],z=0,F=V.length,Y,J;z<F;)Y=V.charCodeAt(z++),Y>=55296&&Y<=56319&&z<F?(J=V.charCodeAt(z++),(J&64512)==56320?j.push(((Y&1023)<<10)+(J&1023)+65536):(j.push(Y),z--)):j.push(Y);return j}function O(V){return I(V,function(j){var z="";return j>65535&&(j-=65536,z+=T(j>>>10&1023|55296),j=56320|j&1023),z+=T(j),z}).join("")}function M(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function q(V,j){return V+22+75*(V<26)-((j!=0)<<5)}function D(V,j,z){var F=0;for(V=z?P(V/g):V>>1,V+=P(V/j);V>m*h>>1;F+=u)V=P(V/m);return P(F+(m+1)*V/(V+v))}function te(V){var j=[],z=V.length,F,Y=0,J=E,X=f,Q,ae,se,fe,be,_e,Ae,Re,Pe;for(Q=V.lastIndexOf(S),Q<0&&(Q=0),ae=0;ae<Q;++ae)V.charCodeAt(ae)>=128&&L("not-basic"),j.push(V.charCodeAt(ae));for(se=Q>0?Q+1:0;se<z;){for(fe=Y,be=1,_e=u;se>=z&&L("invalid-input"),Ae=M(V.charCodeAt(se++)),(Ae>=u||Ae>P((s-Y)/be))&&L("overflow"),Y+=Ae*be,Re=_e<=X?c:_e>=X+h?h:_e-X,!(Ae<Re);_e+=u)Pe=u-Re,be>P(s/Pe)&&L("overflow"),be*=Pe;F=j.length+1,X=D(Y-fe,F,fe==0),P(Y/F)>s-J&&L("overflow"),J+=P(Y/F),Y%=F,j.splice(Y++,0,J)}return O(j)}function H(V){var j,z,F,Y,J,X,Q,ae,se,fe,be,_e=[],Ae,Re,Pe,ye;for(V=A(V),Ae=V.length,j=E,z=0,J=f,X=0;X<Ae;++X)be=V[X],be<128&&_e.push(T(be));for(F=Y=_e.length,Y&&_e.push(S);F<Ae;){for(Q=s,X=0;X<Ae;++X)be=V[X],be>=j&&be<Q&&(Q=be);for(Re=F+1,Q-j>P((s-z)/Re)&&L("overflow"),z+=(Q-j)*Re,j=Q,X=0;X<Ae;++X)if(be=V[X],be<j&&++z>s&&L("overflow"),be==j){for(ae=z,se=u;fe=se<=J?c:se>=J+h?h:se-J,!(ae<fe);se+=u)ye=ae-fe,Pe=u-fe,_e.push(T(q(fe+ye%Pe,0))),ae=P(ye/Pe);_e.push(T(q(ae,0))),J=D(z,Re,F==Y),z=0,++F}++z,++j}return _e.join("")}function B(V){return R(V,function(j){return w.test(j)?te(j.slice(4).toLowerCase()):j})}function $(V){return R(V,function(j){return _.test(j)?"xn--"+H(j):j})}if(o={version:"1.4.1",ucs2:{decode:A,encode:O},decode:te,encode:H,toASCII:$,toUnicode:B},n&&a)if(e.exports==n)a.exports=o;else for(k in o)o.hasOwnProperty(k)&&(n[k]=o[k]);else t.punycode=o})(zA)}(ip,ip.exports)),ip.exports}var Eg,Hb;function Fh(){return Hb||(Hb=1,Eg=TypeError),Eg}const HA={},VA=Object.freeze(Object.defineProperty({__proto__:null,default:HA},Symbol.toStringTag,{value:"Module"})),GA=Zc(VA);var Pg,Vb;function o0(){if(Vb)return Pg;Vb=1;var e=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&r&&typeof r.get=="function"?r.get:null,n=e&&Map.prototype.forEach,a=typeof Set=="function"&&Set.prototype,i=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=a&&i&&typeof i.get=="function"?i.get:null,s=a&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,v=h?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,f=g?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,S=Object.prototype.toString,w=Function.prototype.toString,_=String.prototype.match,y=String.prototype.slice,p=String.prototype.replace,m=String.prototype.toUpperCase,P=String.prototype.toLowerCase,T=RegExp.prototype.test,k=Array.prototype.concat,L=Array.prototype.join,I=Array.prototype.slice,R=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",D=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,te=Object.prototype.propertyIsEnumerable,H=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Me){return Me.__proto__}:null);function B(Me,Oe){if(Me===1/0||Me===-1/0||Me!==Me||Me&&Me>-1e3&&Me<1e3||T.call(/e/,Oe))return Oe;var it=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Me=="number"){var Lt=Me<0?-R(-Me):R(Me);if(Lt!==Me){var At=String(Lt),xt=y.call(Oe,At.length+1);return p.call(At,it,"$&_")+"."+p.call(p.call(xt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return p.call(Oe,it,"$&_")}var $=GA,V=$.custom,j=Re(V)?V:null,z={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function Me(Oe,it,Lt,At){var xt=it||{};if(nt(xt,"quoteStyle")&&!nt(z,xt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(nt(xt,"maxStringLength")&&(typeof xt.maxStringLength=="number"?xt.maxStringLength<0&&xt.maxStringLength!==1/0:xt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Jt=nt(xt,"customInspect")?xt.customInspect:!0;if(typeof Jt!="boolean"&&Jt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(nt(xt,"indent")&&xt.indent!==null&&xt.indent!==" "&&!(parseInt(xt.indent,10)===xt.indent&&xt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(nt(xt,"numericSeparator")&&typeof xt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var nr=xt.numericSeparator;if(typeof Oe>"u")return"undefined";if(Oe===null)return"null";if(typeof Oe=="boolean")return Oe?"true":"false";if(typeof Oe=="string")return mt(Oe,xt);if(typeof Oe=="number"){if(Oe===0)return 1/0/Oe>0?"0":"-0";var Rt=String(Oe);return nr?B(Oe,Rt):Rt}if(typeof Oe=="bigint"){var Xt=String(Oe)+"n";return nr?B(Oe,Xt):Xt}var Rr=typeof xt.depth>"u"?5:xt.depth;if(typeof Lt>"u"&&(Lt=0),Lt>=Rr&&Rr>0&&typeof Oe=="object")return Q(Oe)?"[Array]":"[Object]";var Ze=pt(xt,Lt);if(typeof At>"u")At=[];else if(ke(At,Oe)>=0)return"[Circular]";function bt(Si,fa,_s){if(fa&&(At=I.call(At),At.push(fa)),_s){var Go={depth:xt.depth};return nt(xt,"quoteStyle")&&(Go.quoteStyle=xt.quoteStyle),Me(Si,Go,Lt+1,At)}return Me(Si,xt,Lt+1,At)}if(typeof Oe=="function"&&!se(Oe)){var Vt=he(Oe),wt=Ht(Oe,bt);return"[Function"+(Vt?": "+Vt:" (anonymous)")+"]"+(wt.length>0?" { "+L.call(wt,", ")+" }":"")}if(Re(Oe)){var Kt=q?p.call(String(Oe),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(Oe);return typeof Oe=="object"&&!q?Je(Kt):Kt}if(ct(Oe)){for(var Yt="<"+P.call(String(Oe.nodeName)),ut=Oe.attributes||[],St=0;St<ut.length;St++)Yt+=" "+ut[St].name+"="+Y(J(ut[St].value),"double",xt);return Yt+=">",Oe.childNodes&&Oe.childNodes.length&&(Yt+="..."),Yt+="</"+P.call(String(Oe.nodeName))+">",Yt}if(Q(Oe)){if(Oe.length===0)return"[]";var Et=Ht(Oe,bt);return Ze&&!kt(Et)?"["+Ut(Et,Ze)+"]":"[ "+L.call(Et,", ")+" ]"}if(fe(Oe)){var et=Ht(Oe,bt);return!("cause"in Error.prototype)&&"cause"in Oe&&!te.call(Oe,"cause")?"{ ["+String(Oe)+"] "+L.call(k.call("[cause]: "+bt(Oe.cause),et),", ")+" }":et.length===0?"["+String(Oe)+"]":"{ ["+String(Oe)+"] "+L.call(et,", ")+" }"}if(typeof Oe=="object"&&Jt){if(j&&typeof Oe[j]=="function"&&$)return $(Oe,{depth:Rr-Lt});if(Jt!=="symbol"&&typeof Oe.inspect=="function")return Oe.inspect()}if(Te(Oe)){var qt=[];return n&&n.call(Oe,function(Si,fa){qt.push(bt(fa,Oe,!0)+" => "+bt(Si,Oe))}),ze("Map",t.call(Oe),qt,Ze)}if(je(Oe)){var gt=[];return s&&s.call(Oe,function(Si){gt.push(bt(Si,Oe))}),ze("Set",o.call(Oe),gt,Ze)}if(ve(Oe))return lt("WeakMap");if(Ue(Oe))return lt("WeakSet");if(Se(Oe))return lt("WeakRef");if(_e(Oe))return Je(bt(Number(Oe)));if(Pe(Oe))return Je(bt(A.call(Oe)));if(Ae(Oe))return Je(E.call(Oe));if(be(Oe))return Je(bt(String(Oe)));if(typeof window<"u"&&Oe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Oe===globalThis||typeof bh<"u"&&Oe===bh)return"{ [object globalThis] }";if(!ae(Oe)&&!se(Oe)){var Ft=Ht(Oe,bt),br=H?H(Oe)===Object.prototype:Oe instanceof Object||Oe.constructor===Object,hr=Oe instanceof Object?"":"null prototype",Qr=!br&&D&&Object(Oe)===Oe&&D in Oe?y.call(Ce(Oe),8,-1):hr?"Object":"",Sn=br||typeof Oe.constructor!="function"?"":Oe.constructor.name?Oe.constructor.name+" ":"",Ni=Sn+(Qr||hr?"["+L.call(k.call([],Qr||[],hr||[]),": ")+"] ":"");return Ft.length===0?Ni+"{}":Ze?Ni+"{"+Ut(Ft,Ze)+"}":Ni+"{ "+L.call(Ft,", ")+" }"}return String(Oe)};function Y(Me,Oe,it){var Lt=it.quoteStyle||Oe,At=z[Lt];return At+Me+At}function J(Me){return p.call(String(Me),/"/g,""")}function X(Me){return!D||!(typeof Me=="object"&&(D in Me||typeof Me[D]<"u"))}function Q(Me){return Ce(Me)==="[object Array]"&&X(Me)}function ae(Me){return Ce(Me)==="[object Date]"&&X(Me)}function se(Me){return Ce(Me)==="[object RegExp]"&&X(Me)}function fe(Me){return Ce(Me)==="[object Error]"&&X(Me)}function be(Me){return Ce(Me)==="[object String]"&&X(Me)}function _e(Me){return Ce(Me)==="[object Number]"&&X(Me)}function Ae(Me){return Ce(Me)==="[object Boolean]"&&X(Me)}function Re(Me){if(q)return Me&&typeof Me=="object"&&Me instanceof Symbol;if(typeof Me=="symbol")return!0;if(!Me||typeof Me!="object"||!M)return!1;try{return M.call(Me),!0}catch{}return!1}function Pe(Me){if(!Me||typeof Me!="object"||!A)return!1;try{return A.call(Me),!0}catch{}return!1}var ye=Object.prototype.hasOwnProperty||function(Me){return Me in this};function nt(Me,Oe){return ye.call(Me,Oe)}function Ce(Me){return S.call(Me)}function he(Me){if(Me.name)return Me.name;var Oe=_.call(w.call(Me),/^function\s*([\w$]+)/);return Oe?Oe[1]:null}function ke(Me,Oe){if(Me.indexOf)return Me.indexOf(Oe);for(var it=0,Lt=Me.length;it<Lt;it++)if(Me[it]===Oe)return it;return-1}function Te(Me){if(!t||!Me||typeof Me!="object")return!1;try{t.call(Me);try{o.call(Me)}catch{return!0}return Me instanceof Map}catch{}return!1}function ve(Me){if(!c||!Me||typeof Me!="object")return!1;try{c.call(Me,c);try{v.call(Me,v)}catch{return!0}return Me instanceof WeakMap}catch{}return!1}function Se(Me){if(!f||!Me||typeof Me!="object")return!1;try{return f.call(Me),!0}catch{}return!1}function je(Me){if(!o||!Me||typeof Me!="object")return!1;try{o.call(Me);try{t.call(Me)}catch{return!0}return Me instanceof Set}catch{}return!1}function Ue(Me){if(!v||!Me||typeof Me!="object")return!1;try{v.call(Me,v);try{c.call(Me,c)}catch{return!0}return Me instanceof WeakSet}catch{}return!1}function ct(Me){return!Me||typeof Me!="object"?!1:typeof HTMLElement<"u"&&Me instanceof HTMLElement?!0:typeof Me.nodeName=="string"&&typeof Me.getAttribute=="function"}function mt(Me,Oe){if(Me.length>Oe.maxStringLength){var it=Me.length-Oe.maxStringLength,Lt="... "+it+" more character"+(it>1?"s":"");return mt(y.call(Me,0,Oe.maxStringLength),Oe)+Lt}var At=F[Oe.quoteStyle||"single"];At.lastIndex=0;var xt=p.call(p.call(Me,At,"\\$1"),/[\x00-\x1f]/g,yt);return Y(xt,"single",Oe)}function yt(Me){var Oe=Me.charCodeAt(0),it={8:"b",9:"t",10:"n",12:"f",13:"r"}[Oe];return it?"\\"+it:"\\x"+(Oe<16?"0":"")+m.call(Oe.toString(16))}function Je(Me){return"Object("+Me+")"}function lt(Me){return Me+" { ? }"}function ze(Me,Oe,it,Lt){var At=Lt?Ut(it,Lt):L.call(it,", ");return Me+" ("+Oe+") {"+At+"}"}function kt(Me){for(var Oe=0;Oe<Me.length;Oe++)if(ke(Me[Oe],`
|
|
156
|
+
`)>=0)return!1;return!0}function pt(Me,Oe){var it;if(Me.indent===" ")it=" ";else if(typeof Me.indent=="number"&&Me.indent>0)it=L.call(Array(Me.indent+1)," ");else return null;return{base:it,prev:L.call(Array(Oe+1),it)}}function Ut(Me,Oe){if(Me.length===0)return"";var it=`
|
|
157
|
+
`+Oe.prev+Oe.base;return it+L.call(Me,","+it)+`
|
|
158
|
+
`+Oe.prev}function Ht(Me,Oe){var it=Q(Me),Lt=[];if(it){Lt.length=Me.length;for(var At=0;At<Me.length;At++)Lt[At]=nt(Me,At)?Oe(Me[At],Me):""}var xt=typeof O=="function"?O(Me):[],Jt;if(q){Jt={};for(var nr=0;nr<xt.length;nr++)Jt["$"+xt[nr]]=xt[nr]}for(var Rt in Me)nt(Me,Rt)&&(it&&String(Number(Rt))===Rt&&Rt<Me.length||q&&Jt["$"+Rt]instanceof Symbol||(T.call(/[^\w$]/,Rt)?Lt.push(Oe(Rt,Me)+": "+Oe(Me[Rt],Me)):Lt.push(Rt+": "+Oe(Me[Rt],Me))));if(typeof O=="function")for(var Xt=0;Xt<xt.length;Xt++)te.call(Me,xt[Xt])&&Lt.push("["+Oe(xt[Xt])+"]: "+Oe(Me[xt[Xt]],Me));return Lt}return Pg}var Og,Gb;function WA(){if(Gb)return Og;Gb=1;var e=o0(),r=Fh(),t=function(s,u,c){for(var h=s,v;(v=h.next)!=null;h=v)if(v.key===u)return h.next=v.next,c||(v.next=s.next,s.next=v),v},n=function(s,u){if(s){var c=t(s,u);return c&&c.value}},a=function(s,u,c){var h=t(s,u);h?h.value=c:s.next={key:u,next:s.next,value:c}},i=function(s,u){return s?!!t(s,u):!1},o=function(s,u){if(s)return t(s,u,!0)};return Og=function(){var u,c={assert:function(h){if(!c.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){var v=u&&u.next,g=o(u,h);return g&&v&&v===g&&(u=void 0),!!g},get:function(h){return n(u,h)},has:function(h){return i(u,h)},set:function(h,v){u||(u={next:void 0}),a(u,h,v)}};return c},Og}var Ag,Wb;function Y8(){return Wb||(Wb=1,Ag=Object),Ag}var Cg,$b;function $A(){return $b||($b=1,Cg=Error),Cg}var kg,Yb;function YA(){return Yb||(Yb=1,kg=EvalError),kg}var Lg,Xb;function XA(){return Xb||(Xb=1,Lg=RangeError),Lg}var Ng,Kb;function KA(){return Kb||(Kb=1,Ng=ReferenceError),Ng}var Tg,Zb;function ZA(){return Zb||(Zb=1,Tg=SyntaxError),Tg}var Rg,Qb;function QA(){return Qb||(Qb=1,Rg=URIError),Rg}var Mg,Jb;function JA(){return Jb||(Jb=1,Mg=Math.abs),Mg}var Ig,e3;function eC(){return e3||(e3=1,Ig=Math.floor),Ig}var jg,t3;function tC(){return t3||(t3=1,jg=Math.max),jg}var Fg,r3;function rC(){return r3||(r3=1,Fg=Math.min),Fg}var Dg,n3;function nC(){return n3||(n3=1,Dg=Math.pow),Dg}var Bg,i3;function iC(){return i3||(i3=1,Bg=Math.round),Bg}var qg,a3;function aC(){return a3||(a3=1,qg=Number.isNaN||function(r){return r!==r}),qg}var zg,o3;function oC(){if(o3)return zg;o3=1;var e=aC();return zg=function(t){return e(t)||t===0?t:t<0?-1:1},zg}var Ug,s3;function sC(){return s3||(s3=1,Ug=Object.getOwnPropertyDescriptor),Ug}var Hg,l3;function X8(){if(l3)return Hg;l3=1;var e=sC();if(e)try{e([],"length")}catch{e=null}return Hg=e,Hg}var Vg,u3;function lC(){if(u3)return Vg;u3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Vg=e,Vg}var Gg,c3;function uC(){return c3||(c3=1,Gg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var o=Object.getOwnPropertySymbols(r);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(r,t);if(s.value!==a||s.enumerable!==!0)return!1}return!0}),Gg}var Wg,f3;function cC(){if(f3)return Wg;f3=1;var e=typeof Symbol<"u"&&Symbol,r=uC();return Wg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},Wg}var $g,h3;function K8(){return h3||(h3=1,$g=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),$g}var Yg,d3;function Z8(){if(d3)return Yg;d3=1;var e=Y8();return Yg=e.getPrototypeOf||null,Yg}var Xg,p3;function fC(){if(p3)return Xg;p3=1;var e="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,t=Math.max,n="[object Function]",a=function(u,c){for(var h=[],v=0;v<u.length;v+=1)h[v]=u[v];for(var g=0;g<c.length;g+=1)h[g+u.length]=c[g];return h},i=function(u,c){for(var h=[],v=c,g=0;v<u.length;v+=1,g+=1)h[g]=u[v];return h},o=function(s,u){for(var c="",h=0;h<s.length;h+=1)c+=s[h],h+1<s.length&&(c+=u);return c};return Xg=function(u){var c=this;if(typeof c!="function"||r.apply(c)!==n)throw new TypeError(e+c);for(var h=i(arguments,1),v,g=function(){if(this instanceof v){var _=c.apply(this,a(h,arguments));return Object(_)===_?_:this}return c.apply(u,a(h,arguments))},f=t(0,c.length-h.length),E=[],S=0;S<f;S++)E[S]="$"+S;if(v=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(g),c.prototype){var w=function(){};w.prototype=c.prototype,v.prototype=new w,w.prototype=null}return v},Xg}var Kg,g3;function s0(){if(g3)return Kg;g3=1;var e=fC();return Kg=Function.prototype.bind||e,Kg}var Zg,v3;function Am(){return v3||(v3=1,Zg=Function.prototype.call),Zg}var Qg,m3;function Q8(){return m3||(m3=1,Qg=Function.prototype.apply),Qg}var Jg,y3;function hC(){return y3||(y3=1,Jg=typeof Reflect<"u"&&Reflect&&Reflect.apply),Jg}var ev,b3;function dC(){if(b3)return ev;b3=1;var e=s0(),r=Q8(),t=Am(),n=hC();return ev=n||e.call(t,r),ev}var tv,w3;function J8(){if(w3)return tv;w3=1;var e=s0(),r=Fh(),t=Am(),n=dC();return tv=function(i){if(i.length<1||typeof i[0]!="function")throw new r("a function is required");return n(e,t,i)},tv}var rv,_3;function pC(){if(_3)return rv;_3=1;var e=J8(),r=X8(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&r&&r(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return rv=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(s){return i(s==null?s:a(s))}:!1,rv}var nv,S3;function gC(){if(S3)return nv;S3=1;var e=K8(),r=Z8(),t=pC();return nv=e?function(a){return e(a)}:r?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return r(a)}:t?function(a){return t(a)}:null,nv}var iv,x3;function vC(){if(x3)return iv;x3=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=s0();return iv=t.call(e,r),iv}var av,E3;function Cm(){if(E3)return av;E3=1;var e,r=Y8(),t=$A(),n=YA(),a=XA(),i=KA(),o=ZA(),s=Fh(),u=QA(),c=JA(),h=eC(),v=tC(),g=rC(),f=nC(),E=iC(),S=oC(),w=Function,_=function(se){try{return w('"use strict"; return ('+se+").constructor;")()}catch{}},y=X8(),p=lC(),m=function(){throw new s},P=y?function(){try{return arguments.callee,m}catch{try{return y(arguments,"callee").get}catch{return m}}}():m,T=cC()(),k=gC(),L=Z8(),I=K8(),R=Q8(),A=Am(),O={},M=typeof Uint8Array>"u"||!k?e:k(Uint8Array),q={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":T&&k?k([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&k?k(k([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!k?e:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!k?e:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&k?k(""[Symbol.iterator]()):e,"%Symbol%":T?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":P,"%TypedArray%":M,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":R,"%Object.defineProperty%":p,"%Object.getPrototypeOf%":L,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":v,"%Math.min%":g,"%Math.pow%":f,"%Math.round%":E,"%Math.sign%":S,"%Reflect.getPrototypeOf%":I};if(k)try{null.error}catch(se){var D=k(k(se));q["%Error.prototype%"]=D}var te=function se(fe){var be;if(fe==="%AsyncFunction%")be=_("async function () {}");else if(fe==="%GeneratorFunction%")be=_("function* () {}");else if(fe==="%AsyncGeneratorFunction%")be=_("async function* () {}");else if(fe==="%AsyncGenerator%"){var _e=se("%AsyncGeneratorFunction%");_e&&(be=_e.prototype)}else if(fe==="%AsyncIteratorPrototype%"){var Ae=se("%AsyncGenerator%");Ae&&k&&(be=k(Ae.prototype))}return q[fe]=be,be},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"]},B=s0(),$=vC(),V=B.call(A,Array.prototype.concat),j=B.call(R,Array.prototype.splice),z=B.call(A,String.prototype.replace),F=B.call(A,String.prototype.slice),Y=B.call(A,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,Q=function(fe){var be=F(fe,0,1),_e=F(fe,-1);if(be==="%"&&_e!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(_e==="%"&&be!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Ae=[];return z(fe,J,function(Re,Pe,ye,nt){Ae[Ae.length]=ye?z(nt,X,"$1"):Pe||Re}),Ae},ae=function(fe,be){var _e=fe,Ae;if($(H,_e)&&(Ae=H[_e],_e="%"+Ae[0]+"%"),$(q,_e)){var Re=q[_e];if(Re===O&&(Re=te(_e)),typeof Re>"u"&&!be)throw new s("intrinsic "+fe+" exists, but is not available. Please file an issue!");return{alias:Ae,name:_e,value:Re}}throw new o("intrinsic "+fe+" does not exist!")};return av=function(fe,be){if(typeof fe!="string"||fe.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof be!="boolean")throw new s('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/,fe)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var _e=Q(fe),Ae=_e.length>0?_e[0]:"",Re=ae("%"+Ae+"%",be),Pe=Re.name,ye=Re.value,nt=!1,Ce=Re.alias;Ce&&(Ae=Ce[0],j(_e,V([0,1],Ce)));for(var he=1,ke=!0;he<_e.length;he+=1){var Te=_e[he],ve=F(Te,0,1),Se=F(Te,-1);if((ve==='"'||ve==="'"||ve==="`"||Se==='"'||Se==="'"||Se==="`")&&ve!==Se)throw new o("property names with quotes must have matching quotes");if((Te==="constructor"||!ke)&&(nt=!0),Ae+="."+Te,Pe="%"+Ae+"%",$(q,Pe))ye=q[Pe];else if(ye!=null){if(!(Te in ye)){if(!be)throw new s("base intrinsic for "+fe+" exists, but the property is not available.");return}if(y&&he+1>=_e.length){var je=y(ye,Te);ke=!!je,ke&&"get"in je&&!("originalValue"in je.get)?ye=je.get:ye=ye[Te]}else ke=$(ye,Te),ye=ye[Te];ke&&!nt&&(q[Pe]=ye)}}return ye},av}var ov,P3;function e_(){if(P3)return ov;P3=1;var e=Cm(),r=J8(),t=r([e("%String.prototype.indexOf%")]);return ov=function(a,i){var o=e(a,!!i);return typeof o=="function"&&t(a,".prototype.")>-1?r([o]):o},ov}var sv,O3;function t_(){if(O3)return sv;O3=1;var e=Cm(),r=e_(),t=o0(),n=Fh(),a=e("%Map%",!0),i=r("Map.prototype.get",!0),o=r("Map.prototype.set",!0),s=r("Map.prototype.has",!0),u=r("Map.prototype.delete",!0),c=r("Map.prototype.size",!0);return sv=!!a&&function(){var v,g={assert:function(f){if(!g.has(f))throw new n("Side channel does not contain "+t(f))},delete:function(f){if(v){var E=u(v,f);return c(v)===0&&(v=void 0),E}return!1},get:function(f){if(v)return i(v,f)},has:function(f){return v?s(v,f):!1},set:function(f,E){v||(v=new a),o(v,f,E)}};return g},sv}var lv,A3;function mC(){if(A3)return lv;A3=1;var e=Cm(),r=e_(),t=o0(),n=t_(),a=Fh(),i=e("%WeakMap%",!0),o=r("WeakMap.prototype.get",!0),s=r("WeakMap.prototype.set",!0),u=r("WeakMap.prototype.has",!0),c=r("WeakMap.prototype.delete",!0);return lv=i?function(){var v,g,f={assert:function(E){if(!f.has(E))throw new a("Side channel does not contain "+t(E))},delete:function(E){if(i&&E&&(typeof E=="object"||typeof E=="function")){if(v)return c(v,E)}else if(n&&g)return g.delete(E);return!1},get:function(E){return i&&E&&(typeof E=="object"||typeof E=="function")&&v?o(v,E):g&&g.get(E)},has:function(E){return i&&E&&(typeof E=="object"||typeof E=="function")&&v?u(v,E):!!g&&g.has(E)},set:function(E,S){i&&E&&(typeof E=="object"||typeof E=="function")?(v||(v=new i),s(v,E,S)):n&&(g||(g=n()),g.set(E,S))}};return f}:n,lv}var uv,C3;function yC(){if(C3)return uv;C3=1;var e=Fh(),r=o0(),t=WA(),n=t_(),a=mC(),i=a||n||t;return uv=function(){var s,u={assert:function(c){if(!u.has(c))throw new e("Side channel does not contain "+r(c))},delete:function(c){return!!s&&s.delete(c)},get:function(c){return s&&s.get(c)},has:function(c){return!!s&&s.has(c)},set:function(c,h){s||(s=i()),s.set(c,h)}};return u},uv}var cv,k3;function km(){if(k3)return cv;k3=1;var e=String.prototype.replace,r=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return cv={default:t.RFC3986,formatters:{RFC1738:function(n){return e.call(n,r,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},cv}var fv,L3;function r_(){if(L3)return fv;L3=1;var e=km(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],_=0;_<256;++_)w.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return w}(),a=function(_){for(;_.length>1;){var y=_.pop(),p=y.obj[y.prop];if(t(p)){for(var m=[],P=0;P<p.length;++P)typeof p[P]<"u"&&m.push(p[P]);y.obj[y.prop]=m}}},i=function(_,y){for(var p=y&&y.plainObjects?{__proto__:null}:{},m=0;m<_.length;++m)typeof _[m]<"u"&&(p[m]=_[m]);return p},o=function w(_,y,p){if(!y)return _;if(typeof y!="object"&&typeof y!="function"){if(t(_))_.push(y);else if(_&&typeof _=="object")(p&&(p.plainObjects||p.allowPrototypes)||!r.call(Object.prototype,y))&&(_[y]=!0);else return[_,y];return _}if(!_||typeof _!="object")return[_].concat(y);var m=_;return t(_)&&!t(y)&&(m=i(_,p)),t(_)&&t(y)?(y.forEach(function(P,T){if(r.call(_,T)){var k=_[T];k&&typeof k=="object"&&P&&typeof P=="object"?_[T]=w(k,P,p):_.push(P)}else _[T]=P}),_):Object.keys(y).reduce(function(P,T){var k=y[T];return r.call(P,T)?P[T]=w(P[T],k,p):P[T]=k,P},m)},s=function(_,y){return Object.keys(y).reduce(function(p,m){return p[m]=y[m],p},_)},u=function(w,_,y){var p=w.replace(/\+/g," ");if(y==="iso-8859-1")return p.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(p)}catch{return p}},c=1024,h=function(_,y,p,m,P){if(_.length===0)return _;var T=_;if(typeof _=="symbol"?T=Symbol.prototype.toString.call(_):typeof _!="string"&&(T=String(_)),p==="iso-8859-1")return escape(T).replace(/%u[0-9a-f]{4}/gi,function(M){return"%26%23"+parseInt(M.slice(2),16)+"%3B"});for(var k="",L=0;L<T.length;L+=c){for(var I=T.length>=c?T.slice(L,L+c):T,R=[],A=0;A<I.length;++A){var O=I.charCodeAt(A);if(O===45||O===46||O===95||O===126||O>=48&&O<=57||O>=65&&O<=90||O>=97&&O<=122||P===e.RFC1738&&(O===40||O===41)){R[R.length]=I.charAt(A);continue}if(O<128){R[R.length]=n[O];continue}if(O<2048){R[R.length]=n[192|O>>6]+n[128|O&63];continue}if(O<55296||O>=57344){R[R.length]=n[224|O>>12]+n[128|O>>6&63]+n[128|O&63];continue}A+=1,O=65536+((O&1023)<<10|I.charCodeAt(A)&1023),R[R.length]=n[240|O>>18]+n[128|O>>12&63]+n[128|O>>6&63]+n[128|O&63]}k+=R.join("")}return k},v=function(_){for(var y=[{obj:{o:_},prop:"o"}],p=[],m=0;m<y.length;++m)for(var P=y[m],T=P.obj[P.prop],k=Object.keys(T),L=0;L<k.length;++L){var I=k[L],R=T[I];typeof R=="object"&&R!==null&&p.indexOf(R)===-1&&(y.push({obj:T,prop:I}),p.push(R))}return a(y),_},g=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},f=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},E=function(_,y){return[].concat(_,y)},S=function(_,y){if(t(_)){for(var p=[],m=0;m<_.length;m+=1)p.push(y(_[m]));return p}return y(_)};return fv={arrayToObject:i,assign:s,combine:E,compact:v,decode:u,encode:h,isBuffer:f,isRegExp:g,maybeMap:S,merge:o},fv}var hv,N3;function bC(){if(N3)return hv;N3=1;var e=yC(),r=r_(),t=km(),n=Object.prototype.hasOwnProperty,a={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,_){return w+"["+_+"]"},repeat:function(w){return w}},i=Array.isArray,o=Array.prototype.push,s=function(S,w){o.apply(S,i(w)?w:[w])},u=Date.prototype.toISOString,c=t.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(w){return u.call(w)},skipNulls:!1,strictNullHandling:!1},v=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},g={},f=function S(w,_,y,p,m,P,T,k,L,I,R,A,O,M,q,D,te,H){for(var B=w,$=H,V=0,j=!1;($=$.get(g))!==void 0&&!j;){var z=$.get(w);if(V+=1,typeof z<"u"){if(z===V)throw new RangeError("Cyclic object value");j=!0}typeof $.get(g)>"u"&&(V=0)}if(typeof I=="function"?B=I(_,B):B instanceof Date?B=O(B):y==="comma"&&i(B)&&(B=r.maybeMap(B,function(Pe){return Pe instanceof Date?O(Pe):Pe})),B===null){if(P)return L&&!D?L(_,h.encoder,te,"key",M):_;B=""}if(v(B)||r.isBuffer(B)){if(L){var F=D?_:L(_,h.encoder,te,"key",M);return[q(F)+"="+q(L(B,h.encoder,te,"value",M))]}return[q(_)+"="+q(String(B))]}var Y=[];if(typeof B>"u")return Y;var J;if(y==="comma"&&i(B))D&&L&&(B=r.maybeMap(B,L)),J=[{value:B.length>0?B.join(",")||null:void 0}];else if(i(I))J=I;else{var X=Object.keys(B);J=R?X.sort(R):X}var Q=k?String(_).replace(/\./g,"%2E"):String(_),ae=p&&i(B)&&B.length===1?Q+"[]":Q;if(m&&i(B)&&B.length===0)return ae+"[]";for(var se=0;se<J.length;++se){var fe=J[se],be=typeof fe=="object"&&fe&&typeof fe.value<"u"?fe.value:B[fe];if(!(T&&be===null)){var _e=A&&k?String(fe).replace(/\./g,"%2E"):String(fe),Ae=i(B)?typeof y=="function"?y(ae,_e):ae:ae+(A?"."+_e:"["+_e+"]");H.set(w,V);var Re=e();Re.set(g,H),s(Y,S(be,Ae,y,p,m,P,T,k,y==="comma"&&D&&i(B)?null:L,I,R,A,O,M,q,D,te,Re))}}return Y},E=function(w){if(!w)return h;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=w.charset||h.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");y=w.format}var p=t.formatters[y],m=h.filter;(typeof w.filter=="function"||i(w.filter))&&(m=w.filter);var P;if(w.arrayFormat in a?P=w.arrayFormat:"indices"in w?P=w.indices?"indices":"repeat":P=h.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var T=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:h.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:h.addQueryPrefix,allowDots:T,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:P,charset:_,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?h.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:h.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:h.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:h.encodeValuesOnly,filter:m,format:y,formatter:p,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:h.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:h.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:h.strictNullHandling}};return hv=function(S,w){var _=S,y=E(w),p,m;typeof y.filter=="function"?(m=y.filter,_=m("",_)):i(y.filter)&&(m=y.filter,p=m);var P=[];if(typeof _!="object"||_===null)return"";var T=a[y.arrayFormat],k=T==="comma"&&y.commaRoundTrip;p||(p=Object.keys(_)),y.sort&&p.sort(y.sort);for(var L=e(),I=0;I<p.length;++I){var R=p[I],A=_[R];y.skipNulls&&A===null||s(P,f(A,R,T,k,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,L))}var O=P.join(y.delimiter),M=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),O.length>0?M+O:""},hv}var dv,T3;function wC(){if(T3)return dv;T3=1;var e=r_(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(g){return g.replace(/&#(\d+);/g,function(f,E){return String.fromCharCode(parseInt(E,10))})},i=function(g,f,E){if(g&&typeof g=="string"&&f.comma&&g.indexOf(",")>-1)return g.split(",");if(f.throwOnLimitExceeded&&E>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return g},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(f,E){var S={__proto__:null},w=E.ignoreQueryPrefix?f.replace(/^\?/,""):f;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=E.parameterLimit===1/0?void 0:E.parameterLimit,y=w.split(E.delimiter,E.throwOnLimitExceeded?_+1:_);if(E.throwOnLimitExceeded&&y.length>_)throw new RangeError("Parameter limit exceeded. Only "+_+" parameter"+(_===1?"":"s")+" allowed.");var p=-1,m,P=E.charset;if(E.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===s?P="utf-8":y[m]===o&&(P="iso-8859-1"),p=m,m=y.length);for(m=0;m<y.length;++m)if(m!==p){var T=y[m],k=T.indexOf("]="),L=k===-1?T.indexOf("="):k+1,I,R;L===-1?(I=E.decoder(T,n.decoder,P,"key"),R=E.strictNullHandling?null:""):(I=E.decoder(T.slice(0,L),n.decoder,P,"key"),R=e.maybeMap(i(T.slice(L+1),E,t(S[I])?S[I].length:0),function(O){return E.decoder(O,n.decoder,P,"value")})),R&&E.interpretNumericEntities&&P==="iso-8859-1"&&(R=a(String(R))),T.indexOf("[]=")>-1&&(R=t(R)?[R]:R);var A=r.call(S,I);A&&E.duplicates==="combine"?S[I]=e.combine(S[I],R):(!A||E.duplicates==="last")&&(S[I]=R)}return S},c=function(g,f,E,S){var w=0;if(g.length>0&&g[g.length-1]==="[]"){var _=g.slice(0,-1).join("");w=Array.isArray(f)&&f[_]?f[_].length:0}for(var y=S?f:i(f,E,w),p=g.length-1;p>=0;--p){var m,P=g[p];if(P==="[]"&&E.parseArrays)m=E.allowEmptyArrays&&(y===""||E.strictNullHandling&&y===null)?[]:e.combine([],y);else{m=E.plainObjects?{__proto__:null}:{};var T=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,k=E.decodeDotInKeys?T.replace(/%2E/g,"."):T,L=parseInt(k,10);!E.parseArrays&&k===""?m={0:y}:!isNaN(L)&&P!==k&&String(L)===k&&L>=0&&E.parseArrays&&L<=E.arrayLimit?(m=[],m[L]=y):k!=="__proto__"&&(m[k]=y)}y=m}return y},h=function(f,E,S,w){if(f){var _=S.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,y=/(\[[^[\]]*])/,p=/(\[[^[\]]*])/g,m=S.depth>0&&y.exec(_),P=m?_.slice(0,m.index):_,T=[];if(P){if(!S.plainObjects&&r.call(Object.prototype,P)&&!S.allowPrototypes)return;T.push(P)}for(var k=0;S.depth>0&&(m=p.exec(_))!==null&&k<S.depth;){if(k+=1,!S.plainObjects&&r.call(Object.prototype,m[1].slice(1,-1))&&!S.allowPrototypes)return;T.push(m[1])}if(m){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");T.push("["+_.slice(m.index)+"]")}return c(T,E,S,w)}},v=function(f){if(!f)return n;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof f.throwOnLimitExceeded<"u"&&typeof f.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var E=typeof f.charset>"u"?n.charset:f.charset,S=typeof f.duplicates>"u"?n.duplicates:f.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:n.allowDots:!!f.allowDots;return{allowDots:w,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:n.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:n.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:n.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:n.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:n.decoder,delimiter:typeof f.delimiter=="string"||e.isRegExp(f.delimiter)?f.delimiter:n.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:n.depth,duplicates:S,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:n.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:n.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:n.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return dv=function(g,f){var E=v(f);if(g===""||g===null||typeof g>"u")return E.plainObjects?{__proto__:null}:{};for(var S=typeof g=="string"?u(g,E):g,w=E.plainObjects?{__proto__:null}:{},_=Object.keys(S),y=0;y<_.length;++y){var p=_[y],m=h(p,S[p],E,typeof g=="string");w=e.merge(w,m,E)}return E.allowSparse===!0?w:e.compact(w)},dv}var pv,R3;function _C(){if(R3)return pv;R3=1;var e=bC(),r=wC(),t=km();return pv={formats:t,parse:r,stringify:e},pv}var M3;function n_(){if(M3)return wf;M3=1;var e=UA();function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",`
|
|
159
|
+
`," "],o=["{","}","|","\\","^","`"].concat(i),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),c=["/","?","#"],h=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=_C();function _(P,T,k){if(P&&typeof P=="object"&&P instanceof r)return P;var L=new r;return L.parse(P,T,k),L}r.prototype.parse=function(P,T,k){if(typeof P!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof P);var L=P.indexOf("?"),I=L!==-1&&L<P.indexOf("#")?"?":"#",R=P.split(I),A=/\\/g;R[0]=R[0].replace(A,"/"),P=R.join(I);var O=P;if(O=O.trim(),!k&&P.split("#").length===1){var M=a.exec(O);if(M)return this.path=O,this.href=O,this.pathname=M[1],M[2]?(this.search=M[2],T?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):T&&(this.search="",this.query={}),this}var q=t.exec(O);if(q){q=q[0];var D=q.toLowerCase();this.protocol=D,O=O.substr(q.length)}if(k||q||O.match(/^\/\/[^@/]+@[^@/]+/)){var te=O.substr(0,2)==="//";te&&!(q&&E[q])&&(O=O.substr(2),this.slashes=!0)}if(!E[q]&&(te||q&&!S[q])){for(var H=-1,B=0;B<c.length;B++){var $=O.indexOf(c[B]);$!==-1&&(H===-1||$<H)&&(H=$)}var V,j;H===-1?j=O.lastIndexOf("@"):j=O.lastIndexOf("@",H),j!==-1&&(V=O.slice(0,j),O=O.slice(j+1),this.auth=decodeURIComponent(V)),H=-1;for(var B=0;B<u.length;B++){var $=O.indexOf(u[B]);$!==-1&&(H===-1||$<H)&&(H=$)}H===-1&&(H=O.length),this.host=O.slice(0,H),O=O.slice(H),this.parseHost(),this.hostname=this.hostname||"";var z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!z)for(var F=this.hostname.split(/\./),B=0,Y=F.length;B<Y;B++){var J=F[B];if(J&&!J.match(v)){for(var X="",Q=0,ae=J.length;Q<ae;Q++)J.charCodeAt(Q)>127?X+="x":X+=J[Q];if(!X.match(v)){var se=F.slice(0,B),fe=F.slice(B+1),be=J.match(g);be&&(se.push(be[1]),fe.unshift(be[2])),fe.length&&(O="/"+fe.join(".")+O),this.hostname=se.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=e.toASCII(this.hostname));var _e=this.port?":"+this.port:"",Ae=this.hostname||"";this.host=Ae+_e,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),O[0]!=="/"&&(O="/"+O))}if(!f[D])for(var B=0,Y=s.length;B<Y;B++){var Re=s[B];if(O.indexOf(Re)!==-1){var Pe=encodeURIComponent(Re);Pe===Re&&(Pe=escape(Re)),O=O.split(Re).join(Pe)}}var ye=O.indexOf("#");ye!==-1&&(this.hash=O.substr(ye),O=O.slice(0,ye));var nt=O.indexOf("?");if(nt!==-1?(this.search=O.substr(nt),this.query=O.substr(nt+1),T&&(this.query=w.parse(this.query)),O=O.slice(0,nt)):T&&(this.search="",this.query={}),O&&(this.pathname=O),S[D]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var _e=this.pathname||"",Ce=this.search||"";this.path=_e+Ce}return this.href=this.format(),this};function y(P){return typeof P=="string"&&(P=_(P)),P instanceof r?P.format():r.prototype.format.call(P)}r.prototype.format=function(){var P=this.auth||"";P&&(P=encodeURIComponent(P),P=P.replace(/%3A/i,":"),P+="@");var T=this.protocol||"",k=this.pathname||"",L=this.hash||"",I=!1,R="";this.host?I=P+this.host:this.hostname&&(I=P+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(I+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(R=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||R&&"?"+R||"";return T&&T.substr(-1)!==":"&&(T+=":"),this.slashes||(!T||S[T])&&I!==!1?(I="//"+(I||""),k&&k.charAt(0)!=="/"&&(k="/"+k)):I||(I=""),L&&L.charAt(0)!=="#"&&(L="#"+L),A&&A.charAt(0)!=="?"&&(A="?"+A),k=k.replace(/[?#]/g,function(O){return encodeURIComponent(O)}),A=A.replace("#","%23"),T+I+k+A+L};function p(P,T){return _(P,!1,!0).resolve(T)}r.prototype.resolve=function(P){return this.resolveObject(_(P,!1,!0)).format()};function m(P,T){return P?_(P,!1,!0).resolveObject(T):T}return r.prototype.resolveObject=function(P){if(typeof P=="string"){var T=new r;T.parse(P,!1,!0),P=T}for(var k=new r,L=Object.keys(this),I=0;I<L.length;I++){var R=L[I];k[R]=this[R]}if(k.hash=P.hash,P.href==="")return k.href=k.format(),k;if(P.slashes&&!P.protocol){for(var A=Object.keys(P),O=0;O<A.length;O++){var M=A[O];M!=="protocol"&&(k[M]=P[M])}return S[k.protocol]&&k.hostname&&!k.pathname&&(k.pathname="/",k.path=k.pathname),k.href=k.format(),k}if(P.protocol&&P.protocol!==k.protocol){if(!S[P.protocol]){for(var q=Object.keys(P),D=0;D<q.length;D++){var te=q[D];k[te]=P[te]}return k.href=k.format(),k}if(k.protocol=P.protocol,!P.host&&!E[P.protocol]){for(var Y=(P.pathname||"").split("/");Y.length&&!(P.host=Y.shift()););P.host||(P.host=""),P.hostname||(P.hostname=""),Y[0]!==""&&Y.unshift(""),Y.length<2&&Y.unshift(""),k.pathname=Y.join("/")}else k.pathname=P.pathname;if(k.search=P.search,k.query=P.query,k.host=P.host||"",k.auth=P.auth,k.hostname=P.hostname||P.host,k.port=P.port,k.pathname||k.search){var H=k.pathname||"",B=k.search||"";k.path=H+B}return k.slashes=k.slashes||P.slashes,k.href=k.format(),k}var $=k.pathname&&k.pathname.charAt(0)==="/",V=P.host||P.pathname&&P.pathname.charAt(0)==="/",j=V||$||k.host&&P.pathname,z=j,F=k.pathname&&k.pathname.split("/")||[],Y=P.pathname&&P.pathname.split("/")||[],J=k.protocol&&!S[k.protocol];if(J&&(k.hostname="",k.port=null,k.host&&(F[0]===""?F[0]=k.host:F.unshift(k.host)),k.host="",P.protocol&&(P.hostname=null,P.port=null,P.host&&(Y[0]===""?Y[0]=P.host:Y.unshift(P.host)),P.host=null),j=j&&(Y[0]===""||F[0]==="")),V)k.host=P.host||P.host===""?P.host:k.host,k.hostname=P.hostname||P.hostname===""?P.hostname:k.hostname,k.search=P.search,k.query=P.query,F=Y;else if(Y.length)F||(F=[]),F.pop(),F=F.concat(Y),k.search=P.search,k.query=P.query;else if(P.search!=null){if(J){k.host=F.shift(),k.hostname=k.host;var X=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;X&&(k.auth=X.shift(),k.hostname=X.shift(),k.host=k.hostname)}return k.search=P.search,k.query=P.query,(k.pathname!==null||k.search!==null)&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.href=k.format(),k}if(!F.length)return k.pathname=null,k.search?k.path="/"+k.search:k.path=null,k.href=k.format(),k;for(var Q=F.slice(-1)[0],ae=(k.host||P.host||F.length>1)&&(Q==="."||Q==="..")||Q==="",se=0,fe=F.length;fe>=0;fe--)Q=F[fe],Q==="."?F.splice(fe,1):Q===".."?(F.splice(fe,1),se++):se&&(F.splice(fe,1),se--);if(!j&&!z)for(;se--;se)F.unshift("..");j&&F[0]!==""&&(!F[0]||F[0].charAt(0)!=="/")&&F.unshift(""),ae&&F.join("/").substr(-1)!=="/"&&F.push("");var be=F[0]===""||F[0]&&F[0].charAt(0)==="/";if(J){k.hostname=be?"":F.length?F.shift():"",k.host=k.hostname;var X=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;X&&(k.auth=X.shift(),k.hostname=X.shift(),k.host=k.hostname)}return j=j||k.host&&F.length,j&&!be&&F.unshift(""),F.length>0?k.pathname=F.join("/"):(k.pathname=null,k.path=null),(k.pathname!==null||k.search!==null)&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.auth=P.auth||k.auth,k.slashes=k.slashes||P.slashes,k.href=k.format(),k},r.prototype.parseHost=function(){var P=this.host,T=n.exec(P);T&&(T=T[0],T!==":"&&(this.port=T.substr(1)),P=P.substr(0,P.length-T.length)),P&&(this.hostname=P)},wf.parse=_,wf.resolve=p,wf.resolveObject=m,wf.format=y,wf.Url=r,wf}var w1={exports:{}},SC=w1.exports,I3;function xC(){return I3||(I3=1,function(e){(function(r,t){e.exports?e.exports=t():r.xmlserializer=t()})(SC,function(){var r=function(f){return f.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},a=function(f){var E=f.value;return" "+f.name+'="'+t(E)+'"'},i=function(f){var E=f.tagName;return f.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(f,E){var S=Array.prototype.map.call(f.attributes||f.attrs,function(w){return w.name}).indexOf("xmlns")>=0;return!S&&(E||f.namespaceURI!==f.parentNode.namespaceURI)?' xmlns="'+f.namespaceURI+'"':""},s=function(f){return Array.prototype.map.call(f.childNodes,function(E){return g(E)}).join("")},u=function(f,E){var S="<"+i(f);return S+=o(f,E),Array.prototype.forEach.call(f.attributes||f.attrs,function(w){S+=a(w)}),f.childNodes.length>0?(S+=">",S+=s(f),S+="</"+i(f)+">"):S+="/>",S},c=function(f){var E=f.nodeValue||f.value||"";return n(E)},h=function(f){return"<!--"+f.data.replace(/-/g,"-")+"-->"},v=function(f){return"<![CDATA["+f.nodeValue+"]]>"},g=function(f,E){var S=E&&E.rootNode;if(f.nodeName==="#document"||f.nodeName==="#document-fragment")return s(f);if(f.tagName)return u(f,S);if(f.nodeName==="#text")return c(f);if(f.nodeName==="#comment")return h(f);if(f.nodeName==="#cdata-section")return v(f)};return{serializeToString:function(f){return r(g(f,{rootNode:!0}))}}})}(w1)),w1.exports}var gv={},j3;function EC(){if(j3)return gv;j3=1;var e=function(i){var o=new XMLSerializer;return Array.prototype.map.call(i.childNodes,function(s){return o.serializeToString(s)}).join("")},r=function(i){if(i.documentElement.tagName==="parsererror"&&i.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return i.documentElement;if((i.documentElement.tagName==="xml"||i.documentElement.tagName==="html")&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0];if(i.documentElement.tagName==="html"&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="body"&&i.documentElement.childNodes[0].childNodes&&i.documentElement.childNodes[0].childNodes.length&&i.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
160
|
+
?</div>`),new RegExp(`^(.+)
|
|
161
|
+
`)],n=function(i){var o=e(i),s,u;for(s=0;s<t.length;s++)if(u=t[s].exec(o),u)return u[1]},a=function(i){var o;if(i===null)throw new Error("Parse error");var s=r(i);if(s!==void 0)throw o=n(s)||"Parse error",new Error(o)};return gv.failOnParseError=function(i){return a(i),i},gv}var vv={},mv={},F3;function l0(){return F3||(F3=1,function(e){var r=n_();e.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},e.clone=function(s){var u={},c;for(c in s)s.hasOwnProperty(c)&&(u[c]=s[c]);return u},e.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},e.joinUrl=function(s,u){return s?r.resolve(s,u):u},e.isDataUri=function(s){return/^data:/.test(s)},e.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(c){return c.catch(function(h){u.push(h)})})).then(function(){return u})};var t=null,n=function(s,u){return u===!1||u==="none"||u==="repeated"?((t===null||u!=="repeated")&&(t=Date.now()),s+"?_="+t):s};e.ajax=function(s,u){return new Promise(function(c,h){var v=new window.XMLHttpRequest,g=e.joinUrl(u.baseUrl,s),f,E=function(){h({msg:"Unable to load url",url:g})};f=n(g,u.cache),v.addEventListener("load",function(){v.status===200||v.status===0?c(v.response):E()},!1),v.addEventListener("error",E,!1);try{v.open("GET",f,!0),v.overrideMimeType(u.mimeType),v.send(null)}catch{E()}})},e.binaryAjax=function(s,u){var c=e.clone(u);return c.mimeType="text/plain; charset=x-user-defined",e.ajax(s,c).then(function(h){for(var v="",g=0;g<h.length;g++)v+=String.fromCharCode(h.charCodeAt(g)&255);return v})};var a=function(s){var u=function(c,h){return c.substring(0,h.length)===h};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(s,u){return e.binaryAjax(s,u).then(function(c){var h=btoa(c),v=a(c);return"data:"+v+";base64,"+h})};var i=[],o=function(s){return i.indexOf(s)<0&&i.push(s),i.indexOf(s)};e.memoize=function(s,u,c){if(typeof c!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),v=u(h),g=o(s),f;return c[g]&&c[g][v]?c[g][v]:(f=s.apply(null,h),c[g]=c[g]||{},c[g][v]=f,f)}}}(mv)),mv}var yv={},D3;function PC(){if(D3)return yv;D3=1;var e=l0(),r=function(i,o){var s=null;i.hasAttribute("src")?s=i.getAttribute("src"):i.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=i.getAttributeNS("http://www.w3.org/1999/xlink","href"):i.hasAttribute("href")&&(s=i.getAttribute("href"));var u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.getDataURIForImageURL(s,c).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},t=function(i){return i.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!e.isDataUri(s)})},n=function(i){return Array.prototype.filter.call(i,function(o){return o.type==="image"})},a=function(i){return Array.prototype.slice.call(i)};return yv.inline=function(i,o){var s=a(i.getElementsByTagName("img")),u=a(i.getElementsByTagName("image")),c=n(i.getElementsByTagName("input"));s=s.concat(u),s=s.concat(c);var h=t(s);return e.collectAndReportErrors(h.map(function(v){return r(v,o).then(function(g){v.attributes.src?v.attributes.src.value=g:v.attributes["xlink:href"]?v.attributes["xlink:href"].value=g:v.attributes.href&&(v.attributes.href.value=g)})}))},yv}var bv={},B3;function OC(){if(B3)return bv;B3=1;var e=l0(),r=function(i,o){var s=i.attributes.src.value,u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.ajax(s,c).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},t=function(i){return i.replace(/<\//g,"<\\/")},n=function(i,o){i.attributes.removeNamedItem("src"),i.textContent=t(o)},a=function(i){var o=i.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return bv.inline=function(i,o){var s=a(i);return e.collectAndReportErrors(s.map(function(u){return r(u,o).then(function(c){n(u,c)})}))},bv}var wv={},_v={},q3;function Lm(){return q3||(q3=1,function(e){e.unquoteString=function(r){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(r)?r.replace(t,"$1"):n.test(r)?r.replace(n,"$1"):r},e.rulesForCssText=function(r){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style"),a;return n.textContent=r,t.body.appendChild(n),a=n.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(r){return r.reduce(function(t,n){return t+n.cssText},"")},e.exchangeRule=function(r,t,n){var a=r.indexOf(t);r[a]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(r,t,n){var a="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(a+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(a+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),t.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+t.style.getPropertyValue("unicode-range")+"; "),a+="src: "+n+"}",e.exchangeRule(r,t,a)}}(_v)),_v}var Sv={},z3;function AC(){return z3||(z3=1,function(e){var r=Lm(),t=function(i){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return i.replace(o,"$1")};e.extractCssUrl=function(i){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(i))throw new Error("Invalid url");return s=o.exec(i)[1],r.unquoteString(t(s))};var n=function(i){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",c="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),v,g=[],f=function(E){var S=new RegExp(s,"g"),w=[],_;for(_=S.exec(E);_;)w.push(_[1]),_=S.exec(E);return w};if(i.match(new RegExp(c))){for(v=h.exec(i);v;)g.push(f(v[0])),v=h.exec(i);return g}return[]},a=function(i){var o,s;for(o=0;o<i.length;o++)try{return s=e.extractCssUrl(i[o]),{url:s,idx:o}}catch{}};e.parse=function(i){var o=n(i);return o.map(function(s){var u=a(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},e.serialize=function(i){var o=i.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}}(Sv)),Sv}function c1(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var xv={exports:{}},U3;function CC(){return U3||(U3=1,function(e,r){(function(t){e.exports=t()})(function(){return function t(n,a,i){function o(c,h){if(!a[c]){if(!n[c]){var v=typeof c1=="function"&&c1;if(!h&&v)return v(c,!0);if(s)return s(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var f=a[c]={exports:{}};n[c][0].call(f.exports,function(E){var S=n[c][1][E];return o(S||E)},f,f.exports,t,n,a,i)}return a[c].exports}for(var s=typeof c1=="function"&&c1,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,n,a){function i(u,c){function h(){this.constructor=u}h.prototype=c.prototype,u.prototype=new h}function o(u,c,h,v){this.message=u,this.expected=c,this.found=h,this.location=v,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}i(o,Error),o.buildMessage=function(u,c){var h={literal:function(_){return'"'+g(_.text)+'"'},class:function(_){var y="",p;for(p=0;p<_.parts.length;p++)y+=_.parts[p]instanceof Array?f(_.parts[p][0])+"-"+f(_.parts[p][1]):f(_.parts[p]);return"["+(_.inverted?"^":"")+y+"]"},any:function(_){return"any character"},end:function(_){return"end of input"},other:function(_){return _.description}};function v(_){return _.charCodeAt(0).toString(16).toUpperCase()}function g(_){return _.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(y){return"\\x0"+v(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+v(y)})}function f(_){return _.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(y){return"\\x0"+v(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+v(y)})}function E(_){return h[_.type](_)}function S(_){var y=new Array(_.length),p,m;for(p=0;p<_.length;p++)y[p]=E(_[p]);if(y.sort(),y.length>0){for(p=1,m=1;p<y.length;p++)y[p-1]!==y[p]&&(y[m]=y[p],m++);y.length=m}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}function w(_){return _?'"'+g(_)+'"':"end of input"}return"Expected "+S(u)+" but "+w(c)+" found."};function s(u,c){c=c!==void 0?c:{};var h={},v={start:_e},g=_e,f="",E=function(){return[]},S=",",w=J(",",!1),_=function(ve,Se){return[ve].concat(Se)},y=function(ve){return[ve]},p=function(ve,Se){return{url:ve,format:Se}},m=function(ve){return{url:ve}},P="url(",T=J("url(",!1),k=")",L=J(")",!1),I=function(ve){return ve},R="format(",A=J("format(",!1),O="local(",M=J("local(",!1),q=function(ve){return{local:ve}},D=/^[^)]/,te=X([")"],!0,!1),H=function(ve){return Te.extractValue(ve.join(""))},B=/^[ \t\r\n\f]/,$=X([" "," ","\r",`
|
|
162
|
+
`,"\f"],!1,!1),V=0,j=[{line:1,column:1}],z=0,F=[],Y;if("startRule"in c){if(!(c.startRule in v))throw new Error(`Can't start parsing from rule "`+c.startRule+'".');g=v[c.startRule]}function J(ve,Se){return{type:"literal",text:ve,ignoreCase:Se}}function X(ve,Se,je){return{type:"class",parts:ve,inverted:Se,ignoreCase:je}}function Q(){return{type:"end"}}function ae(ve){var Se=j[ve],je;if(Se)return Se;for(je=ve-1;!j[je];)je--;for(Se=j[je],Se={line:Se.line,column:Se.column};je<ve;)u.charCodeAt(je)===10?(Se.line++,Se.column=1):Se.column++,je++;return j[ve]=Se,Se}function se(ve,Se){var je=ae(ve),Ue=ae(Se);return{start:{offset:ve,line:je.line,column:je.column},end:{offset:Se,line:Ue.line,column:Ue.column}}}function fe(ve){V<z||(V>z&&(z=V,F=[]),F.push(ve))}function be(ve,Se,je){return new o(o.buildMessage(ve,Se),ve,Se,je)}function _e(){var ve,Se;return ve=Ae(),ve===h&&(ve=V,Se=f,Se!==h&&(Se=E()),ve=Se),ve}function Ae(){var ve,Se,je,Ue,ct,mt;if(ve=V,Se=Re(),Se!==h){for(je=[],Ue=ke();Ue!==h;)je.push(Ue),Ue=ke();if(je!==h)if(u.charCodeAt(V)===44?(Ue=S,V++):(Ue=h,fe(w)),Ue!==h){for(ct=[],mt=ke();mt!==h;)ct.push(mt),mt=ke();ct!==h?(mt=Ae(),mt!==h?(Se=_(Se,mt),ve=Se):(V=ve,ve=h)):(V=ve,ve=h)}else V=ve,ve=h;else V=ve,ve=h}else V=ve,ve=h;return ve===h&&(ve=V,Se=Re(),Se!==h&&(Se=y(Se)),ve=Se),ve}function Re(){var ve;return ve=Pe(),ve===h&&(ve=Ce()),ve}function Pe(){var ve,Se,je,Ue;if(ve=V,Se=ye(),Se!==h){if(je=[],Ue=ke(),Ue!==h)for(;Ue!==h;)je.push(Ue),Ue=ke();else je=h;je!==h?(Ue=nt(),Ue!==h?(Se=p(Se,Ue),ve=Se):(V=ve,ve=h)):(V=ve,ve=h)}else V=ve,ve=h;return ve===h&&(ve=V,Se=ye(),Se!==h&&(Se=m(Se)),ve=Se),ve}function ye(){var ve,Se,je,Ue;return ve=V,u.substr(V,4)===P?(Se=P,V+=4):(Se=h,fe(T)),Se!==h?(je=he(),je!==h?(u.charCodeAt(V)===41?(Ue=k,V++):(Ue=h,fe(L)),Ue!==h?(Se=I(je),ve=Se):(V=ve,ve=h)):(V=ve,ve=h)):(V=ve,ve=h),ve}function nt(){var ve,Se,je,Ue;return ve=V,u.substr(V,7)===R?(Se=R,V+=7):(Se=h,fe(A)),Se!==h?(je=he(),je!==h?(u.charCodeAt(V)===41?(Ue=k,V++):(Ue=h,fe(L)),Ue!==h?(Se=I(je),ve=Se):(V=ve,ve=h)):(V=ve,ve=h)):(V=ve,ve=h),ve}function Ce(){var ve,Se,je,Ue;return ve=V,u.substr(V,6)===O?(Se=O,V+=6):(Se=h,fe(M)),Se!==h?(je=he(),je!==h?(u.charCodeAt(V)===41?(Ue=k,V++):(Ue=h,fe(L)),Ue!==h?(Se=q(je),ve=Se):(V=ve,ve=h)):(V=ve,ve=h)):(V=ve,ve=h),ve}function he(){var ve,Se,je;if(ve=V,Se=[],D.test(u.charAt(V))?(je=u.charAt(V),V++):(je=h,fe(te)),je!==h)for(;je!==h;)Se.push(je),D.test(u.charAt(V))?(je=u.charAt(V),V++):(je=h,fe(te));else Se=h;return Se!==h&&(Se=H(Se)),ve=Se,ve}function ke(){var ve;return B.test(u.charAt(V))?(ve=u.charAt(V),V++):(ve=h,fe($)),ve}var Te=t("../util");if(Y=g(),Y!==h&&V===u.length)return Y;throw Y!==h&&V<u.length&&fe(Q()),be(F,z<u.length?u.charAt(z):null,z<u.length?se(z,z+1):se(z,z))}n.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(t,n,a){var i=t("./grammar");a.SyntaxError=function(o,s){this.message=o,this.offset=s},a.parse=function(o){try{return i.parse(o)}catch(s){throw new a.SyntaxError(s.message,s.offset)}},a.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(t,n,a){var i=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,c=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):c.test(s)?s.replace(c,"$1"):s};a.extractValue=function(s){return o(i(s))}},{}]},{},[2])(2)})}(xv)),xv.exports}var H3;function kC(){return H3||(H3=1,function(e){var r=l0(),t=Lm(),n=AC(),a=CC(),i=function(y,p,m){y.style.setProperty(p,m,y.style.getPropertyPriority(p))},o=function(y){return y.filter(function(p){return p.type===window.CSSRule.STYLE_RULE&&(p.style.getPropertyValue("background-image")||p.style.getPropertyValue("background"))})},s=function(y){var p=[];return y.forEach(function(m){m.style.getPropertyValue("background-image")?p.push({property:"background-image",value:m.style.getPropertyValue("background-image"),rule:m}):m.style.getPropertyValue("background")&&p.push({property:"background",value:m.style.getPropertyValue("background"),rule:m})}),p},u=function(y){return y.filter(function(p){return p.type===window.CSSRule.FONT_FACE_RULE&&p.style.getPropertyValue("src")})},c=function(y){return y.filter(function(p){return p.type===window.CSSRule.IMPORT_RULE&&p.href})},h=function(y){var p=[];return y.forEach(function(m,P){m.url&&!r.isDataUri(m.url)&&p.push(P)}),p},v=function(y){var p=[];return y.forEach(function(m,P){m.url&&!r.isDataUri(m.url)&&p.push(P)}),p};e.adjustPathsOfCssResources=function(y,p){var m=o(p),P=s(m),T=!1;return P.forEach(function(k){var L=n.parse(k.value),I=h(L),R;I.length>0&&(I.forEach(function(A){var O=L[A].url,M=r.joinUrl(y,O);L[A].url=M}),R=n.serialize(L),i(k.rule,k.property,R),T=!0)}),u(p).forEach(function(k){var L=k.style.getPropertyValue("src"),I,R;try{I=a.parse(L)}catch{return}R=v(I),R.length>0&&(R.forEach(function(A){var O=I[A].url,M=r.joinUrl(y,O);I[A].url=M}),t.changeFontFaceRuleSrc(p,k,a.serialize(I)),T=!0)}),c(p).forEach(function(k){var L=k.href,I=r.joinUrl(y,L);t.exchangeRule(p,k,"@import url("+I+");"),T=!0}),T};var g=function(y,p,m){var P=y.indexOf(p);y.splice(P,1),m.forEach(function(T,k){y.splice(P+k,0,T)})},f=function(y,p,m,P){var T=p.href,k;return T=t.unquoteString(T),k=r.joinUrl(P.baseUrl,T),m.indexOf(k)>=0?(g(y,p,[]),Promise.resolve([])):(m.push(k),r.ajax(T,P).then(function(L){var I=t.rulesForCssText(L);return e.loadCSSImportsForRules(I,m,P).then(function(R){return e.adjustPathsOfCssResources(T,I),g(y,p,I),R.errors})},function(L){throw{resourceType:"stylesheet",url:L.url,msg:"Unable to load stylesheet "+L.url}}))};e.loadCSSImportsForRules=function(y,p,m){var P=c(y),T=[],k=!1;return Promise.all(P.map(function(L){return f(y,L,p,m).then(function(I){T=T.concat(I),k=!0},function(I){T.push(I)})})).then(function(){return{hasChanges:k,errors:T}})};var E=function(y,p){var m=n.parse(y),P=h(m),T=!1;return r.collectAndReportErrors(P.map(function(k){var L=m[k].url;return r.getDataURIForImageURL(L,p).then(function(I){m[k].url=I,T=!0},function(I){throw{resourceType:"backgroundImage",url:I.url,msg:"Unable to load background-image "+I.url}})})).then(function(k){return{backgroundValue:n.serialize(m),hasChanges:T,errors:k}})},S=function(y,p){var m=o(y),P=s(m),T=[],k=!1;return Promise.all(P.map(function(L){return E(L.value,p).then(function(I){I.hasChanges&&(i(L.rule,L.property,I.backgroundValue),k=!0),T=T.concat(I.errors)})})).then(function(){return{hasChanges:k,errors:T}})},w=function(y,p){var m=!1,P,T;try{P=a.parse(y)}catch{P=[]}return T=v(P),r.collectAndReportErrors(T.map(function(k){var L=P[k],I=L.format||"woff";return r.binaryAjax(L.url,p).then(function(R){var A=btoa(R);L.url="data:font/"+I+";base64,"+A,m=!0},function(R){throw{resourceType:"fontFace",url:R.url,msg:"Unable to load font-face "+R.url}})})).then(function(k){return{srcDeclarationValue:a.serialize(P),hasChanges:m,errors:k}})},_=function(y,p){var m=u(y),P=[],T=!1;return Promise.all(m.map(function(k){var L=k.style.getPropertyValue("src");return w(L,p).then(function(I){I.hasChanges&&(t.changeFontFaceRuleSrc(y,k,I.srcDeclarationValue),T=!0),P=P.concat(I.errors)})})).then(function(){return{hasChanges:T,errors:P}})};e.loadAndInlineCSSResourcesForRules=function(y,p){var m=!1,P=[];return Promise.all([S,_].map(function(T){return T(y,p).then(function(k){m=m||k.hasChanges,P=P.concat(k.errors)})})).then(function(){return{hasChanges:m,errors:P}})}}(wv)),wv}var V3;function LC(){return V3||(V3=1,function(e){var r=l0(),t=PC(),n=OC(),a=kC(),i=Lm(),o=function(w){return r.joinUrl(w,".")},s=function(w){var _=w.map(function(y,p){return p===w.length-1&&(y={baseUrl:o(y.baseUrl)}),JSON.stringify(y)});return _},u=function(w,_){return _.cache!==!1&&_.cache!=="none"&&_.cacheBucket?r.memoize(w,s,_.cacheBucket):w},c=function(w,_,y){var p=i.rulesForCssText(w);return a.loadCSSImportsForRules(p,_,y).then(function(m){return a.loadAndInlineCSSResourcesForRules(p,y).then(function(P){var T=m.errors.concat(P.errors),k=m.hasChanges||P.hasChanges;return k&&(w=i.cssRulesToText(p)),{hasChanges:k,content:w,errors:T}})})},h=function(w,_,y){var p=w.textContent,m=u(c,_);return m(p,y,_).then(function(P){return P.hasChanges&&(w.childNodes[0].nodeValue=P.content),r.cloneArray(P.errors)})},v=function(w){var _=w.getElementsByTagName("style");return Array.prototype.filter.call(_,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(w,_){var y=v(w),p=[],m=[],P;return P=r.clone(_),P.baseUrl=P.baseUrl||r.getDocumentBaseUrl(w),Promise.all(y.map(function(T){return h(T,P,m).then(function(k){p=p.concat(k)})})).then(function(){return p})};var g=function(w,_){var y=w.parentNode,p;_=_.trim(),_&&(p=w.ownerDocument.createElement("style"),p.type="text/css",p.appendChild(w.ownerDocument.createTextNode(_)),y.insertBefore(p,w)),y.removeChild(w)},f=function(w,_){return r.ajax(w,_).then(function(y){var p=i.rulesForCssText(y);return{content:y,cssRules:p}}).then(function(y){var p=a.adjustPathsOfCssResources(w,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:p}}).then(function(y){return a.loadCSSImportsForRules(y.cssRules,[],_).then(function(p){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||p.hasChanges,errors:p.errors}})}).then(function(y){return a.loadAndInlineCSSResourcesForRules(y.cssRules,_).then(function(p){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||p.hasChanges,errors:y.errors.concat(p.errors)}})}).then(function(y){var p=y.content;return y.hasChanges&&(p=i.cssRulesToText(y.cssRules)),{content:p,errors:y.errors}})},E=function(w,_){var y=w.attributes.href.value,p=r.getDocumentBaseUrl(w.ownerDocument),m=r.clone(_);!m.baseUrl&&p&&(m.baseUrl=p);var P=u(f,_);return P(y,m).then(function(T){return{content:T.content,errors:r.cloneArray(T.errors)}})},S=function(w){var _=w.getElementsByTagName("link");return Array.prototype.filter.call(_,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(w,_){var y=S(w),p=[];return Promise.all(y.map(function(m){return E(m,_).then(function(P){g(m,P.content+`
|
|
163
|
+
`),p=p.concat(P.errors)},function(P){p.push({resourceType:"stylesheet",url:P.url,msg:"Unable to load stylesheet "+P.url})})})).then(function(){return p})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(w,_){var y=[],p=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return _.inlineScripts!==!1&&p.push(e.loadAndInlineScript),Promise.all(p.map(function(m){return m(w,_).then(function(P){y=y.concat(P)})})).then(function(){return y})}}(vv)),vv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
164
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
165
|
+
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var NC=b1.exports,G3;function TC(){return G3||(G3=1,function(e){(function(r,t){r===void 0&&window!==void 0&&(r=window),e.exports?e.exports=t(n_(),xC(),EC(),LC()):r.rasterizeHTML=t(r.url,r.xmlserializer,r.sanedomparsererror,r.inlineresources)})(NC,function(r,t,n,a){var i=function(E){var S={},w=[];S.joinUrl=function(p,m){return p?E.resolve(p,m):m},S.getConstantUniqueIdFor=function(p){return w.indexOf(p)<0&&w.push(p),w.indexOf(p)},S.clone=function(p){var m={},P;for(P in p)p.hasOwnProperty(P)&&(m[P]=p[P]);return m};var _=function(p){return typeof p=="object"&&p!==null},y=function(p){return _(p)&&Object.prototype.toString.apply(p).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return S.parseOptionalParameters=function(p){var m={canvas:null,options:{}};return p[0]==null||y(p[0])?(m.canvas=p[0]||null,m.options=S.clone(p[1])):m.options=S.clone(p[0]),m},S}(r),o=function(E){var S={},w=function(_,y,p){var m=_[y];return _[y]=function(){var P=Array.prototype.slice.call(arguments);return p.apply(this,[P,m])},m};return S.baseUrlRespectingXhr=function(_,y){var p=function(){var m=new _;return w(m,"open",function(P,T){var k=P.shift(),L=P.shift(),I=E.joinUrl(y,L);return T.apply(this,[k,I].concat(P))}),m};return p},S.finishNotifyingXhr=function(_){var y=0,p=0,m=!1,P,T=new Promise(function(L){P=function(){var I=y-p;I<=0&&m&&L({totalCount:y})}}),k=function(){var L=new _;return w(L,"send",function(I,R){return y+=1,R.apply(this,arguments)}),L.addEventListener("load",function(){p+=1,P()}),L};return k.waitForRequestsToFinish=function(){return m=!0,P(),T},k},S}(i),s=function(){var E={},S=function(k){return Array.prototype.slice.call(k)};E.addClassName=function(k,L){k.className+=" "+L},E.addClassNameRecursively=function(k,L){E.addClassName(k,L),k.parentNode!==k.ownerDocument&&E.addClassNameRecursively(k.parentNode,L)};var w=function(k,L){var I=k.parentStyleSheet,R=S(I.cssRules).indexOf(k);I.insertRule(L,R+1),I.deleteRule(R)},_=function(k,L){var I=k.cssText.replace(/^[^\{]+/,""),R=L+" "+I;w(k,R)},y=function(k){return S(k).reduce(function(L,I){return L+I.cssText},"")},p=function(k){k.textContent=y(k.sheet.cssRules)},m=function(k){var L=document.implementation.createHTMLDocument(""),I=document.createElement("style");I.textContent=k.textContent,L.body.appendChild(I),k.sheet=I.sheet},P=function(k){return"((?:^|[^.#:\\w])|(?=\\W))("+k.join("|")+")(?=\\W|$)"},T=function(k,L,I){var R=P(L);S(k.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&m(A);var O=S(A.sheet.cssRules).filter(function(M){return M.selectorText&&new RegExp(R,"i").test(M.selectorText)});O.length&&(O.forEach(function(M){var q=M.selectorText.replace(new RegExp(R,"gi"),function(D,te,H){return te+I(H)});q!==M.selectorText&&_(M,q)}),p(A))})};return E.rewriteCssSelectorWith=function(k,L,I){T(k,[L],function(){return I})},E.lowercaseCssTypeSelectors=function(k,L){T(k,L,function(I){return I.toLowerCase()})},E.findHtmlOnlyNodeNames=function(k){var L=k.ownerDocument.createTreeWalker(k,NodeFilter.SHOW_ELEMENT),I={},R={},A;do A=L.currentNode.tagName.toLowerCase(),L.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?I[A]=!0:R[A]=!0;while(L.nextNode());return Object.keys(I).filter(function(O){return!R[O]})},E}(),u=function(E){var S={},w=function(y){return Array.prototype.slice.call(y)},_={active:!0,hover:!0,focus:!1,target:!1};return S.fakeUserAction=function(y,p,m){var P=y.querySelector(p),T=":"+m,k="rasterizehtml"+m;P&&(_[m]?E.addClassNameRecursively(P,k):E.addClassName(P,k),E.rewriteCssSelectorWith(y,T,"."+k))},S.persistInputValues=function(y){var p=y.querySelectorAll("input"),m=y.querySelectorAll("textarea"),P=function(T){return T.type==="checkbox"||T.type==="radio"};w(p).filter(P).forEach(function(T){T.checked?T.setAttribute("checked",""):T.removeAttribute("checked")}),w(p).filter(function(T){return!P(T)}).forEach(function(T){T.setAttribute("value",T.value)}),w(m).forEach(function(T){T.textContent=T.value})},S.rewriteTagNameSelectorsToLowerCase=function(y){E.lowercaseCssTypeSelectors(y,E.findHtmlOnlyNodeNames(y))},S}(s),c=function(E,S,w,_){var y={},p=function(H,B,$,V){var j=H.createElement(B);return j.style.visibility="hidden",j.style.width=$+"px",j.style.height=V+"px",j.style.position="absolute",j.style.top=-1e4-V+"px",j.style.left=-1e4-$+"px",H.getElementsByTagName("body")[0].appendChild(j),j},m=function(H){return H>0?new Promise(function(B){setTimeout(B,H)}):Promise.resolve()};y.executeJavascript=function(H,B){return new Promise(function($){var V=p(_.document,"iframe",B.width,B.height),j=H.outerHTML,z=[],F=B.executeJsTimeout||0,Y=function(){_.document.getElementsByTagName("body")[0].removeChild(V)},J=function(){var se=V.contentDocument;$({document:se,errors:z,cleanUp:Y})},X=V.contentWindow.XMLHttpRequest,Q=S.finishNotifyingXhr(X),ae=S.baseUrlRespectingXhr(Q,B.baseUrl);V.onload=function(){m(F).then(Q.waitForRequestsToFinish).then(J)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=ae,V.contentWindow.onerror=function(se){z.push({resourceType:"scriptExecution",msg:se})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(j),V.contentDocument.close()})};var P=function(H,B,$){var V=H.createElement("iframe");return V.style.width=B+"px",V.style.height=$+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-$+"px",V.style.left=-1e4-B+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},T=function(H,B,$){var V=Math.floor(H/$),j=Math.floor(B/$);return P(_.document,V,j)},k=function(H,B,$,V){return{width:Math.max(H.width*V,B),height:Math.max(H.height*V,$)}},L=function(H,B){var $=H.querySelector(B);if($)return $;if(H.ownerDocument.querySelector(B)===H)return H;throw{message:"Clipping selector not found"}},I=function(H,B,$,V,j){var z=Math.max(H.scrollWidth,H.clientWidth),F=Math.max(H.scrollHeight,H.clientHeight),Y,J,X,Q,ae,se,fe,be;return B?(se=L(H,B),fe=se.getBoundingClientRect(),Y=fe.top,J=fe.left,X=fe.width,Q=fe.height):(Y=0,J=0,X=z,Q=F),be=k({width:X,height:Q},$,V,j),ae=_.getComputedStyle(H.ownerDocument.documentElement).fontSize,{left:J,top:Y,width:be.width,height:be.height,viewportWidth:z,viewportHeight:F,rootFontSize:ae}},R=function(H,B){var $=H.tagName;return B.querySelector($)},A=function(H){var B=H.tagName.toLowerCase();return B==="html"||B==="body"?H.outerHTML:'<body style="margin: 0;">'+H.outerHTML+"</body>"};y.calculateDocumentContentSize=function(H,B){return new Promise(function($,V){var j=B.zoom||1,z;z=T(B.width,B.height,j),_.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var F=z.contentDocument,Y;try{Y=I(R(H,F),B.clip,B.width,B.height,j),$(Y)}catch(J){V(J)}finally{_.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(A(H)),z.contentDocument.close()})},y.parseHtmlFragment=function(H){var B=_.document.implementation.createHTMLDocument("");B.documentElement.innerHTML=H;var $=B.querySelector("body").firstChild;if(!$)throw"Invalid source";return $};var O=function(H,B){var $=/<html((?:\s+[^>]*)?)>/im.exec(B),V=_.document.implementation.createHTMLDocument(""),j,z,F,Y;if($)for(j="<div"+$[1]+"></div>",V.documentElement.innerHTML=j,F=V.querySelector("div"),z=0;z<F.attributes.length;z++)Y=F.attributes[z],H.documentElement.setAttribute(Y.name,Y.value)};y.parseHTML=function(H){var B=_.document.implementation.createHTMLDocument("");return B.documentElement.innerHTML=H,O(B,H),B};var M=function(H){try{return w.failOnParseError(H)}catch(B){throw{message:"Invalid source",originalError:B}}};y.validateXHTML=function(H){var B=new DOMParser,$=B.parseFromString(H,"application/xml");M($)};var q=null,D=function(H,B){return B==="none"||B==="repeated"?((q===null||B!=="repeated")&&(q=Date.now()),H+"?_="+q):H},te=function(H,B){return new Promise(function($,V){var j=new window.XMLHttpRequest,z=E.joinUrl(B.baseUrl,H),F=D(z,B.cache),Y=function(J){V({message:"Unable to load page",originalError:J})};j.addEventListener("load",function(){j.status===200||j.status===0?$(j.responseXML):Y(j.statusText)},!1),j.addEventListener("error",function(J){Y(J)},!1);try{j.open("GET",F,!0),j.responseType="document",j.send(null)}catch(J){Y(J)}})};return y.loadDocument=function(H,B){return te(H,B).then(function($){return M($)})},y}(i,o,n,window),h=function(E){var S={},w=function(R,A){return A?URL.createObjectURL(new Blob([R],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(R)},_=function(R){R instanceof Blob&&URL.revokeObjectURL(R)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',p=function(R){return new Promise(function(A,O){var M=document.createElement("canvas"),q=new Image;q.onload=function(){var D=M.getContext("2d");try{D.drawImage(q,0,0),M.toDataURL("image/png"),A(!0)}catch{A(!1)}},q.onerror=O,q.src=R})},m=function(){var R=w(y,!0);return p(R).then(function(A){return _(R),A?!1:p(w(y,!1)).then(function(O){return O})},function(){return!1})},P=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},T=function(){return new Promise(function(R,A){P()&&E.URL?m().then(function(O){R(!O)},function(){A()}):R(!1)})},k,L=function(){return k===void 0&&(k=T()),k},I=function(R){return L().then(function(A){return w(R,A)})};return S.renderSvg=function(R){return new Promise(function(A,O){var M,q,D=function(){q.onload=null,q.onerror=null},te=function(){M&&_(M)};q=new Image,q.onload=function(){D(),te(),A(q)},q.onerror=function(){te(),O()},I(R).then(function(H){M=H,q.src=M},O)})},S}(window),v=function(E,S,w,_){var y={},p=function(R,A){var O=A||1,M={width:R.width,height:R.height,"font-size":R.rootFontSize};return O!==1&&(M.style="transform:scale("+O+"); transform-origin: 0 0;"),M},m=function(R){var A,O,M,q;A=Math.round(R.viewportWidth),O=Math.round(R.viewportHeight),M=-R.left,q=-R.top;var D={x:M,y:q,width:A,height:O};return D},P=function(R){var A=R.style||"";R.style=A+"float: left;"},T=function(R){R.externalResourcesRequired=!0},k=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},L=function(R){var A=Object.keys(R);return A.length?" "+A.map(function(O){return O+'="'+R[O]+'"'}).join(" "):""},I=function(R,A,O){var M=_.serializeToString(R);S.validateXHTML(M);var q=m(A);return P(q),T(q),'<svg xmlns="http://www.w3.org/2000/svg"'+L(p(A,O))+">"+k()+"<foreignObject"+L(q)+">"+M+"</foreignObject></svg>"};return y.getSvgForDocument=function(R,A,O){return w.rewriteTagNameSelectorsToLowerCase(R),I(R,A,O)},y.drawDocumentAsSvg=function(R,A){return["hover","active","focus","target"].forEach(function(O){A[O]&&w.fakeUserAction(R,A[O],O)}),S.calculateDocumentContentSize(R,A).then(function(O){return y.getSvgForDocument(R,O,A.zoom)})},y}(i,c,u,t),g=function(E,S,w,_,y,p){var m={},P=function(R){return{message:"Error rendering page",originalError:R}},T=function(R){return y.renderSvg(R).then(function(A){return{image:A,svg:R}},function(A){throw P(A)})},k=function(R,A){try{A.getContext("2d").drawImage(R,0,0)}catch(O){throw P(O)}},L=function(R,A,O){return _.drawDocumentAsSvg(R,O).then(T).then(function(M){return A&&k(M.image,A),M})},I=function(R,A){return S.executeJavascript(R,A).then(function(O){var M=O.document;return w.persistInputValues(M),{document:M,errors:O.errors,cleanUp:O.cleanUp}})};return m.rasterize=function(R,A,O){var M;return M=E.clone(O),M.inlineScripts=O.executeJs===!0,p.inlineReferences(R,M).then(function(q){return O.executeJs?I(R,O).then(function(D){return{element:D.document.documentElement,errors:q.concat(D.errors),cleanUp:D.cleanUp}}):{element:R,errors:q,cleanUp:function(){}}}).then(function(q){return L(q.element,A,O).then(function(D){return q.cleanUp(),{image:D.image,svg:D.svg,errors:q.errors}})})},m}(i,c,u,v,h,a),f=function(E,S,w){var _={},y=function(k,L){var I=300,R=200,A=k?k.width:I,O=k?k.height:R,M=L.width!==void 0?L.width:A,q=L.height!==void 0?L.height:O;return{width:M,height:q}},p=function(k){var L=y(k.canvas,k.options),I;return I=E.clone(k.options),I.width=L.width,I.height=L.height,I};_.drawDocument=function(){var k=arguments[0],L=Array.prototype.slice.call(arguments,1),I=E.parseOptionalParameters(L),R=k.documentElement?k.documentElement:k;return w.rasterize(R,I.canvas,p(I))};var m=function(k,L,I){var R=S.parseHTML(k);return _.drawDocument(R,L,I)};_.drawHTML=function(){var k=arguments[0],L=Array.prototype.slice.call(arguments,1),I=E.parseOptionalParameters(L);return m(k,I.canvas,I.options)};var P=function(k,L,I){var R=document.implementation.createHTMLDocument("");R.replaceChild(k.documentElement,R.documentElement);var A=I?E.clone(I):{};return I.baseUrl||(A.baseUrl=L),{document:R,options:A}},T=function(k,L,I){return S.loadDocument(k,I).then(function(R){var A=P(R,k,I);return _.drawDocument(A.document,L,A.options)})};return _.drawURL=function(){var k=arguments[0],L=Array.prototype.slice.call(arguments,1),I=E.parseOptionalParameters(L);return T(k,I.canvas,I.options)},_}(i,c,g);return f})}(b1)),b1.exports}var Ev={},W3;function RC(){return W3||(W3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.optimizeCss=function(t,n){if(!t.includes("@font-face"))return"";const a=new Set,i=new Set;n&&((n.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(v=>{const g=v.split(":")[1].trim();g==="bold"?a.add("700"):g==="normal"?a.add("400"):/^\d+$/.test(g)&&a.add(g)}),(n.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(v=>{v.split(":")[1].trim().toLowerCase()==="italic"&&i.add("italic")}),/<(b|strong)\b/i.test(n)&&a.add("700"),/<(i|em)\b/i.test(n)&&i.add("italic"));const o=(0,r.removeTags)(n);o&&o.trim()&&a.add("400"),a.size===0&&a.add("400");const s=a,u=i.has("italic"),c=Array.from(new Set(o)).map(v=>v.codePointAt(0)).filter(v=>v!==void 0),h=t.split(/}\s*/).map(v=>v&&v+"}").filter(v=>/@font-face/.test(v)&&(g=>{const f=(g.match(/font-weight:\s*(\d+)/)||[])[1];if(f&&!s.has(f)||/font-style:\s*italic/.test(g)&&!u)return!1;const E=g.match(/unicode-range:\s*([^;]+);/);if(!E)return!0;const S=E[1].split(",").map(w=>{const[_,y=_]=w.replace("U+","").split("-").map(p=>parseInt(p,16));return[_,y]});return c.some(w=>S.some(([_,y])=>w>=_&&w<=y))})(v)).join(`
|
|
166
|
+
`);return h?`<style>${h}</style>`:""};const r=r0()}(Ev)),Ev}var Pv={},$3;function Nm(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetStyle=e.resetStyleContent=void 0,e.resetStyleContent=`
|
|
167
|
+
p {
|
|
168
|
+
margin: 0;
|
|
169
|
+
padding: 0;
|
|
170
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
171
|
+
/* a text may have several spaces, we need to preserve them */
|
|
172
|
+
white-space: pre-wrap;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Reset default list styles and setup counters */
|
|
176
|
+
ul, ol {
|
|
177
|
+
list-style: none; /* Remove default markers */
|
|
178
|
+
padding-inline-start: 0; /* Reset padding */
|
|
179
|
+
margin: 0;
|
|
180
|
+
display: block; /* Use block instead of inline-block for better text wrapping */
|
|
181
|
+
width: 100%;
|
|
182
|
+
text-decoration: inherit;
|
|
183
|
+
counter-reset: ol-counter; /* Initialize counter for ol */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
li {
|
|
187
|
+
position: relative; /* Needed for absolute positioning of ::before */
|
|
188
|
+
padding-inline-start: 2.1em; /* Space for the marker (start side) */
|
|
189
|
+
margin: 0; /* Reset default li margins */
|
|
190
|
+
word-wrap: break-word; /* Required for Firefox text wrapping */
|
|
191
|
+
white-space: pre-wrap; /* Preserve spaces and allow wrapping */
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
li::before {
|
|
195
|
+
content: ''; /* Base content */
|
|
196
|
+
position: absolute;
|
|
197
|
+
/* Use logical properties for positioning */
|
|
198
|
+
inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
|
|
199
|
+
top: 0; /* Adjust vertical alignment */
|
|
200
|
+
/* Prevent letter-spacing from affecting the marker */
|
|
201
|
+
letter-spacing: normal;
|
|
202
|
+
/* Define width to ensure consistent spacing and alignment */
|
|
203
|
+
display: inline-block;
|
|
204
|
+
width: 2em; /* Width for the marker container */
|
|
205
|
+
/* Align multi-digit numbers to the end (right in LTR, left in RTL) */
|
|
206
|
+
text-align: end;
|
|
207
|
+
/* Space between marker and text (using logical property) */
|
|
208
|
+
margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
|
|
209
|
+
/* Prevent marker style from inheriting list item styles */
|
|
210
|
+
font-weight: normal;
|
|
211
|
+
font-style: normal;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Style for bullet points */
|
|
215
|
+
ul > li::before {
|
|
216
|
+
content: '•'; /* Literal bullet character */
|
|
217
|
+
/* Center the bullet within its allocated width */
|
|
218
|
+
text-align: center; /* Override text-align: end for bullets */
|
|
219
|
+
font-size: 1.2em;
|
|
220
|
+
top: 0em; /* Re-adjust vertical alignment for bullet */
|
|
221
|
+
/* Bullets don't need number alignment, width can be tighter */
|
|
222
|
+
width: 2em;
|
|
223
|
+
/* Adjust margin to maintain overall padding */
|
|
224
|
+
margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Style for numbers using counter */
|
|
228
|
+
ol > li {
|
|
229
|
+
counter-increment: ol-counter; /* Increment counter for each li in ol */
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
ol > li::before {
|
|
233
|
+
content: counter(ol-counter) "."; /* Display counter value + dot */
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ql-indent-1 {
|
|
237
|
+
margin-inline-start: 0.5em;
|
|
238
|
+
}
|
|
239
|
+
.ql-indent-2 {
|
|
240
|
+
margin-inline-start: 1em;
|
|
241
|
+
}
|
|
242
|
+
.ql-indent-3 {
|
|
243
|
+
margin-inline-start: 1.5em;
|
|
244
|
+
}
|
|
245
|
+
`,e.resetStyle=`
|
|
246
|
+
<style>
|
|
247
|
+
html, body {
|
|
248
|
+
padding: 0;
|
|
249
|
+
margin: 0;
|
|
250
|
+
}
|
|
251
|
+
${e.resetStyleContent}
|
|
252
|
+
</style>
|
|
253
|
+
`}(Pv)),Pv}var Y3;function MC(){return Y3||(Y3=1,function(e){var r,t=ic&&ic.__createBinding||(Object.create?function(y,p,m,P){P===void 0&&(P=m);var T=Object.getOwnPropertyDescriptor(p,m);T&&!("get"in T?!p.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return p[m]}}),Object.defineProperty(y,P,T)}:function(y,p,m,P){P===void 0&&(P=m),y[P]=p[m]}),n=ic&&ic.__setModuleDefault||(Object.create?function(y,p){Object.defineProperty(y,"default",{enumerable:!0,value:p})}:function(y,p){y.default=p}),a=ic&&ic.__importStar||(r=function(y){return r=Object.getOwnPropertyNames||function(p){var m=[];for(var P in p)Object.prototype.hasOwnProperty.call(p,P)&&(m[m.length]=P);return m},r(y)},function(y){if(y&&y.__esModule)return y;var p={};if(y!=null)for(var m=r(y),P=0;P<m.length;P++)m[P]!=="default"&&t(p,y,m[P]);return n(p,y),p});Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=void 0,e.isContentWrapping=function({html:y}){const p=document.createElement("div");p.innerHTML=y,p.style.display="inline-block",p.style.position="fixed",p.style.top="0px",p.style.left="0px",p.style.zIndex="1000",p.style.whiteSpace="nowrap",p.style.visibility="hidden";const m=v();m.appendChild(p);const P=p.textContent,T=p.childNodes[0],k=P?.split(/\s+/)||[];let L=!1;for(let I=0;I<k.length;I++){const R=k[I];if(T&&(T.textContent=R,L=T.scrollWidth>p.clientWidth,L))break}return m.removeChild(p),L},e.detectSize=function(y){const p=document.createElement("div");p.innerHTML=y,p.style.display="inline-block",p.style.position="fixed",p.style.top="0px",p.style.left="0px",p.style.zIndex="1000";const m=v();m.appendChild(p);const P=p.getBoundingClientRect();return m.removeChild(p),{width:P.width,height:P.height}},e.htmlToCanvas=async function({html:y,width:p,height:m,fontFamily:P,padding:T,font:k,pixelRatio:L}){let I="";if(P!=="Arial"&&!k){const te=(0,o.getGoogleFontsVariants)();I=await async function(H,B){const $=`${H}|${B}`;if(_.has($))return _.get($);const V=`https://fonts.googleapis.com/css?family=${H}:${B}&display=swap`,j=await(await fetch(V)).text();return _.set($,j),j}(P,te)}if(k){const te=k.styles||(k.url?[{src:`url("${k.url}")`}]:w(P));I="",te.forEach(H=>{I+=`
|
|
254
|
+
@font-face {
|
|
255
|
+
font-family: '${P}';
|
|
256
|
+
src: ${H.src};
|
|
257
|
+
font-style: ${H.fontStyle||"normal"};
|
|
258
|
+
font-weight: ${H.fontWeight||"normal"};
|
|
259
|
+
}
|
|
260
|
+
`})}let R="";I&&(R=(0,u.optimizeCss)(I,y)),y+=R+c.resetStyle;const A=p+2*T,O=m+2*T,M=document.createElement("canvas"),q=await i.drawHTML(`<div style="padding: ${T}px;" dir="auto">${y}</div>`,M,{width:A,height:O,cacheBucket:E});(0,s.trySetCanvasSize)(M,A*L,O*L);const D=M.getContext("2d");return D?.drawImage(q.image,0,0,A,O,0,0,M.width,M.height),M};const i=a(TC()),o=Ih(),s=W8(),u=RC(),c=Nm();let h;const v=()=>(h||(h=document.createElement("div"),h.id="polotno-hidden-do-not-touch",h.style.overflow="hidden",h.style.position="relative",document.body.appendChild(h),h.innerHTML=`<style>#polotno-hidden-do-not-touch {${c.resetStyleContent}}</style>`),h),g=new Map,f=navigator.userAgent.includes("Firefox");e.prerenderFont=async y=>{if(g.has(y))return g.get(y);const p=(async()=>{const m=`<div style="font-family: ${y}; font-size: 100px;">${y}<strong>${y}</strong></div>`,P=document.createElement("div");P.innerHTML=m,P.style.visibility="hidden",P.style.position="absolute";const T=v();T.appendChild(P);const k=f?180:50;await new Promise(L=>setTimeout(L,k)),T.removeChild(P)})();return g.set(y,p),p};const E={},S={},w=y=>{if(S[y])return S[y];const p=function(P){const T=[];for(let k=0;k<document.styleSheets.length;k++){const L=document.styleSheets[k];try{const I=L.cssRules;if(I)for(let R=0;R<I.length;R++){const A=I[R];A instanceof CSSFontFaceRule&&A.style.fontFamily.replace(/['"]/g,"")===P&&T.push(A)}}catch(I){console.warn(`Could not access stylesheet: ${L.href}`,I)}}return T}(y),m=p.filter(P=>P.style.fontFamily.replace(/['"]/g,"")===y).map(P=>({src:P.style.getPropertyValue("src"),fontStyle:P.style.getPropertyValue("font-style")||"normal",fontWeight:P.style.getPropertyValue("font-weight")||"normal"}));return S[y]=m,m},_=new Map}(ic)),ic}var nh={},Ov={},X3;function i_(){return X3||(X3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=h,e.setup=function(w,_,y,p){i.p=_,v=w,g=y,f=p},e.styled=function(w,_){let y=this||{};return function(){let p=arguments;function m(P,T){let k=Object.assign({},P),L=k.className||m.className;y.p=Object.assign({theme:g&&g()},k),y.o=/ *go\d+/.test(L),k.className=h.apply(y,p)+(L?" "+L:""),_&&(k.ref=T);let I=w;return w[0]&&(I=k.as||w,delete k.as),f&&I[0]&&f(k),v(I,k)}return _?_(m):m}};let r={data:""},t=w=>typeof window=="object"?((w?w.querySelector("#_goober"):window._goober)||Object.assign((w||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:w||r,n=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,i=(w,_)=>{let y="",p="",m="";for(let P in w){let T=w[P];P[0]=="@"?P[1]=="i"?y=P+" "+T+";":p+=P[1]=="f"?i(T,P):P+"{"+i(T,P[1]=="k"?"":_)+"}":typeof T=="object"?p+=i(T,_?_.replace(/([^,])+/g,k=>P.replace(/(^:.*)|([^,])+/g,L=>/&/.test(L)?L.replace(/&/g,k):k?k+" "+L:L)):P):T!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),m+=i.p?i.p(P,T):P+":"+T+";")}return y+(_&&m?_+"{"+m+"}":m)+p},o={},s=w=>{if(typeof w=="object"){let _="";for(let y in w)_+=y+s(w[y]);return _}return w},u=(w,_,y,p,m)=>{let P=s(w),T=o[P]||(o[P]=(k=>{let L=0,I=11;for(;L<k.length;)I=101*I+k.charCodeAt(L++)>>>0;return"go"+I})(P));if(!o[T]){let k=P!==w?w:(L=>{let I,R=[{}];for(;I=n.exec(L.replace(a,""));)I[4]?R.shift():I[3]?R.unshift(R[0][I[3]]=R[0][I[3]]||{}):R[0][I[1]]=I[2];return R[0]})(w);o[T]=i(m?{["@keyframes "+T]:k}:k,y?"":"."+T)}return((k,L,I)=>{L.data.indexOf(k)==-1&&(L.data=I?k+L.data:L.data+k)})(o[T],_,p),T},c=(w,_,y)=>w.reduce((p,m,P)=>{let T=_[P];if(T&&T.call){let k=T(y),L=k&&k.props&&k.props.className||/^go/.test(k)&&k;T=L?"."+L:k&&typeof k=="object"?k.props?"":i(k,""):k===!1?"":k}return p+m+(T??"")},"");function h(w){let _=this||{},y=w.call?w(_.p):w;return u(y.unshift?y.raw?c(y,[].slice.call(arguments,1),_.p):y.reduce((p,m)=>Object.assign(p,m&&m.call?m(_.p):m),{}):y,t(_.target),_.g,_.o,_.k)}e.extractCss=w=>{let _=t(w),y=_.data;return _.data="",y};let v,g,f,E=h.bind({g:1}),S=h.bind({k:1});e.glob=E,e.keyframes=S}(Ov)),Ov}var K3;function IC(){if(K3)return nh;K3=1;var e=nh&&nh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nh,"__esModule",{value:!0});const r=e(ai()),t=i_();return(0,t.setup)(r.default.createElement),nh.default=t.styled,nh}var Z3;function jC(){return Z3||(Z3=1,function(e){var r,t=Dl&&Dl.__createBinding||(Object.create?function(B,$,V,j){j===void 0&&(j=V);var z=Object.getOwnPropertyDescriptor($,V);z&&!("get"in z?!$.__esModule:z.writable||z.configurable)||(z={enumerable:!0,get:function(){return $[V]}}),Object.defineProperty(B,j,z)}:function(B,$,V,j){j===void 0&&(j=V),B[j]=$[V]}),n=Dl&&Dl.__setModuleDefault||(Object.create?function(B,$){Object.defineProperty(B,"default",{enumerable:!0,value:$})}:function(B,$){B.default=$}),a=Dl&&Dl.__importStar||(r=function(B){return r=Object.getOwnPropertyNames||function($){var V=[];for(var j in $)Object.prototype.hasOwnProperty.call($,j)&&(V[V.length]=j);return V},r(B)},function(B){if(B&&B.__esModule)return B;var $={};if(B!=null)for(var V=r(B),j=0;j<V.length;j++)V[j]!=="default"&&t($,B,V[j]);return n($,B),$}),i=Dl&&Dl.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0,e.setCursorFromCoords=H;const o=i(ai()),s=Us,u=Fu,c=i(qA()),h=a(vs),v=gc(),g=Ap(),f=V8(),E=Op(),S=MC(),w=Nm(),_=If(),y=Mh,p=i(IC()),m=jf(),P=r0(),T=a(Ih()),k=rf(),L=H8(),I=vs,R=$8();e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const A=(0,p.default)("div",o.default.forwardRef)`
|
|
261
|
+
.ql-editor {
|
|
262
|
+
outline: none;
|
|
263
|
+
}
|
|
264
|
+
.ql-clipboard {
|
|
265
|
+
pointer-events: none;
|
|
266
|
+
}
|
|
267
|
+
${w.resetStyleContent}
|
|
268
|
+
strong {
|
|
269
|
+
font-weight: 700;
|
|
270
|
+
}
|
|
271
|
+
.ql-direction-rtl {
|
|
272
|
+
direction: rtl;
|
|
273
|
+
}
|
|
274
|
+
`;let O=["bold","color","font","italic","size","strike","underline","indent","list","direction"];e.setQuillFormats=B=>{O=B},e.createQuill=B=>new c.default(B,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:O}),e.setQuillContent=(B,$)=>{var V=B.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+$+"<p><br></p></div>");B.setContents(V),B.history.clear()};const M=({html:B,onBlur:$,onChange:V,element:j,clickCoords:z})=>{const F=o.default.useRef(null);o.default.useEffect(()=>{if(!F.current)return;const J=(0,e.createQuill)(F.current);return h.runInAction(()=>{e.quillRef.editor.instance=J}),window.__polotnoQuill=J,J.on("text-change",()=>{J.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=J.getFormat()}),setTimeout(()=>{var X;const Q=(X=F.current)===null||X===void 0?void 0:X.childNodes[0];V(Q.innerHTML)},10)}),(0,e.setQuillContent)(J,B),z?H(J,z):J.setSelection(0,0,"api"),J.on("selection-change",(X,Q,ae)=>{X&&h.runInAction(()=>{e.quillRef.currentFormat=J.getFormat()})}),F.current.childNodes[0].addEventListener("blur",X=>{var Q;if(!((Q=X.relatedTarget)===null||Q===void 0)&&Q.classList.contains("ql-clipboard"))return;(function(se){return!!se&&!!se.closest(".sketch-picker")})(X.relatedTarget)||$()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),o.default.useEffect(()=>(0,I.reaction)(()=>j.text,()=>{var J;const X=e.quillRef.editor.instance;if(!X)return;const Q=X.getSelection();((J=F.current)===null||J===void 0?void 0:J.childNodes[0].innerHTML)===j.text||((0,e.setQuillContent)(X,B),Q&&(X.setSelection(Q.index,Q.length),h.runInAction(()=>{e.quillRef.currentFormat=X.getFormat()})))},{fireImmediately:!0}),[]),o.default.useEffect(()=>{window.addEventListener("blur",$);const J=X=>{var Q;!((Q=F.current)===null||Q===void 0)&&Q.contains(X.target)||$()};return window.addEventListener("touchstart",J),()=>{window.removeEventListener("blur",$),window.removeEventListener("touchstart",J)}},[]);const Y={color:j.fill};return j.fill.indexOf("gradient")>=0&&(Y.backgroundColor=j.fill,Y.backgroundImage=j.fill,Y.backgroundSize="100% 100%",Y.backgroundRepeat="repeat",Y.webkitBackgroundClip="text",Y.MozBackgroundClip="text",Y.WebkitTextFillColor="transparent",Y.MozTextFillColor="transparent"),o.default.createElement(A,{ref:F,style:Object.assign(Object.assign({},Y),{fontSize:j.fontSize,fontWeight:j.fontWeight,textTransform:j.textTransform,width:j.a.width,fontFamily:'"'+j.fontFamily+'"',lineHeight:j.lineHeight,letterSpacing:j.letterSpacing*j.fontSize+"px",textAlign:j.align,opacity:Math.max(j.a.opacity,.2)}),dir:(0,f.getDir)((0,P.removeTags)(j.text))})};function q(B){return!function($){const V=$.getContext("2d").getImageData(0,0,$.width,$.height).data;for(let j=0;j<V.length;j+=4)if(V[j+3]!==0)return!0;return!1}(B)}function D(B,{fontFamily:$="",color:V="black"}={}){let j=`color: ${V||B.fill}`;return B.fill.indexOf("gradient")>=0&&(j=`
|
|
275
|
+
background-color: ${V};
|
|
276
|
+
background-image: ${B.fill};
|
|
277
|
+
background-size: 100% 100%;
|
|
278
|
+
background-repeat: repeat;
|
|
279
|
+
-webkit-background-clip: text;
|
|
280
|
+
-moz-background-clip: text;
|
|
281
|
+
-webkit-text-fill-color: transparent;
|
|
282
|
+
-moz-text-fill-color: transparent;
|
|
283
|
+
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(B.width||100)}px`,j,`font-size: ${B.fontSize}px`,`font-family: '${$}'`,`text-align: ${B.align}`,`text-transform: ${B.textTransform}`,B.textDecoration?`text-decoration: ${B.textDecoration}; text-decoration-color: ${V||B.fill}; text-decoration-layer: over`:"",B.lineHeight?`line-height: ${B.lineHeight}`:"",B.letterSpacing?`letter-spacing: ${B.letterSpacing*B.fontSize}px`:"",B.fontStyle?`font-style: ${B.fontStyle}`:"",B.fontWeight?`font-weight: ${B.fontWeight}`:"",B.strokeWidth?`-webkit-text-stroke: ${B.strokeWidth}px ${B.stroke}`:"",B.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,f.getDir)((0,P.removeTags)(B.text))}">${(0,P.sanitizeHtml)(B.text).replace(/\n/g,"</br>")}</div>`}const te=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function H(B,$){if(!B||!$)return;const{x:V,y:j}=$;try{let z=null;if(document.caretRangeFromPoint)z=document.caretRangeFromPoint(V,j);else if(document.caretPositionFromPoint){const F=document.caretPositionFromPoint(V,j);F&&(z=document.createRange(),z.setStart(F.offsetNode,F.offset))}if(z){const F=c.default.find(z.startContainer,!0);if(F){const Y=F.offset(B.scroll)+z.startOffset;return void B.setSelection(Y,0,"api")}}}catch{}B.setSelection(0,0,"api")}e.HTMLElement=(0,s.observer)(({element:B,store:$})=>{const V=o.default.useRef(null),[j,z]=o.default.useState(),[F,Y]=o.default.useState(!1),[J,X]=o.default.useState(!1),Q=o.default.useRef(B.height),ae=$.selectedShapes.indexOf(B)>=0&&B.selectable,se=B.fontSize/3,{textVerticalResizeEnabled:fe}=v.flags,be=(0,f.usePrevious)(B.fontFamily),[_e]=(0,f.useFontLoader)($,B.fontFamily),Ae=B._editModeEnabled;(0,_.useFadeIn)(V);const Re=_e?B.fontFamily:be!==B.fontFamily?be:"Arial",Pe=(0,E.useColor)(B).fill,ye=D(B,{fontFamily:Re,color:Pe}),{width:nt,height:Ce}=function(ze,kt,pt){return o.default.useMemo(()=>(0,S.detectSize)(ze),[ze,kt.width,pt])}(ye,B,_e);o.default.useEffect(()=>{if(!_e)return;if(!B.height)return void B.set({height:Ce});const{textOverflow:ze}=v.flags;if(ze!=="change-font-size"||F)ze==="resize"&&(fe&&B.height<Ce&&$.history.ignore(()=>{B.set({height:Ce})}),fe||B.height===Ce||$.history.ignore(()=>{B.set({height:Ce})}));else{const kt=(pt=>{let Ut=pt.fontSize;for(let Ht=1;Ht<50;Ht++){const Me=D(Object.assign(Object.assign({},pt.toJSON()),{fontSize:Ut}),{fontFamily:pt.fontFamily}),{height:Oe}=(0,S.detectSize)(Me),it=pt.height&&Oe>pt.height,Lt=(0,S.isContentWrapping)({html:Me});if(!it&&!Lt)break;Ut-=.5}return Ut})(B);kt!==B.fontSize?$.history.ignore(()=>{B.set({fontSize:kt})}):B.height!==Ce&&(fe&&B.height<Ce?$.history.ignore(()=>{B.set({height:Ce})}):fe||$.history.ignore(()=>{B.set({height:Ce})}))}});const he=o.default.useMemo(()=>{const ze={lastArgs:null,lastResult:null};return async function(kt){return ze.lastArgs&&ze.lastResult&&(pt=ze.lastArgs,Ut=kt,JSON.stringify(pt)===JSON.stringify(Ut))||(ze.lastResult=await(0,S.htmlToCanvas)(kt),ze.lastArgs=Object.assign({},kt)),ze.lastResult;var pt,Ut}},[]),ke=o.default.useRef(0),Te=o.default.useRef(null);o.default.useEffect(()=>{F||Ae||(async()=>{ke.current++;const ze=ke.current;let kt=(0,m.incrementLoader)(`text ${B.id} ${ze}`);Te.current&&Te.current(),Te.current=kt,X(!0);let pt=null;const Ut=te?5:1;for(let Ht=0;Ht<Ut;Ht++){const Me=Ht>0?he:S.htmlToCanvas;try{if(pt=await Me({skipCache:Ht>0,html:ye,width:B.width||1,height:B.height||Ce||1,fontFamily:Re,padding:se,pixelRatio:$._elementsPixelRatio,font:$.fonts.find(Oe=>Oe.fontFamily===Re)||T.globalFonts.find(Oe=>Oe.fontFamily===Re)}),ze!==ke.current)return;if(te&&q(pt)){await new Promise(Oe=>setTimeout(Oe,50*(Ht+1)));continue}break}catch(Oe){console.error(Oe),(0,m.triggerLoadError)(`Error rendering rich text with id ${B.id}`);break}}pt?z(pt):kt?(kt(),kt=null):console.error("Finish function is called twice!"),X(!1)})()},[ye,F,Ce,Ae,Re,B.height,$._elementsPixelRatio,_e]);const[ve,Se]=(0,R.useDelayer)(J,300),[je]=(0,R.useDelayer)(F,300,!0),Ue=je||ve;o.default.useEffect(()=>{if(!Ue)return h.autorun(()=>{const ze=V.current;(0,g.applyFilter)(ze,B)})},[j,Ue,B.shadowColor,B.shadowOffsetX,B.shadowOffsetY,B.shadowOpacity]),o.default.useEffect(()=>{j&&!J&&Te.current&&(Te.current(),Te.current=null)},[j,J]),o.default.useEffect(()=>()=>{Te.current&&Te.current()},[]);let ct=0;B.verticalAlign==="middle"&&(ct=(B.height-Ce)/2),B.verticalAlign==="bottom"&&(ct=B.height-Ce);const mt=(0,f.getLineHeight)({fontLoaded:_e,fontFamily:B.fontFamily,fontSize:B.fontSize,lineHeight:B.lineHeight}),yt=(0,k.isTouchDevice)(),Je=o.default.useRef(null),lt=o.default.useRef(null);return o.default.createElement(o.default.Fragment,null,o.default.createElement(u.Rect,{x:B.a.x,y:B.a.y,offsetX:B.backgroundPadding*(B.fontSize*mt*.5),offsetY:B.backgroundPadding*(B.fontSize*mt*.5),rotation:B.a.rotation,hideInExport:!B.showInExport,listening:!1,visible:B.backgroundEnabled,opacity:B.backgroundOpacity*B.a.opacity,fill:B.backgroundColor,width:B.a.width+B.backgroundPadding*(B.fontSize*mt),height:B.a.height+B.backgroundPadding*(B.fontSize*mt),cornerRadius:B.backgroundCornerRadius*(B.fontSize*mt*.5)}),o.default.createElement(u.Rect,{ref:V,name:"element",x:B.a.x,y:B.a.y,listening:B.selectable,rotation:B.a.rotation,width:B.a.width,height:B.a.height,visible:!Ue,draggable:yt?B.draggable&&ae:B.draggable,preventDefault:!yt||ae,opacity:Ae?0:B.a.opacity,hideInExport:!B.showInExport,onDragMove:ze=>{B.set({x:ze.target.x(),y:ze.target.y()})},onDragEnd:ze=>{B.set({x:ze.target.x(),y:ze.target.y()})},id:B.id,onDblClick:ze=>{B.contentEditable&&(lt.current={x:ze.evt.clientX,y:ze.evt.clientY},B.toggleEditMode(!0))},onDblTap:ze=>{var kt;if(B.contentEditable){const pt=(kt=ze.evt.changedTouches)===null||kt===void 0?void 0:kt[0];lt.current=pt?{x:pt.clientX,y:pt.clientY}:null,B.toggleEditMode(!0)}},onTransformStart:ze=>{Y(!0),Q.current=B.height},onTransform:ze=>{var kt;const pt=ze.target,Ut=((kt=pt.getStage())===null||kt===void 0?void 0:kt.findOne("Transformer")).getActiveAnchor(),Ht=Ut==="middle-left"||Ut==="middle-right",Me=Ut==="top-center"||Ut==="bottom-center",Oe=pt.scaleX();if(Ht){const it=pt.scaleX(),Lt=pt.width()*it,At=B.fontSize;let xt=Lt;if(Lt<At&&(xt=At,Je.current&&pt.position(Je.current)),pt.width(xt),pt.scaleX(1),v.flags.textVerticalResizeEnabled){const Jt=Math.max(Ce,Q.current);B.set({height:Jt})}B.set({width:pt.width(),x:pt.x(),y:pt.y()})}else if(Me){let it=v.flags.textOverflow==="resize"?Ce:B.lineHeight*B.fontSize;const Lt=Math.max(it,ze.target.height()*ze.target.scaleY());pt.scaleY(1),B.set({x:pt.x(),y:pt.y(),height:Lt,rotation:pt.rotation()})}else pt.scaleX(1),pt.scaleY(1),B.set({fontSize:B.fontSize*Oe,letterSpacing:B.letterSpacing,width:pt.width()*Oe,x:pt.x(),y:pt.y(),rotation:pt.rotation(),height:pt.height()*Oe});Je.current=ze.target.position()},onTransformEnd:ze=>{Y(!1),X(!0);const kt=ze.target.scaleX();ze.target.scaleX(1),ze.target.scaleY(1),B.set({fontSize:B.fontSize*kt,width:ze.target.width()*kt,x:ze.target.x(),y:ze.target.y(),rotation:ze.target.rotation(),shadowBlur:B.shadowBlur*kt,shadowOffsetX:B.shadowOffsetX*kt,shadowOffsetY:B.shadowOffsetY*kt,strokeWidth:B.strokeWidth*kt})}}),o.default.createElement(u.Image,{ref:V,image:j,x:B.a.x,y:B.a.y,offsetX:se,offsetY:se-ct,listening:!1,rotation:B.a.rotation,width:B.a.width+2*se,height:(B.a.width+2*se)*(j?.height/j?.width||1),visible:!Ue&&!Ae,opacity:B.a.opacity,shadowEnabled:B.shadowEnabled,shadowBlur:B.shadowBlur,shadowOffsetX:B.shadowOffsetX,shadowOffsetY:B.shadowOffsetY,shadowColor:B.shadowColor,shadowOpacity:B.shadowOpacity,hideInExport:!B.showInExport,editModeEnabled:B._editModeEnabled}),Ue&&o.default.createElement(u.Group,{x:B.a.x,y:B.a.y,rotation:B.a.rotation,offsetY:-ct},o.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(A,{dangerouslySetInnerHTML:{__html:ye},style:{pointerEvents:"none",opacity:B.a.opacity}}))),Ae&&o.default.createElement(u.Group,{x:B.a.x,y:B.a.y,rotation:B.a.rotation,offsetY:-ct},o.default.createElement(y.Html,null,o.default.createElement(M,{html:ye,element:B,onChange:ze=>{const kt=(0,L.getLimitedFontSize)({oldText:(0,P.removeTags)(B.text),newText:(0,P.removeTags)(ze),element:B});B.set({text:ze,fontSize:kt})},onBlur:ze=>{B.toggleEditMode(!1),Se(!0),(0,P.removeTags)(B.text)===""&&B.removable&&!B.placeholder&&$.deleteElements([B.id])},clickCoords:lt.current}))))})}(Dl)),Dl}var Wd={},$d={},Av={},Q3;function Dh(){return Q3||(Q3=1,function(e){function r(o){return o/180*Math.PI}function t(o,s,u,c,h){const v=Math.sqrt(u*u+c*c);return h+=Math.atan2(c,u),{x:o+v*Math.cos(h),y:s+v*Math.sin(h)}}function n(o){const{x:s,y:u,width:c,height:h}=o,v=r(o.rotation),g=t(s,u,0,0,v),f=t(s,u,c,0,v),E=t(s,u,c,h,v),S=t(s,u,0,h,v),w=Math.min(g.x,f.x,E.x,S.x),_=Math.min(g.y,f.y,E.y,S.y),y=Math.max(g.x,f.x,E.x,S.x),p=Math.max(g.y,f.y,E.y,S.y);return{x:w,y:_,width:y-w,height:p-_,minX:w,minY:_,maxX:y,maxY:p}}function a(o){const s=r(o.rotation||0);return{x:o.x+o.width/2*Math.cos(s)+o.height/2*Math.sin(-s),y:o.y+o.height/2*Math.cos(s)+o.width/2*Math.sin(s)}}function i(o,s,u){const c=r(s),h=u.x+(o.x-u.x)*Math.cos(c)-(o.y-u.y)*Math.sin(c),v=u.y+(o.x-u.x)*Math.sin(c)+(o.y-u.y)*Math.cos(c);return Object.assign(Object.assign({},o),{rotation:o.rotation+s,x:h,y:v})}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=r,e.getClientRect=n,e.getTotalClientRect=function(o){const s=o.map(g=>n(g)),u=Math.min(...s.map(g=>g.minX)),c=Math.min(...s.map(g=>g.minY)),h=Math.max(...s.map(g=>g.maxX)),v=Math.max(...s.map(g=>g.maxY));return{x:u,y:c,width:h-u,height:v-c,minX:u,minY:c,maxX:h,maxY:v}},e.getCenter=a,e.rotateAroundPoint=i,e.rotateAroundCenter=function(o,s){return i(o,s,a(o))}}(Av)),Av}var J3;function a_(){return J3||(J3=1,function(e){var r=$d&&$d.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=e.setSnapGuideStyle=void 0,e.useSnap=function(h,v,g){const f=t.default.useRef(null);(0,e.setSnapGuideStyle)(g);const E=m=>m.hasName("element")||m.hasName("page-background")||!f.current&&m.hasName("elements-area");function S(m){var P;const T=(P=h.current)===null||P===void 0?void 0:P.getStage(),k=[],L=[];return T.find(E).forEach(I=>{if(!(m.indexOf(I)>=0)){var R=I.getClientRect({skipShadow:!0,skipStroke:!0});k.push({offset:R.x,node:I,snap:"start"},{offset:R.x+R.width,node:I,snap:"end"},{offset:R.x+R.width/2,node:I,snap:"center"}),L.push({offset:R.y,node:I,snap:"start"},{offset:R.y+R.height,node:I,snap:"end"},{offset:R.y+R.height/2,node:I,snap:"center"})}}),{vertical:k,horizontal:L}}function w(m){var P;const T=(P=h.current)===null||P===void 0?void 0:P.getLayer(),k=T?.children.find(L=>L.name()==="line-guides");m.forEach(L=>{if(L.orientation==="H"){var I=new n.default.Line({x:-T.getStage().x(),y:-T.getStage().y(),points:[-6e3,L.lineGuide,6e3,L.lineGuide],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash});k?.add(I),T.batchDraw()}else L.orientation==="V"&&(I=new n.default.Line({x:-T.getStage().x(),y:-T.getStage().y(),points:[L.lineGuide,-6e3,L.lineGuide,6e3],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash}),k?.add(I))})}const _=m=>{const P=m.target.getLayer().children.find(M=>M.name()==="line-guides");P?.destroyChildren();var T=S(m.target.nodes()),k=function(M){const q=M.__getNodeRect(),D=(0,a.getClientRect)(Object.assign(Object.assign({},q),{rotation:n.default.Util.radToDeg(q.rotation)})),te=M.getAbsolutePosition();return{vertical:[{guide:D.x,offset:te.x-D.x,snap:"start",nodes:M.nodes()},{guide:D.x+D.width/2,offset:te.x-D.x-D.width/2,snap:"center",nodes:M.nodes()},{guide:D.x+D.width,offset:te.x-D.x-D.width,snap:"end",nodes:M.nodes()}],horizontal:[{guide:D.y,offset:te.y-D.y,snap:"start",nodes:M.nodes()},{guide:D.y+D.height/2,offset:te.y-D.y-D.height/2,snap:"center",nodes:M.nodes()},{guide:D.y+D.height,offset:te.y-D.y-D.height,snap:"end",nodes:M.nodes()}]}}(m.target),L=s(T,k);if(!L.length)return;w(L);const I=m.target.getAbsolutePosition(),R=(m.target.nodes().map(M=>M.getAbsolutePosition()),Object.assign({},I));L.forEach(M=>{switch(M.snap){case"start":case"center":case"end":switch(M.orientation){case"V":R.x=M.lineGuide+M.offset;break;case"H":R.y=M.lineGuide+M.offset}}});const A=R.x-I.x,O=R.y-I.y;m.evt.ctrlKey||m.evt.metaKey||m.target.nodes().forEach(M=>{const q=M.getAbsolutePosition();M.setAbsolutePosition({x:q.x+A,y:q.y+O})})},y=(m,P,T)=>{var k;const L=h.current,I=L.getLayer().children.find(B=>B.name()==="line-guides");if(I?.destroyChildren(),L.getActiveAnchor()==="rotater")return P;const R=L.getActiveAnchor(),A=c[R],O=(k=L.findOne(`.${A}`))===null||k===void 0?void 0:k.getAbsolutePosition();if(!O)return P;const M={x:m.x-O.x,y:m.y-O.y},q=function(B,$){const V=u(B,$)/u($,$);return{x:V*$.x,y:V*$.y}}({x:P.x-m.x,y:P.y-m.y},M),D={x:m.x+q.x,y:m.y+q.y};var te=s(S(L.nodes()),{vertical:[{guide:D.x,offset:0,snap:"start",nodes:L.nodes()}],horizontal:[{guide:D.y,offset:0,snap:"start",nodes:L.nodes()}]});if(!te.length||(w(te),T.ctrlKey||T.metaKey))return P;const H=[];if(te.forEach(B=>{const $=function(V,j,z){if(z.orientation==="V"){const F=z.lineGuide;if(Math.abs(j.x-V.x)<1e-4)return null;const Y=(j.y-V.y)/(j.x-V.x);return{x:F,y:Y*F+(V.y-Y*V.x)}}{const F=z.lineGuide;if(Math.abs(j.y-V.y)<1e-4)return null;const Y=(j.y-V.y)/(j.x-V.x);return{x:(F-V.y)/Y+V.x,y:F}}}(D,O,{orientation:B.orientation,lineGuide:B.lineGuide});$&&H.push($)}),H.length>0){let B=H[0],$=Math.sqrt(Math.pow(D.x-B.x,2)+Math.pow(D.y-B.y,2));if(H.forEach(V=>{const j=Math.sqrt(Math.pow(D.x-V.x,2)+Math.pow(D.y-V.y,2));j<$&&($=j,B=V)}),$<10)return B}return D},p=m=>{if(!m.target)return;const P=m.target.getLayer(),T=P.children.find(k=>k.name()==="line-guides");T?.destroyChildren(),P.batchDraw()};t.default.useEffect(()=>{h.current&&(h.current.anchorDragBoundFunc(y),h.current.on("dragstart",m=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const P=[...n.default.DD._dragElements.entries()],T=P.find(([k,L])=>L.node instanceof n.default.Transformer);T&&(P.splice(P.indexOf(T),1),P.unshift(T),n.default.DD._dragElements.clear(),P.forEach(([k,L])=>{n.default.DD._dragElements.set(k,L)}))})}),h.current.on("dragmove",_),h.current.on("dragend",p),h.current.on("transformend",p),h.current.on("transform",m=>{var P,T;m.evt.ctrlKey||m.evt.metaKey?(P=h.current)===null||P===void 0||P.rotationSnapTolerance(0):(T=h.current)===null||T===void 0||T.rotationSnapTolerance(5)}))},[])},e.useAnchorSnap=function(h,v,g){const f=w=>w.hasName("element")||w.hasName("line-anchor")||w.hasName("page-background")||w.hasName("elements-area"),E=w=>{const _=w.target.getLayer().children.find(L=>L.name()==="line-guides");_?.destroyChildren();var y,p=s(function(L){var I;const R=(I=h.current)===null||I===void 0?void 0:I.getStage();var A=[],O=[];return R.find(f).forEach(M=>{if(!(L.indexOf(M)>=0)){var q=M.getClientRect({skipShadow:!0,skipStroke:!0});M.hasName("line-anchor")&&(q={x:M.absolutePosition().x,y:M.absolutePosition().y,width:0,height:0}),A.push({offset:q.x,node:M,snap:"start"},{offset:q.x+q.width,node:M,snap:"end"},{offset:q.x+q.width/2,node:M,snap:"center"}),O.push({offset:q.y,node:M,snap:"start"},{offset:q.y+q.height,node:M,snap:"end"},{offset:q.y+q.height/2,node:M,snap:"center"})}}),{vertical:A,horizontal:O}}([w.target,...v.map(L=>L.current)]),{vertical:[{guide:(y=w.target).absolutePosition().x,offset:0,snap:"center",nodes:[y]}],horizontal:[{guide:y.absolutePosition().y,offset:0,snap:"center",nodes:[y]}]});if(!p.length)return;(function(L){var I;const R=(I=h.current)===null||I===void 0?void 0:I.getLayer(),A=R?.children.find(O=>O.name()==="line-guides");L.forEach(O=>{if(O.orientation==="H"){var M=new n.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash});A?.add(M),R.batchDraw()}else O.orientation==="V"&&(M=new n.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash}),A?.add(M))})})(p);const m=w.target.getAbsolutePosition(),P=Object.assign({},m);p.forEach(L=>{switch(L.snap){case"start":case"center":case"end":switch(L.orientation){case"V":P.x=L.lineGuide+L.offset;break;case"H":P.y=L.lineGuide+L.offset}}});const T=P.x-m.x,k=P.y-m.y;if(!w.evt.ctrlKey&&!w.evt.metaKey){const L=w.target.getAbsolutePosition();w.target.absolutePosition({x:L.x+T,y:L.y+k})}},S=w=>{if(!w.target)return;const _=w.target.getLayer(),y=_.children.find(p=>p.name()==="line-guides");y?.destroyChildren(),_.batchDraw()};t.default.useEffect(()=>{h.current&&(h.current.on("dragmove",E),h.current.on("dragend",S))},g)};const t=r(ai()),n=r(Hs()),a=Dh(),i={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]};e.setSnapGuideStyle=({stroke:h,strokeWidth:v,dash:g})=>{h!==void 0&&(i.stroke=h),v!==void 0&&(i.strokeWidth=v),g!==void 0&&(i.dash=g)};let o=({targetKonvaNodes:h,guideKonvaNode:v,distance:g,snapDirection:f})=>g<5;function s(h,v){var g=[],f=[];h.vertical.forEach(p=>{v.vertical.forEach(m=>{var P=Math.abs(p.offset-m.guide);o({targetKonvaNodes:m.nodes,guideKonvaNode:p.node,distance:P,snapDirection:p.snap})&&g.push({lineGuide:p.offset,diff:P,snap:m.snap,offset:m.offset})})}),h.horizontal.forEach(p=>{v.horizontal.forEach(m=>{var P=Math.abs(p.offset-m.guide);o({targetKonvaNodes:m.nodes,guideKonvaNode:p.node,distance:P,snapDirection:p.snap})&&f.push({lineGuide:p.offset,diff:P,snap:m.snap,offset:m.offset})})});var E=[];const S=g.sort((p,m)=>p.diff-m.diff),w=f.sort((p,m)=>p.diff-m.diff);var _=S[0],y=w[0];return _&&S.filter(p=>Math.abs(p.diff-_.diff)<.1).forEach(p=>{E.push(Object.assign({orientation:"V"},p))}),y&&w.filter(p=>Math.abs(p.diff-y.diff)<.1).forEach(p=>{E.push(Object.assign({orientation:"H"},p))}),E}function u(h,v){return h.x*v.x+h.y*v.y}e.setSnapFilterFunc=h=>{o=h};const c={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"}}($d)),$d}var e4;function FC(){return e4||(e4=1,function(e){var r=Wd&&Wd.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=c,e.getLinePositionFromMiddlePoints=h;const t=r(ai()),n=Us,a=Fu,i=Op(),o=Mh,s=a_(),u=rf();function c(f){const{x:E,y:S,width:w,height:_,rotation:y}=f.a,p=y*Math.PI/180,m={x:E+_/2*Math.cos(p+Math.PI/2),y:S+_/2*Math.sin(p+Math.PI/2)};return{middleLeft:m,middleRight:{x:m.x+w*Math.cos(p),y:m.y+w*Math.sin(p)}}}function h(f,E,S){const w=Math.sqrt(Math.pow(E.x-f.x,2)+Math.pow(E.y-f.y,2)),_=Math.atan2(E.y-f.y,E.x-f.x),y=180*_/Math.PI;return{x:f.x+Math.cos(_-Math.PI/2)*S/2,y:f.y+Math.sin(_-Math.PI/2)*S/2,width:w,height:S,rotation:y}}const v=(f,E)=>({offsetX:5/f,offsetY:5/f,width:10/f,height:10/f,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:S=>{S.target.getStage().container().style.cursor="crosshair"},onMouseLeave:S=>{S.target.getStage().container().style.cursor=""},onDragStart:S=>{E.history.startTransaction()},onDragEnd:S=>{E.history.endTransaction()}}),g=(0,n.observer)(({element:f,type:E})=>{const S=(0,i.useColor)(f,f.a.color,"fill"),w=(0,i.useColor)(f,f.a.color,"stroke"),_=Object.assign(Object.assign(Object.assign({strokeWidth:f.height,lineCap:"round",lineJoin:"round"},w),S),{opacity:f.a.opacity,hideInExport:!f.showInExport});return t.default.createElement(t.default.Fragment,null,E==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height]},_)),E==="triangle"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height],closed:!0},_)),E==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,0,2*f.height],closed:!0},_)),E==="square"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,4*f.height,2*-f.height,4*f.height,2*f.height,0,2*f.height],closed:!0},_)),E==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*f.height,y:0,radius:2*f.height},_)))});e.LineElement=(0,n.observer)(({element:f,store:E})=>{const S=t.default.useRef(null),w=t.default.useRef(null),_=t.default.useRef(null),y=f.selectable||E.role==="admin",p=(0,u.isTouchDevice)(),m=E.selectedElements.indexOf(f)>=0&&E.selectedElements.length===1,P=E.selectedShapes.indexOf(f)>=0&&f.selectable,{middleLeft:T,middleRight:k}=c(f);(0,s.useAnchorSnap)(w,[S],[m]),(0,s.useAnchorSnap)(_,[S],[m]);const L=(0,i.useColor)(f,f.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:S,name:"element",id:f.id,x:f.a.x,y:f.a.y,points:[0,0,f.a.width,0],offsetY:-f.a.height/2,strokeWidth:f.a.height,hitStrokeWidth:Math.max(f.a.height,20),dash:f.dash.map(I=>I*f.a.height)},L,{rotation:f.a.rotation,opacity:f.animated("opacity"),shadowEnabled:f.shadowEnabled,shadowBlur:f.shadowBlur,shadowOffsetX:f.shadowOffsetX,shadowOffsetY:f.shadowOffsetY,shadowColor:f.shadowColor,shadowOpacity:f.shadowOpacity,listening:y,draggable:p?f.draggable&&P:f.draggable,preventDefault:!p||P,hideInExport:!f.showInExport,onDragMove:I=>{f.set({x:I.target.x(),y:I.target.y()})},onDragEnd:I=>{f.set({x:I.target.x(),y:I.target.y()})},onTransform:I=>{const R=I.target.scaleX();I.target.scaleX(1),I.target.scaleY(1),f.set({height:f.height*R,width:f.width*R,x:I.target.x(),y:I.target.y(),rotation:I.target.rotation()})}})),t.default.createElement(a.Group,{x:T.x,y:T.y,rotation:f.rotation,hideInExport:!f.showInExport},t.default.createElement(g,{element:f,type:f.startHead})),t.default.createElement(a.Group,{x:k.x,y:k.y,rotation:f.rotation+180},t.default.createElement(g,{element:f,type:f.endHead})),m&&f.resizable&&t.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(a.Group,{visible:m},t.default.createElement(a.Rect,Object.assign({x:T.x,y:T.y,ref:w,name:"line-anchor"},v(E.scale,E),{onDragMove:I=>{const R=h(I.target.position(),k,f.height);f.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:k.x,y:k.y,ref:_,name:"line-anchor"},v(E.scale,E),{onDragMove:I=>{const R=h(T,I.target.position(),f.height);f.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})))))})}(Wd)),Wd}var Bl={},t4;function o_(){return t4||(t4=1,function(e){var r,t=Bl&&Bl.__createBinding||(Object.create?function(A,O,M,q){q===void 0&&(q=M);var D=Object.getOwnPropertyDescriptor(O,M);D&&!("get"in D?!O.__esModule:D.writable||D.configurable)||(D={enumerable:!0,get:function(){return O[M]}}),Object.defineProperty(A,q,D)}:function(A,O,M,q){q===void 0&&(q=M),A[q]=O[M]}),n=Bl&&Bl.__setModuleDefault||(Object.create?function(A,O){Object.defineProperty(A,"default",{enumerable:!0,value:O})}:function(A,O){A.default=O}),a=Bl&&Bl.__importStar||(r=function(A){return r=Object.getOwnPropertyNames||function(O){var M=[];for(var q in O)Object.prototype.hasOwnProperty.call(O,q)&&(M[M.length]=q);return M},r(A)},function(A){if(A&&A.__esModule)return A;var O={};if(A!=null)for(var M=r(A),q=0;q<M.length;q++)M[q]!=="default"&&t(O,A,M[q]);return n(O,A),O}),i=Bl&&Bl.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=e.useCornerRadiusAndCrop=void 0;const o=i(ai()),s=Us,u=vs,c=Fu,h=i(t0()),v=i(Hs()),g=Mh,f=jf(),E=a(kp()),S=gc(),w=Ap(),_=If(),y=rf();function p(){return document.createElement("canvas")}const m=new window.Image;m.src=E.svgToURL(`
|
|
284
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
285
|
+
<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"/>
|
|
286
|
+
<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"/>
|
|
287
|
+
</svg>
|
|
288
|
+
`);const P=new window.Image;P.src=E.svgToURL(`
|
|
289
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
290
|
+
<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"/>
|
|
291
|
+
<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"/>
|
|
292
|
+
<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"/>
|
|
293
|
+
<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"/>
|
|
294
|
+
</svg>
|
|
295
|
+
`),e.useCornerRadiusAndCrop=(A,O,M,q,D=0,te=!1)=>{const H=Math.floor(Math.max(A.width*q,1)),B=Math.floor(Math.max(A.height*q,1)),$=Math.min(D*q,H/2,B/2),V=Math.max(A.width/M.width,A.height/M.height)*q,j=A.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&V<1&&!te,z=M.x===0&&M.y===0&&M.width===O?.width&&M.height===O?.height,F=o.default.useMemo(()=>{if(O&&O.width&&O.height)return z&&$===0&&!j?void 0:p()},[O,$,j,z]),Y=()=>{if(!F||!O)return;F.width=H,F.height=B;const J=F.getContext("2d");if(!J)return;$&&(J.beginPath(),J.moveTo($,0),J.lineTo(H-$,0),J.arc(H-$,$,$,3*Math.PI/2,0,!1),J.lineTo(H,B-$),J.arc(H-$,B-$,$,0,Math.PI/2,!1),J.lineTo($,B),J.arc($,B-$,$,Math.PI/2,Math.PI,!1),J.lineTo(0,$),J.arc($,$,$,Math.PI,3*Math.PI/2,!1),J.clip());const X=j?function(ae,se){var fe,be;const _e=p();_e.width=ae.width,_e.height=ae.height,(fe=_e.getContext("2d"))===null||fe===void 0||fe.drawImage(ae,0,0,_e.width,_e.height);const Ae=function(Re,Pe,ye,nt,Ce,he,ke){for(var Te=new ImageData(Pe,ye),ve=new Int32Array(Re.data.buffer),Se=Re.width,je=new Int32Array(Te.data.buffer),Ue=Te.width,ct=Pe/he,mt=ye/ke,yt=Math.round(1/ct),Je=Math.round(1/mt),lt=yt*Je,ze=0;ze<Te.height;ze++)for(var kt=0;kt<Ue;kt++){for(var pt=0+Math.round(kt/ct)+(0+Math.round(ze/mt))*Se,Ut=0,Ht=0,Me=0,Oe=0,it=0;it<Je;it++)for(var Lt=0;Lt<yt;Lt++){var At=ve[pt+Lt+it*Se];Ut+=At<<24>>>24,Ht+=At<<16>>>24,Me+=At<<8>>>24,Oe+=At>>>24}Ut=Math.round(Ut/lt),Ht=Math.round(Ht/lt),Me=Math.round(Me/lt),Oe=Math.round(Oe/lt),je[kt+ze*Ue]=Oe<<24|Me<<16|Ht<<8|Ut}return Te}(_e.getContext("2d").getImageData(0,0,_e.width,_e.height),Math.floor(_e.width*se),Math.floor(_e.height*se),0,0,_e.width,_e.height);return _e.width=Math.floor(_e.width*se),_e.height=Math.floor(_e.height*se),(be=_e.getContext("2d"))===null||be===void 0||be.putImageData(Ae,0,0),_e}(O,V):O,Q=j?{x:Math.floor(M.x*V),y:Math.floor(M.y*V),width:Math.floor(M.width*V),height:Math.floor(M.height*V)}:M;J.drawImage(X,Q.x,Q.y,Q.width,Q.height,0,0,F.width,F.height)};return o.default.useLayoutEffect(()=>{Y()},[F,A.width,A.height,M.x,M.y,M.width,M.height,D,q,te,A.page._exportingOrRendering,j]),o.default.useEffect(()=>()=>{F&&F.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(F)},[F]),[F||O,Y]};const T=p(),k=(0,s.observer)(({element:A})=>{const O=Math.min(30,A.width/4,A.height/4),M=o.default.useRef(null);return o.default.useEffect(()=>{const q=M.current;if(!q)return;const D=new v.default.Animation(te=>{q.rotate((te?.timeDiff||0)/2)},q.getLayer());return D.start(),()=>{D.stop()}}),o.default.createElement(c.Group,{x:A.a.x,y:A.a.y,rotation:A.a.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},o.default.createElement(c.Rect,{width:A.width,height:A.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(c.Arc,{ref:M,x:A.width/2,y:A.height/2,fill:"white",outerRadius:Math.abs(O),innerRadius:Math.max(1,O-5),angle:270}))}),L=(0,s.observer)(({element:A})=>{const O=Math.max(10,Math.min(30,A.width/25));return o.default.createElement(c.Group,{x:A.a.x,y:A.a.y,rotation:A.a.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},o.default.createElement(c.Rect,{width:A.width,height:A.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(c.Text,{text:"Can not load the video...",fontSize:O,width:A.width,height:A.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let I=function(A,O,M){const q=o.default.useRef("loading"),D=o.default.useRef(null),[te,H]=o.default.useState(0),B=o.default.useRef(),$=o.default.useRef(),V=o.default.useRef();return B.current===A&&$.current===O&&V.current===M||(q.current="loading",D.current=void 0,B.current=A,$.current=O,V.current=M),o.default.useLayoutEffect(function(){if(A){var j=document.createElement("video");return j.addEventListener("canplay",z),j.addEventListener("error",F),O&&(j.crossOrigin=O),M&&(j.referrerpolicy=M),j.src=A,j.load(),function(){j.removeEventListener("canplay",z),j.removeEventListener("error",F)}}function z(){q.current="loaded",D.current=j,D.current.currentTime=0,H(Math.random()),D.current.removeEventListener("canplay",z)}function F(Y){var J;const X=j.readyState===4,Q=j.buffered&&j.buffered.length>0&&j.buffered.end(j.buffered.length-1)/j.duration*100>=100;if(X&&Q)return;const ae=Y.message||((J=j.error)===null||J===void 0?void 0:J.message)||"Unknown error",se=new Error("Video failed to load: "+ae);console.error(se),q.current="failed",D.current=void 0,H(Math.random())}},[A,O,M]),[D.current,q.current]};function R(A){return A.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}e.setVideoLoaderHook=A=>{I=A},e.useLoader=(A,O,M)=>{const q=o.default.useRef(),D=()=>{var te;(te=q.current)===null||te===void 0||te.call(q),q.current=void 0};o.default.useEffect(()=>D,[]),o.default.useLayoutEffect(()=>{const te=O.slice(0,200),H=`video with id ${M} url: ${te}`;A!=="loading"||q.current||(q.current=(0,f.incrementLoader)(H)),A!=="loading"&&D(),A==="failed"&&(0,f.triggerLoadError)(H)},[A])},e.VideoElement=(0,s.observer)(({element:A,store:O})=>{var M;const[q,D]=o.default.useState(!1),te=o.default.useRef(null),H=o.default.useRef(null),B=O.selectedShapes.indexOf(A)>=0&&A.selectable,[$,V]=o.default.useState(!1),[j,z]=I(A.src,"anonymous"),F=O.activePage===A.page;(0,e.useLoader)(z,A.src,A.id),j&&(j.width=j.videoWidth,j.height=j.videoHeight,j.playsInline=!0);const Y=j||T;o.default.useEffect(()=>{j&&O.history.ignore(()=>{A.set({duration:1e3*j.duration})})},[j]),o.default.useEffect(()=>{var Oe;if(!j)return;const it=O.animatedElementsIds,Lt=(!it.length||it.includes(A.id))&&O.isPlaying,At=F&&(Lt||$);if(!At)return void j.pause();At&&(j.currentTime=A.startTime*j.duration,j.play());const xt=new v.default.Animation(()=>{Se()},(Oe=te.current)===null||Oe===void 0?void 0:Oe.getLayer());xt.start();const Jt=()=>{V(!1),j.currentTime=A.startTime*j.duration},nr=()=>{j.currentTime>=A.endTime*j.duration&&(j.pause(),j.currentTime=A.startTime*j.duration,V(!1))};return j.addEventListener("ended",Jt),j.addEventListener("timeupdate",nr),()=>{j.pause(),xt.stop(),j.removeEventListener("ended",Jt),j.removeEventListener("timeupdate",nr)}},[j,$,O.isPlaying,F]),o.default.useEffect(()=>{j&&(j.volume=A.volume)},[j,A.volume]);const J=o.default.useRef();o.default.useEffect(()=>{const Oe=(0,u.autorun)(()=>{var it,Lt;if(j){const At=O.animatedElementsIds;if(At.length&&!At.includes(A.id))return;const xt=A.startTime*j.duration*1e3,Jt=j.duration*(A.endTime-A.startTime)*1e3,nr=((O.currentTime||A.page.startTime)-A.page.startTime)%Jt+xt;if(Math.abs(1e3*j.currentTime-nr)>500||!O.isPlaying){const Rt=nr/1e3;Rt!==j.currentTime&&(j.currentTime=Rt),!R(j)&&!O.isPlaying&&!J.current&&(J.current=(0,f.incrementLoader)(`video ${A.id}`))}Se(),(Lt=(it=te.current)===null||it===void 0?void 0:it.getLayer())===null||Lt===void 0||Lt.batchDraw()}});return()=>{Oe(),J.current&&(J.current(),J.current=null)}},[O,j]),o.default.useEffect(()=>{if(!j)return;const Oe=()=>{var Lt,At;!R(j)&&A.page._exportingOrRendering||J.current&&(Se(),(At=(Lt=te.current)===null||Lt===void 0?void 0:Lt.getLayer())===null||At===void 0||At.batchDraw(),J.current(),J.current=null)};let it;return A.page._exportingOrRendering&&(it=setInterval(Oe,50)),j.addEventListener("timeupdate",Oe),j.addEventListener("canplay",Oe),()=>{clearInterval(it),j.removeEventListener("timeupdate",Oe),j.removeEventListener("canplay",Oe)}},[A.page._exportingOrRendering,j,A.id,f.incrementLoader]);let{cropX:X,cropY:Q,cropWidth:ae,cropHeight:se}=A;z!=="loaded"&&(X=Q=0,ae=se=1);const fe=Y.width*ae,be=Y.height*se,_e=A.width/A.height;let Ae,Re;const Pe=fe/be,ye=A.type==="svg";ye?(Ae=fe,Re=be):_e>=Pe?(Ae=fe,Re=fe/_e):(Ae=be*_e,Re=be);const nt={x:Y.width*X,y:Y.height*Q,width:Ae,height:Re},Ce=(M=A.cornerRadius)!==null&&M!==void 0?M:0,[he,ke]=(0,e.useCornerRadiusAndCrop)(A,Y,nt,O._elementsPixelRatio,Ce,q||A._cropModeEnabled||A.type==="svg");let[Te,ve]=((Oe,it,Lt,At)=>{const xt=(Ze=>{const[bt,Vt]=o.default.useState(Ze);return o.default.useEffect(()=>{(async()=>{const wt=await async function(Kt){if(!(Kt.indexOf("data:image/svg+xml")>=0||Kt.indexOf(".svg")>=0))return Kt;const Yt=await E.urlToString(Kt),ut=E.fixSize(Yt);return E.svgToURL(ut)}(Ze);wt!==bt&&Vt(wt)})()},[Ze]),bt})(Oe.clipSrc||""),[Jt,nr]=(0,h.default)(xt,"anonymous"),Rt=Oe.clipSrc?nr:"loaded";(0,e.useLoader)(Rt,Oe.clipSrc,Oe.id);const Xt=o.default.useMemo(()=>{if(it&&Jt)return p()},[it,Jt]);function Rr(){var Ze;if(!Jt||!it||!it.width||!it.height||!Jt||!Jt.width||!Jt.height||!Xt)return;const bt=p(),Vt=Math.max(Oe.width/Jt.width*Lt,Oe.height/Jt.height*Lt);bt.width=Jt.width*Vt,bt.height=Jt.height*Vt,(Ze=bt.getContext("2d"))===null||Ze===void 0||Ze.drawImage(Jt,0,0,bt.width,bt.height),Xt.width=Math.max(it.width,1),Xt.height=Math.max(it.height,1);const wt=Xt.getContext("2d");wt&&(wt.save(),wt.drawImage(bt,0,0,it.width,it.height),v.default.Util.releaseCanvas(bt),wt.globalCompositeOperation="source-in",wt.drawImage(it,0,0,Xt.width,Xt.height),wt.restore())}return o.default.useLayoutEffect(()=>{Rr()},[Xt,it,Jt,Oe.width,Oe.height,Lt,...At]),[Oe.clipSrc&&Jt?Xt:it,Rr]})(A,he,O._elementsPixelRatio,[nt,Ce,O._elementsPixelRatio]);function Se(){ke(),ve()}const je=Math.max(A.width/Ae,A.height/Re);o.default.useEffect(()=>{var Oe;if(!A._cropModeEnabled)return;const it=(Oe=te.current)===null||Oe===void 0?void 0:Oe.getStage();function Lt(xt){A._cropModeEnabled&&xt.target!==H.current&&A.toggleCropMode(!1)}function At(xt){A._cropModeEnabled&&xt.target.parentNode!==it.content&&A.toggleCropMode(!1)}return document.body.addEventListener("click",At),it?.on("click",Lt),it?.on("tap",Lt),()=>{document.body.removeEventListener("click",At),document.body.removeEventListener("touchstart",At),it?.off("click",Lt),it?.off("click",Lt)}},[A._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!q&&!A._cropModeEnabled)return(0,w.applyFilter)(te.current,A),(0,u.autorun)(()=>{(0,w.applyFilter)(te.current,A)},{delay:100})},[Y,q,ae,se,A._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Oe;q||A._cropModeEnabled?(Oe=te.current)===null||Oe===void 0||Oe.clearCache():(0,w.applyFilter)(te.current,A)},[q,A.width,A.height,A._cropModeEnabled]),o.default.useEffect(()=>{(0,w.applyFilter)(te.current,A)},[A.shadowEnabled,A.shadowBlur,A.cornerRadius,A.shadowColor,A.shadowOffsetX,A.shadowOffsetY,A.shadowOpacity]);const Ue=o.default.useRef(null),ct=o.default.useRef(null),mt=o.default.useRef(null);o.default.useLayoutEffect(()=>{A._cropModeEnabled&&(ct.current.nodes([Ue.current]),mt.current.nodes([H.current]))},[A._cropModeEnabled]);const yt=Oe=>{Math.round(Oe.target.x())>0&&(Oe.target.x(0),Oe.target.scaleX(1)),Math.round(Oe.target.y())>0&&(Oe.target.y(0),Oe.target.scaleY(1));const it=Oe.target.width()*Oe.target.scaleX(),Lt=Oe.target.height()*Oe.target.scaleY(),At=Math.min(1,Ae/it),xt=Math.min(1,Re/Lt),Jt=1-At,nr=Math.min(Jt,Math.max(0,Math.round(-Oe.target.x())/it)),Rt=1-xt,Xt=Math.min(Rt,Math.max(0,Math.round(-Oe.target.y())/Lt));Oe.target.setAttrs({x:-nr*Y.width,y:-Xt*Y.height,scaleX:1,scaleY:1}),A.set({cropX:nr,cropY:Xt,cropWidth:At,cropHeight:xt})},Je=()=>{A.type!=="svg"&&A.contentEditable&&setTimeout(()=>{A.toggleCropMode(!0)})},lt=z==="loading",ze=z==="failed",kt=!lt&&!ze,pt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ut=kt?A.a.opacity:0;(0,_.useFadeIn)(te,Ut);const Ht=A.selectable||O.role==="admin",Me=(0,y.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,lt&&o.default.createElement(k,{element:A}),ze&&o.default.createElement(L,{element:A}),o.default.createElement(c.Image,{ref:te,name:"element",id:A.id,image:Te,x:A.a.x,y:A.a.y,width:A.a.width||1,height:A.a.height||1,rotation:A.a.rotation,opacity:Ut,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,customCrop:nt,listening:Ht,draggable:Me?A.draggable&&B:A.draggable,preventDefault:!Me||B,hideInExport:!A.showInExport,onDragMove:Oe=>{A.set({x:Oe.target.x(),y:Oe.target.y()})},onDragEnd:Oe=>{A.set({x:Oe.target.x(),y:Oe.target.y()})},onDblClick:Je,onDblTap:Je,onTransformStart:()=>{D(!0),pt.current={cropX:A.cropX,cropY:A.cropY,cropWidth:A.cropWidth,cropHeight:A.cropHeight}},onTransform:Oe=>{var it;const Lt=Oe.currentTarget,At=Math.abs(Lt.scaleX()-1)<1e-7?1:Lt.scaleX(),xt=Math.abs(Lt.scaleY()-1)<1e-7?1:Lt.scaleY();Lt.scaleX(1),Lt.scaleY(1);const Jt=(it=Oe.target.getStage())===null||it===void 0?void 0:it.findOne("Transformer"),nr=1-Ae/Y.width,Rt=Math.min(nr,Math.max(0,A.cropX)),Xt=1-Re/Y.height,Rr=Math.min(Xt,Math.max(0,A.cropY)),Ze=Jt.getActiveAnchor(),bt=!(Ze.indexOf("middle")>=0||Ze.indexOf("center")>=0),Vt=!bt&&At<1&&pt.current.cropHeight>Re/Y.height;let wt=bt?A.cropWidth:A.cropWidth*At;Vt&&(wt=A.cropWidth);const Kt=!bt&&xt<1&&pt.current.cropWidth>Ae/Y.width;let Yt=bt?A.cropHeight:A.cropHeight*xt;Kt&&(Yt=A.cropHeight),ye&&(wt=A.cropWidth,Yt=A.cropHeight),A.set({cropX:Rt,cropY:Rr,x:Lt.x(),y:Lt.y(),width:Lt.width()*At,height:Lt.height()*xt,rotation:Oe.target.rotation(),cropWidth:Math.min(wt,1-Rt),cropHeight:Math.min(Yt,1-Rr)})},onTransformEnd:Oe=>{const it=Oe.currentTarget;A.set({width:it.width(),height:it.height(),x:it.x(),y:it.y(),rotation:Oe.target.rotation(),cropWidth:Ae/Y.width,cropHeight:Re/Y.height}),D(!1)}}),o.default.createElement(c.Rect,{x:A.a.x,y:A.a.y,width:Math.max(A.a.width-A.borderSize,0),height:Math.max(A.a.height-A.borderSize,0),opacity:Ut,offsetX:-A.borderSize/2,offsetY:-A.borderSize/2,stroke:A.borderColor,strokeWidth:A.borderSize,listening:!1,visible:!!A.borderSize,rotation:A.rotation,cornerRadius:Math.max(0,Ce-A.borderSize),hideInExport:!A.showInExport}),!O.isPlaying&&o.default.createElement(c.Image,{image:$?P:m,x:A.a.x,y:A.a.y,offsetX:-A.a.width/2+15/O.scale,offsetY:-A.a.height/2+15/O.scale,rotation:A.a.rotation,width:30/O.scale,height:30/O.scale,hideInExport:!0,onClick:()=>V(!$),onTap:()=>V(!$)}),A._cropModeEnabled&&o.default.createElement(g.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/O.scale,y:-window.innerWidth/O.scale,width:window.innerWidth/O.scale*3,height:window.innerWidth/O.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:Te,x:A.a.x,y:A.a.y,width:A.a.width,height:A.a.height,rotation:A.a.rotation,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur}),o.default.createElement(c.Group,{x:A.a.x,y:A.a.y,rotation:A.a.rotation,scaleX:je,scaleY:je},o.default.createElement(c.Image,{image:Y,ref:H,opacity:.4,draggable:!0,x:-A.cropX*Y.width,y:-A.cropY*Y.height,onDragMove:yt,onTransform:yt}),o.default.createElement(c.Transformer,{ref:mt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,it)=>it.width<5||it.height<5?Oe:it,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(c.Rect,{width:Ae,height:Re,ref:Ue,listening:!1,onTransform:Oe=>{Oe.target.x()<-A.cropX*Y.width-1e-9&&(Oe.target.x(-A.cropX*Y.width),Oe.target.scaleX(1)),Oe.target.y()<-A.cropY*Y.height-1e-9&&(Oe.target.y(-A.cropY*Y.height),Oe.target.scaleY(1));const it=Math.min(1,Math.max(0,A.cropX+Oe.target.x()/Y.width)),Lt=Math.min(1,Math.max(0,Oe.target.y()/Y.height+A.cropY)),At=Oe.target.width()*Oe.target.scaleX(),xt=Oe.target.height()*Oe.target.scaleY(),Jt=Math.min(1-it,At/Y.width),nr=Math.min(1-Lt,xt/Y.height),Rt=Oe.target.getAbsolutePosition(Oe.target.getParent().getParent());Oe.target.scale({x:1,y:1}),Oe.target.position({x:0,y:0}),A.set({x:Rt.x,y:Rt.y,cropX:it,cropY:Lt,cropWidth:Jt,cropHeight:nr,width:Math.min(At*je,Y.width*(1-it)*je),height:Math.min(xt*je,Y.height*(1-Lt)*je)})}}),o.default.createElement(c.Transformer,{ref:ct,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,it)=>it.width<5||it.height<5?Oe:it,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:A.resizable}))))})}(Bl)),Bl}var Yd={},Cv={},r4;function Tm(){return r4||(r4=1,function(e){function r({width:c,height:h}){const v=c/2,g=h/2,f=c/2,E=h/2,S=f/2,w=E/2;let _="",y=Math.PI/5;for(let p=0;p<10;p++){const m=p%2==0?E:w,P=v+(p%2==0?f:S)*Math.sin(p*y),T=g-m*Math.cos(p*y);p===0?_=`M ${P} ${T}`:_+=` L ${P} ${T}`}return _+" Z"}function t({width:c,height:h}){const v=c/2,g=h/2;return`M ${v} 0 L ${c} ${g} L ${v} ${h} L 0 ${g} Z`}function n({width:c,height:h}){const v=c/2,g=h/2,f=c/2,E=h/2;let S="",w=2*Math.PI/5;for(let _=0;_<5;_++){const y=E,p=v+f*Math.sin(_*w),m=g-y*Math.cos(_*w);_===0?S=`M ${p} ${m}`:S+=` L ${p} ${m}`}return S+" Z"}function a({width:c,height:h}){const v=c/2,g=h/2,f=c/2,E=h/2;let S="",w=2*Math.PI/6;for(let _=0;_<6;_++){const y=E,p=v+f*Math.sin(_*w),m=g-y*Math.cos(_*w);_===0?S=`M ${p} ${m}`:S+=` L ${p} ${m}`}return S+" Z"}function i({path:c,aspectRatio:h,width:v,height:g}){return{path:c,scaleX:v/h.width,scaleY:g/h.height}}function o({width:c,height:h}){const v=.1*Math.min(c,h),g=.2*c,f=.2*h,E=.5*c;let S=`M ${v},0`;return S+=" H "+(c-v),S+=` A ${v},${v} 0 0 1 ${c},${v}`,S+=" V "+(h-v-f),S+=` A ${v},${v} 0 0 1 ${c-v},${h-f}`,S+=` H ${E+g/2}`,S+=` L ${E},${h}`,S+=` L ${E-g/2},${h-f}`,S+=` H ${v}`,S+=` A ${v},${v} 0 0 1 0,${h-v-f}`,S+=` V ${v}`,S+=` A ${v},${v} 0 0 1 ${v},0`,S+=" Z",S}function s({width:c,height:h}){const v=.3*c,g=.3*h,f=c/2,E=h/2,S=f-v/2,w=f+v/2,_=E-g/2,y=E+g/2;let p=`M ${S},0 `;return p+=`H ${w} `,p+=`V ${_} `,p+=`H ${c} `,p+=`V ${y} `,p+=`H ${w} `,p+=`V ${h} `,p+=`H ${S} `,p+=`V ${y} `,p+="H 0 ",p+=`V ${_} `,p+=`H ${S} `,p+="V 0 ",p+="Z",p}function u(c){return e.TYPES[c]||e.rectData}Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=r,e.diamondPath=t,e.pentagonPath=n,e.hexagonPath=a,e.speechBubblePath=o,e.crossPath=s,e.subTypeToPathDataFunc=u,e.figureToSvg=function(c){const{subType:h}=c,v=u(h);return v?function(g,f){const{width:E,height:S,fill:w,stroke:_,strokeWidth:y,dash:p}=g,m=(p||[]).map(I=>I*y);let P=f(g),T=1,k=1;typeof P!="string"&&(T=P.scaleX,k=P.scaleY,P=P.path);const L=`clip-${g.id||Math.random()}`;return`
|
|
296
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${E}" height="${S}">
|
|
297
|
+
<defs>
|
|
298
|
+
<clipPath id="${L}">
|
|
299
|
+
<path d="${P}" />
|
|
300
|
+
</clipPath>
|
|
301
|
+
</defs>
|
|
302
|
+
|
|
303
|
+
<!-- Path for the fill -->
|
|
304
|
+
<path d="${P}" fill="${w}" transform="scale(${T}, ${k})"/>
|
|
305
|
+
|
|
306
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
307
|
+
<path d="${P}" fill="none" stroke="${_}" stroke-width="${2*y}" clip-path="url(#${L})" transform="scale(${T}, ${k})" stroke-dasharray="${m.join(" ")}"/>
|
|
308
|
+
</svg>
|
|
309
|
+
`}(c,v):(console.error(`Polotno error: Can not convert ${c.subType} figure to svg.`),(0,e.rectData)(c))},e.rectData=({width:c,height:h,cornerRadius:v})=>{if(v>0){const g=Math.min(v,c/2,h/2);return`M 0 ${g} A ${g} ${g} 0 0 1 ${g} 0 L ${c-g} 0 A ${g} ${g} 0 0 1 ${c} ${g} L ${c} ${h-g} A ${g} ${g} 0 0 1 ${c-g} ${h} L ${g} ${h} A ${g} ${g} 0 0 1 0 ${h-g} Z`}return`M 0 0 L ${c} 0 L ${c} ${h} L 0 ${h} Z`},e.triangleData=({width:c,height:h})=>`M ${c/2} 0 L ${c} ${h} L 0 ${h} Z`,e.rightTriangleData=({width:c,height:h})=>`M 0 0 L ${c} 0 L 0 ${h} Z`,e.circleData=({width:c,height:h})=>`M ${c/2} ${h/2} m -${c/2}, 0 a ${c/2},${h/2} 0 1,0 ${c},0 a ${c/2},${h/2} 0 1,0 -${c},0`,e.TYPES={rect:e.rectData,circle:e.circleData,star:r,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:t,pentagon:n,hexagon:a,speechBubble:o,cross:s,arc:({width:c,height:h})=>i({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:c,height:h}),cloud:({width:c,height:h})=>i({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:c,height:h}),rightArrow:({width:c,height:h})=>{const v=.6*c;return`M 0 ${h/4} L ${v} ${h/4} L ${v} 0 L ${c} ${h/2} L ${v} ${h} L ${v} ${.75*h} L 0 ${.75*h} Z`},leftArrow:({width:c,height:h})=>{const v=.4*c;return`M ${c} ${h/4} L ${v} ${h/4} L ${v} 0 L 0 ${h/2} L ${v} ${h} L ${v} ${.75*h} L ${c} ${.75*h} Z`},downArrow:({width:c,height:h})=>{const v=.6*h;return`M ${c/4} 0 L ${c/4} ${v} L 0 ${v} L ${c/2} ${h} L ${c} ${v} L ${.75*c} ${v} L ${.75*c} 0 Z`},upArrow:({width:c,height:h})=>{const v=.4*h;return`M ${c/4} ${h} L ${c/4} ${v} L 0 ${v} L ${c/2} 0 L ${c} ${v} L ${.75*c} ${v} L ${.75*c} ${h} Z`},asterisk1:({width:c,height:h})=>i({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:c,height:h}),asterisk2:({width:c,height:h})=>i({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:c,height:h}),bookmark:({width:c,height:h})=>i({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:c,height:h}),butterfly:({width:c,height:h})=>i({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:c,height:h}),cylinder:({width:c,height:h})=>i({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:c,height:h}),diamond2:({width:c,height:h})=>i({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:c,height:h}),door:({width:c,height:h})=>i({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:c,height:h}),drop1:({width:c,height:h})=>i({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:c,height:h}),drop2:({width:c,height:h})=>i({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:c,height:h}),explosion:({width:c,height:h})=>i({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:c,height:h}),flag:({width:c,height:h})=>i({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:c,height:h}),flower:({width:c,height:h})=>i({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:c,height:h}),frame:({width:c,height:h})=>i({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:c,height:h}),heart1:({width:c,height:h})=>i({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:c,height:h}),home:({width:c,height:h})=>i({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:c,height:h}),home2:({width:c,height:h})=>i({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:c,height:h}),hourglass:({width:c,height:h})=>i({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:c,height:h}),house:({width:c,height:h})=>i({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:c,height:h}),keyhole:({width:c,height:h})=>i({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:c,height:h}),kiss:({width:c,height:h})=>i({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:c,height:h}),leaf:({width:c,height:h})=>i({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:c,height:h}),lightning1:({width:c,height:h})=>i({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:c,height:h}),lightning2:({width:c,height:h})=>i({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:c,height:h}),magnet:({width:c,height:h})=>i({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:c,height:h}),mithosis:({width:c,height:h})=>i({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:c,height:h}),orangeRicky:({width:c,height:h})=>i({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:c,height:h}),party:({width:c,height:h})=>i({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:c,height:h}),pillow:({width:c,height:h})=>i({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:c,height:h}),polygon:({width:c,height:h})=>i({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:c,height:h}),rainbow:({width:c,height:h})=>i({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:c,height:h}),rhodeIsland:({width:c,height:h})=>i({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:c,height:h}),shell:({width:c,height:h})=>i({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:c,height:h}),shield1:({width:c,height:h})=>i({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:c,height:h}),shield2:({width:c,height:h})=>i({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:c,height:h}),skewedRectangle:({width:c,height:h})=>i({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:c,height:h}),softFlower:({width:c,height:h})=>i({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:c,height:h}),softStar:({width:c,height:h})=>i({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:c,height:h}),stairs1:({width:c,height:h})=>i({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:c,height:h}),stairs2:({width:c,height:h})=>i({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:c,height:h}),teewee:({width:c,height:h})=>i({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:c,height:h}),blob1:({width:c,height:h})=>i({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:c,height:h}),blob10:({width:c,height:h})=>i({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:c,height:h}),blob11:({width:c,height:h})=>i({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:c,height:h}),blob12:({width:c,height:h})=>i({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:c,height:h}),blob13:({width:c,height:h})=>i({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:c,height:h}),blob14:({width:c,height:h})=>i({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:c,height:h}),blob15:({width:c,height:h})=>i({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:c,height:h}),blob16:({width:c,height:h})=>i({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:c,height:h}),blob17:({width:c,height:h})=>i({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:c,height:h}),blob18:({width:c,height:h})=>i({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:c,height:h}),blob19:({width:c,height:h})=>i({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:c,height:h}),blob2:({width:c,height:h})=>i({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:c,height:h}),blob20:({width:c,height:h})=>i({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:c,height:h}),blob21:({width:c,height:h})=>i({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:c,height:h}),blob22:({width:c,height:h})=>i({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:c,height:h}),blob23:({width:c,height:h})=>i({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:c,height:h}),blob24:({width:c,height:h})=>i({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:c,height:h}),blob25:({width:c,height:h})=>i({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:c,height:h}),blob26:({width:c,height:h})=>i({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:c,height:h}),blob27:({width:c,height:h})=>i({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:c,height:h}),blob28:({width:c,height:h})=>i({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:c,height:h}),blob29:({width:c,height:h})=>i({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:c,height:h}),blob3:({width:c,height:h})=>i({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:c,height:h}),blob30:({width:c,height:h})=>i({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:c,height:h}),blob31:({width:c,height:h})=>i({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:c,height:h}),blob32:({width:c,height:h})=>i({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:c,height:h}),blob4:({width:c,height:h})=>i({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:c,height:h}),blob5:({width:c,height:h})=>i({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:c,height:h}),blob6:({width:c,height:h})=>i({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:c,height:h}),blob7:({width:c,height:h})=>i({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:c,height:h}),blob8:({width:c,height:h})=>i({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:c,height:h}),blob9:({width:c,height:h})=>i({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:c,height:h})}}(Cv)),Cv}var n4;function DC(){return n4||(n4=1,function(e){var r=Yd&&Yd.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=r(ai()),n=Us,a=Fu,i=Tm(),o=rf(),s=Op(),u={};e.FigureElement=(0,n.observer)(({element:c,store:h})=>{const v=c.selectable||h.role==="admin",g=(0,o.isTouchDevice)(),f=h.selectedShapes.indexOf(c)>=0&&c.selectable,E=Math.min(c.strokeWidth,c.width/2,c.height/2),S=Math.max(0,Math.min(c.width/2,c.height/2,c.cornerRadius)),w=(0,s.useColor)(c,c.a.fill,"fill"),_=Object.assign(Object.assign({width:c.a.width,height:c.a.height},w),{cornerRadius:S,opacity:c.animated("opacity"),shadowEnabled:c.shadowEnabled,shadowBlur:c.shadowBlur,shadowOffsetX:c.shadowOffsetX,shadowOffsetY:c.shadowOffsetY,shadowColor:c.shadowColor,shadowOpacity:c.shadowOpacity,preventDefault:!g||f,hideInExport:!c.showInExport}),y=(0,s.useColor)(c,c.stroke,"stroke"),p=Object.assign(Object.assign({visible:E>0,x:E/2,y:E/2,width:c.a.width-E,height:c.a.height-E},y),{strokeWidth:E,cornerRadius:Math.max(0,S-E),dash:c.dash.map(k=>k*E),opacity:c.animated("opacity"),hideInExport:!c.showInExport,listening:!1}),m=(P=c.subType,u[P]||(u[P]=(T=(0,i.subTypeToPathDataFunc)(P),(0,n.observer)(({element:k,fillProps:L,strokeProps:I})=>{let R=T({width:k.a.width,height:k.a.height,cornerRadius:k.cornerRadius}),A=1,O=1;typeof R!="string"&&(A=R.scaleX,O=R.scaleY,R=R.path);const M=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:k.width,height:k.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},L,{ref:M,data:R,scaleX:A,scaleY:O})),t.default.createElement(a.Group,{clipFunc:q=>{const D=M.current;if(D){var te=D.dataArray;q.beginPath();for(var H=0;H<te.length;H++){var B=te[H].command,$=te[H].points;switch(B){case"L":q.lineTo($[0],$[1]);break;case"M":q.moveTo($[0],$[1]);break;case"C":q.bezierCurveTo($[0],$[1],$[2],$[3],$[4],$[5]);break;case"Q":q.quadraticCurveTo($[0],$[1],$[2],$[3]);break;case"A":var V=$[0],j=$[1],z=$[2],F=$[3],Y=$[4],J=$[5],X=$[6],Q=$[7],ae=z>F?z:F,se=z>F?1:z/F,fe=z>F?F/z:1;q.translate(V,j),q.rotate(X),q.scale(se,fe),q.arc(0,0,ae,Y,Y+J,1-Q),q.scale(1/se,1/fe),q.rotate(-X),q.translate(-V,-j);break;case"z":q.closePath()}}}},scaleX:A,scaleY:O},t.default.createElement(a.Path,Object.assign({},I,{x:0,y:0,data:R,strokeWidth:2*I.strokeWidth,dash:I.dash.map(q=>q)}))))}))),u[P]||a.Group);var P,T;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:c.id,x:c.a.x,y:c.a.y,rotation:c.a.rotation,opacity:c.a.opacity,listening:v,draggable:g?c.draggable&&f:c.draggable,name:"element",onDragMove:k=>{c.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{c.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const L=k.target.scale();k.target.scaleX(1),k.target.scaleY(1),c.set({width:c.width*L.x,height:c.height*L.y,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}},t.default.createElement(m,{element:c,fillProps:_,strokeProps:p})))})}(Yd)),Yd}var Xd={},ac={},kv={},oc={},i4;function s_(){if(i4)return oc;i4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.loop=oc.conditional=oc.parse=void 0;var e=function n(a,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(i))i.forEach(function(c){return n(a,c,o,s)});else if(typeof i=="function")i(a,o,s,n);else{var u=Object.keys(i)[0];Array.isArray(i[u])?(s[u]={},n(a,i[u],o,s[u])):s[u]=i[u](a,o,s,n)}return o};oc.parse=e;var r=function(a,i){return function(o,s,u,c){i(o,s,u)&&c(o,a,s,u)}};oc.conditional=r;var t=function(a,i){return function(o,s,u,c){for(var h=[],v=o.pos;i(o,s,u);){var g={};if(c(o,a,s,g),o.pos===v)break;v=o.pos,h.push(g)}return h}};return oc.loop=t,oc}var Xi={},a4;function l_(){if(a4)return Xi;a4=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.readBits=Xi.readArray=Xi.readUnsigned=Xi.readString=Xi.peekBytes=Xi.readBytes=Xi.peekByte=Xi.readByte=Xi.buildStream=void 0;var e=function(v){return{data:v,pos:0}};Xi.buildStream=e;var r=function(){return function(v){return v.data[v.pos++]}};Xi.readByte=r;var t=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+v]}};Xi.peekByte=t;var n=function(v){return function(g){return g.data.subarray(g.pos,g.pos+=v)}};Xi.readBytes=n;var a=function(v){return function(g){return g.data.subarray(g.pos,g.pos+v)}};Xi.peekBytes=a;var i=function(v){return function(g){return Array.from(n(v)(g)).map(function(f){return String.fromCharCode(f)}).join("")}};Xi.readString=i;var o=function(v){return function(g){var f=n(2)(g);return v?(f[1]<<8)+f[0]:(f[0]<<8)+f[1]}};Xi.readUnsigned=o;var s=function(v,g){return function(f,E,S){for(var w=typeof g=="function"?g(f,E,S):g,_=n(v),y=new Array(w),p=0;p<w;p++)y[p]=_(f);return y}};Xi.readArray=s;var u=function(v,g,f){for(var E=0,S=0;S<f;S++)E+=v[g+S]&&Math.pow(2,f-S-1);return E},c=function(v){return function(g){for(var f=r()(g),E=new Array(8),S=0;S<8;S++)E[7-S]=!!(f&1<<S);return Object.keys(v).reduce(function(w,_){var y=v[_];return y.length?w[_]=u(E,y.index,y.length):w[_]=E[y.index],w},{})}};return Xi.readBits=c,Xi}var o4;function BC(){return o4||(o4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s_(),t=l_(),n={blocks:function(g){for(var f=0,E=[],S=g.data.length,w=0,_=(0,t.readByte)()(g);_!==f&&_;_=(0,t.readByte)()(g)){if(g.pos+_>=S){var y=S-g.pos;E.push((0,t.readBytes)(y)(g)),w+=y;break}E.push((0,t.readBytes)(_)(g)),w+=_}for(var p=new Uint8Array(w),m=0,P=0;P<E.length;P++)p.set(E[P],m),m+=E[P].length;return p}},a=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(v){var g=(0,t.peekBytes)(2)(v);return g[0]===33&&g[1]===249}),i=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,function(v,g,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(v,g,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(v){return(0,t.peekByte)()(v)===44}),o=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(g,f,E){return(0,t.readBytes)(E.text.blockSize)(g)}},n]},function(v){var g=(0,t.peekBytes)(2)(v);return g[0]===33&&g[1]===1}),s=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(g,f,E){return(0,t.readString)(E.blockSize)(g)}},n]},function(v){var g=(0,t.peekBytes)(2)(v);return g[0]===33&&g[1]===255}),u=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(v){var g=(0,t.peekBytes)(2)(v);return g[0]===33&&g[1]===254}),c=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,function(v,g){return Math.pow(2,g.lsd.gct.size+1)})},function(v,g){return g.lsd.gct.exists}),{frames:(0,r.loop)([a,s,u,i,o],function(v){var g=(0,t.peekByte)()(v);return g===33||g===44})}],h=c;e.default=h}(kv)),kv}var Kd={},s4;function qC(){if(s4)return Kd;s4=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.deinterlace=void 0;var e=function(t,n){for(var a=new Array(t.length),i=t.length/n,o=function(f,E){var S=t.slice(E*n,(E+1)*n);a.splice.apply(a,[f*n,n].concat(S))},s=[0,4,2,1],u=[8,8,4,2],c=0,h=0;h<4;h++)for(var v=s[h];v<i;v+=u[h])o(v,c),c++;return a};return Kd.deinterlace=e,Kd}var Zd={},l4;function zC(){if(l4)return Zd;l4=1,Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.lzw=void 0;var e=function(t,n,a){var i=4096,o=-1,s=a,u,c,h,v,g,f,E,k,S,w,T,_,L,I,A,R,y=new Array(a),p=new Array(i),m=new Array(i),P=new Array(i+1);for(_=t,c=1<<_,g=c+1,u=c+2,E=o,v=_+1,h=(1<<v)-1,S=0;S<c;S++)p[S]=0,m[S]=S;var T,k,L,I,R,A;for(T=k=L=I=R=A=0,w=0;w<s;){if(I===0){if(k<v){T+=n[A]<<k,k+=8,A++;continue}if(S=T&h,T>>=v,k-=v,S>u||S==g)break;if(S==c){v=_+1,h=(1<<v)-1,u=c+2,E=o;continue}if(E==o){P[I++]=m[S],E=S,L=S;continue}for(f=S,S==u&&(P[I++]=L,S=E);S>c;)P[I++]=m[S],S=p[S];L=m[S]&255,P[I++]=L,u<i&&(p[u]=E,m[u]=L,u++,(u&h)===0&&u<i&&(v++,h+=u)),E=f}I--,y[R++]=P[I],w++}for(w=R;w<s;w++)y[w]=0;return y};return Zd.lzw=e,Zd}var u4;function UC(){if(u4)return ac;u4=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.decompressFrames=ac.decompressFrame=ac.parseGIF=void 0;var e=i(BC()),r=s_(),t=l_(),n=qC(),a=zC();function i(h){return h&&h.__esModule?h:{default:h}}var o=function(v){var g=new Uint8Array(v);return(0,r.parse)((0,t.buildStream)(g),e.default)};ac.parseGIF=o;var s=function(v){for(var g=v.pixels.length,f=new Uint8ClampedArray(g*4),E=0;E<g;E++){var S=E*4,w=v.pixels[E],_=v.colorTable[w]||[0,0,0];f[S]=_[0],f[S+1]=_[1],f[S+2]=_[2],f[S+3]=w!==v.transparentIndex?255:0}return f},u=function(v,g,f){if(!v.image){console.warn("gif frame does not have associated image.");return}var E=v.image,S=E.descriptor.width*E.descriptor.height,w=(0,a.lzw)(E.data.minCodeSize,E.data.blocks,S);E.descriptor.lct.interlaced&&(w=(0,n.deinterlace)(w,E.descriptor.width));var _={pixels:w,dims:{top:v.image.descriptor.top,left:v.image.descriptor.left,width:v.image.descriptor.width,height:v.image.descriptor.height}};return E.descriptor.lct&&E.descriptor.lct.exists?_.colorTable=E.lct:_.colorTable=g,v.gce&&(_.delay=(v.gce.delay||10)*10,_.disposalType=v.gce.extras.disposal,v.gce.extras.transparentColorGiven&&(_.transparentIndex=v.gce.transparentColorIndex)),f&&(_.patch=s(_)),_};ac.decompressFrame=u;var c=function(v,g){return v.frames.filter(function(f){return f.image}).map(function(f){return u(f,v.gct,g)})};return ac.decompressFrames=c,ac}var c4;function HC(){return c4||(c4=1,function(e){var r=Xd&&Xd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=r(ai()),n=Us,a=vs,i=Fu,o=r(Hs()),s=UC(),u=o_(),c=Om(),h=Ap(),v=If(),g=rf();function f(w,_,y){const p=_.getContext("2d"),m=y.getContext("2d");if(!p||!m)return;w.disposalType===2&&p.clearRect(0,0,_.width,_.height),y.width=w.width,y.height=w.height;const P=m.createImageData(w.width,w.height);P.data.set(w.patch),m.putImageData(P,0,0),p.drawImage(y,w.left,w.top)}const E=(0,n.observer)(({element:w})=>{const _=Math.min(30,w.width/4,w.height/4),y=t.default.useRef(null);return t.default.useEffect(()=>{const p=y.current;if(!p)return;const m=new o.default.Animation(P=>{p.rotate((P?.timeDiff||0)/2)},p.getLayer());return m.start(),()=>{m.stop()}},[]),t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(i.Arc,{ref:y,x:w.width/2,y:w.height/2,fill:"white",outerRadius:Math.abs(_),innerRadius:Math.max(1,_-5),angle:270}))}),S=(0,n.observer)(({element:w})=>{const _=Math.max(10,Math.min(30,w.width/22));return t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(i.Text,{text:"Cannot load the GIF...",fontSize:_,width:w.width,height:w.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,n.observer)(({element:w,store:_})=>{var y;const[p,m]=t.default.useState(!1),P=_.selectedShapes.indexOf(w)>=0&&w.selectable,T=t.default.useRef(null),k=t.default.useRef(),[L,I,R,A]=function(J){const[X,Q]=t.default.useState([]),[ae,se]=t.default.useState(0),[fe,be]=t.default.useState("loading"),[_e,Ae]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const Re=await fetch(J),Pe=await Re.arrayBuffer(),ye=(0,s.parseGIF)(Pe),nt=(0,s.decompressFrames)(ye,!0),Ce=ye.lsd.width,he=ye.lsd.height;Ae({width:Ce,height:he});const ke=nt.map(ve=>({patch:new Uint8ClampedArray(ve.patch),delay:ve.delay,width:ve.dims.width,height:ve.dims.height,left:ve.dims.left,top:ve.dims.top,disposalType:ve.disposalType})),Te=ke.reduce((ve,Se)=>ve+Se.delay,0);Q(ke),se(Te),be("loaded")}catch(Re){console.error("Failed to load GIF:",Re),be("failed")}})()},[J]),[X,ae,_e,fe]}(w.src);(0,c.useImageLoader)(A,w.src,w.id),t.default.useEffect(()=>(k.current=document.createElement("canvas"),()=>{k.current&&o.default.Util.releaseCanvas(k.current)}),[]),t.default.useEffect(()=>{if(A==="loaded"&&k.current&&(k.current.width=R.width,k.current.height=R.height,L.length>0)){const J=k.current.getContext("2d");if(J){J.clearRect(0,0,R.width,R.height);const X=document.createElement("canvas");f(L[0],k.current,X)}}},[R,A,L]),t.default.useEffect(()=>{if(!L.length||!k.current)return;const J=k.current;J.width=R.width,J.height=R.height;const X=document.createElement("canvas"),Q=J.getContext("2d");Q&&Q.clearRect(0,0,J.width,J.height);let ae=-1;f(L[0],J,X),$(),ae=0;const se=fe=>{const be=(_e=>{const Ae=_e%I;let Re=0;for(let Pe=0;Pe<L.length;Pe++)if(Re+=L[Pe].delay,Re>Ae)return Pe;return 0})(fe);be!==ae&&(f(L[be],J,X),$(),T.current.getLayer().draw(),ae=be)};if(_.isPlaying||w.page._exportingOrRendering)return(0,a.autorun)(()=>{se(_.currentTime-w.page.startTime)});{const fe=window.setInterval(()=>{se(_.currentTime||performance.now())},16);return()=>{clearInterval(fe)}}},[_.isPlaying,L,I,w.page._exportingOrRendering]),t.default.useEffect(()=>{I&&_.history.ignore(()=>{w.set({duration:I})})},[I]);let{cropX:O,cropY:M,cropWidth:q,cropHeight:D}=w;A!=="loaded"&&(O=M=0,q=D=1);const te={x:R.width*O,y:R.height*M,width:R.width*q,height:R.height*D},H=(y=w.cornerRadius)!==null&&y!==void 0?y:0,[B,$]=(0,u.useCornerRadiusAndCrop)(w,k.current,te,_._elementsPixelRatio,H,p||w._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!p&&!w._cropModeEnabled&&T.current)return(0,h.applyFilter)(T.current,w),(0,a.autorun)(()=>{(0,h.applyFilter)(T.current,w)},{delay:100})},[k.current,p,q,D,w._cropModeEnabled,R.width,R.height]);const V=A==="loading",j=A==="failed",z=V||j?0:w.a.opacity;(0,v.useFadeIn)(T,z);const F=w.selectable||_.role==="admin",Y=(0,g.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,V&&t.default.createElement(E,{element:w}),j&&t.default.createElement(S,{element:w}),t.default.createElement(i.Image,{ref:T,name:"element",id:w.id,image:B,x:w.a.x,y:w.a.y,width:w.a.width||1,height:w.a.height||1,rotation:w.a.rotation,opacity:z,shadowEnabled:w.shadowEnabled,shadowBlur:w.shadowBlur,shadowOffsetX:w.shadowOffsetX,shadowOffsetY:w.shadowOffsetY,shadowColor:w.shadowColor,shadowOpacity:w.shadowOpacity,customCrop:te,listening:F,draggable:Y?w.draggable&&P:w.draggable,preventDefault:!Y||P,hideInExport:!w.showInExport,onDragMove:J=>{w.set({x:J.target.x(),y:J.target.y()})},onDragEnd:J=>{w.set({x:J.target.x(),y:J.target.y()})},onTransformStart:()=>m(!0),onTransform:J=>{const X=J.currentTarget,Q=Math.abs(X.scaleX()-1)<1e-7?1:X.scaleX(),ae=Math.abs(X.scaleY()-1)<1e-7?1:X.scaleY();X.scaleX(1),X.scaleY(1),w.set({x:X.x(),y:X.y(),width:X.width()*Q,height:X.height()*ae,rotation:X.rotation()})},onTransformEnd:()=>m(!1)}),t.default.createElement(i.Rect,{x:w.a.x,y:w.a.y,width:Math.max(w.a.width-w.borderSize,0),height:Math.max(w.a.height-w.borderSize,0),opacity:z,offsetX:-w.borderSize/2,offsetY:-w.borderSize/2,stroke:w.borderColor,strokeWidth:w.borderSize,listening:!1,visible:!!w.borderSize,rotation:w.rotation,cornerRadius:Math.max(0,H-w.borderSize),hideInExport:!w.showInExport}))})}(Xd)),Xd}var Qd={},f4;function VC(){return f4||(f4=1,function(e){var r=Qd&&Qd.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=r(ai()),n=Us,a=Fu,i={stroke:"rgb(0, 161, 255)",strokeWidth:2};e.setHighlighterStyle=o=>{Object.assign(i,o)},e.Highlighter=(0,n.observer)(({element:o})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:o.a.x,y:o.a.y,rotation:o.a.rotation,width:o.a.width,height:o.a.height,listening:!1,strokeScaleEnabled:!1},i)))}(Qd)),Qd}var Jd={};let GC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",u_=e=>crypto.getRandomValues(new Uint8Array(e)),c_=(e,r,t)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*n*r/e.length);return(i=r)=>{let o="";for(;;){let s=t(a),u=a;for(;u--;)if(o+=e[s[u]&n]||"",o.length===i)return o}}},WC=(e,r=21)=>c_(e,r,u_),$C=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");const YC=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:WC,customRandom:c_,nanoid:$C,random:u_,urlAlphabet:GC},Symbol.toStringTag,{value:"Module"})),u0=Zc(YC);var Lv={},Is={},Nv={},Tv={},h4;function f_(){return h4||(h4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(r,t){if(r===t)return!0;if(typeof r=="object"&&r!=null&&typeof t=="object"&&t!=null){if(Object.keys(r).length!=Object.keys(t).length)return!1;for(var n in r)if(!t.hasOwnProperty(n)||!(0,e.deepEqual)(r[n],t[n]))return!1;return!0}return!1}}(Tv)),Tv}var d4;function XC(){return d4||(d4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const r=hl,t=f_();Object.assign(r.types),e.UndoManager=r.types.model("UndoManager",{history:r.types.array(r.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let a,i,o=!1,s=null,u=0,c=0;const h=()=>c>0;function v(){const f=(0,r.getSnapshot)(a);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function g(f){const E=a.pages.map(y=>y.id),S=f.pages.map(y=>y.id),w=!(0,t.deepEqual)(E,S),_=!(0,t.deepEqual)(a.custom,f.custom);w?(0,r.applySnapshot)(a.pages,f.pages):a.pages.forEach((y,p)=>{(0,r.applySnapshot)(y,f.pages[p])}),_&&a.set({custom:f.custom}),a.setSize(f.width,f.height)}return{startTransaction(){c++},endTransaction(f){c--,f||this.requestAddState(v())},async ignore(f,E=!1,S=!1){S&&await new Promise(m=>setTimeout(m,10)),u&&n.addUndoState();let w=h();n.startTransaction();let _=c;try{await f()}catch(m){setTimeout(()=>{throw m})}const y=_!==c,p=!y;n.endTransaction(p),E||w||n.replaceState(),y||(clearTimeout(u),u=0)},async transaction(f){await n.ignore(f,!0),this.addUndoState()},requestAddState(f){s=f,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const f=n.history[n.undoIdx];!(0,t.deepEqual)(s,f)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(s),n.undoIdx=n.history.length-1)},afterCreate(){if(a=(0,r.resolvePath)(n,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");i=(0,r.onSnapshot)(a,()=>{this.requestAddState(v())}),n.history.length===0&&this.requestAddState(v())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(v())},beforeDestroy(){i()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,g(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,g(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=v()}}}),e.default=e.UndoManager}(Nv)),Nv}var Rv={},p4;function KC(){return p4||(p4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(r,t){const n=await(await fetch(r)).blob(),a=document.createElement("a"),i=URL.createObjectURL(n);a.href=i,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(i)},0)}}(Rv)),Rv}var Mv={},g4;function ZC(){return g4||(g4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){var n;return!((n=window.jspdf)===null||n===void 0)&&n.jsPDF?Promise.resolve(window.jspdf.jsPDF):t||(t=new Promise(a=>{var i=document.createElement("script");i.onload=function(){a(window.jspdf.jsPDF)},i.src=r,document.head.appendChild(i)}),t)};const r="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js";let t=null}(Mv)),Mv}var Iv={},v4;function QC(){return v4||(v4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=async function({width:n,height:a}){return new(await t())({workers:4,width:n,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
310
|
+
(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]);
|
|
311
|
+
`],{type:"application/javascript"}))})};const r="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(n=>{var a=document.createElement("script");a.onload=function(){n(window.GIF)},a.src=r,document.head.appendChild(a)})}}(Iv)),Iv}var sc={},jv={},m4;function JC(){return m4||(m4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const r=Rm();e.URL="https://api.polotno.com",e.API=`${e.URL}/api`,e.getAPI=()=>e.URL+"/api";const t={},n=(i,o)=>{t[i]||(t[i]=!0,console.error(o))},a=`API for iconscout is provided as a demonstration.
|
|
312
|
+
For production usage you have to use your own API endpoint.
|
|
313
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
314
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${i}&per_page=20&page=${o}&KEY=${(0,r.getKey)()}`,unsplashDownload:i=>`${(0,e.getAPI)()}/download-unsplash?id=${i}&KEY=${(0,r.getKey)()}`,svgapiList:({query:i,page:o=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${i}&page=${o}&per_page=20&KEY=${(0,r.getKey)()}`,svgapiDownload:i=>`${(0,e.getAPI)()}/download-svgapi?path=${i}&KEY=${(0,r.getKey)()}`,iconscoutList:({query:i,page:o=1})=>(n("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`),iconscoutDownload:i=>(n("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${i}&KEY=${(0,r.getKey)()}`),nounProjectList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`,nounProjectDownload:i=>`${(0,e.getAPI)()}/download-nounproject?id=${i}&KEY=${(0,r.getKey)()}`,templateList:({query:i,page:o=1,sizeQuery:s})=>`${(0,e.getAPI)()}/get-templates?${s}&query=${i}&per_page=30&page=${o}&KEY=${(0,r.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,r.getKey)()}`,googleFontImage:i=>{return`${e.URL}/google-fonts-previews/black/${o=i,o.replace(new RegExp(" ","g"),"-")}.png`;var o},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,r.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,r.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,r.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=i=>e.URLS.googleFontImage(i),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,r.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=i=>e.URLS.templateList(i),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=i=>e.URLS.unsplashList(i),e.unsplashDownload=i=>e.URLS.unsplashDownload(i),e.svgapiList=i=>e.URLS.svgapiList(i),e.svgapiDownload=i=>e.URLS.svgapiDownload(i),e.iconscoutList=i=>e.URLS.iconscoutList(i),e.iconscoutDownload=i=>e.URLS.iconscoutDownload(i),e.setAPI=(i,o)=>{e.URLS[i]=o}}(jv)),jv}var y4;function Rm(){return y4||(y4=1,function(e){var r,t=sc&&sc.__createBinding||(Object.create?function(L,I,R,A){A===void 0&&(A=R);var O=Object.getOwnPropertyDescriptor(I,R);O&&!("get"in O?!I.__esModule:O.writable||O.configurable)||(O={enumerable:!0,get:function(){return I[R]}}),Object.defineProperty(L,A,O)}:function(L,I,R,A){A===void 0&&(A=R),L[A]=I[R]}),n=sc&&sc.__setModuleDefault||(Object.create?function(L,I){Object.defineProperty(L,"default",{enumerable:!0,value:I})}:function(L,I){L.default=I}),a=sc&&sc.__importStar||(r=function(L){return r=Object.getOwnPropertyNames||function(I){var R=[];for(var A in I)Object.prototype.hasOwnProperty.call(I,A)&&(R[R.length]=A);return R},r(L)},function(L){if(L&&L.__esModule)return L;var I={};if(L!=null)for(var R=r(L),A=0;A<R.length;A++)R[A]!=="default"&&t(I,L,R[A]);return n(I,L),I});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=k,e.validateKey=async function(L,I){v=L,await k(L)&&!I||h()};const i=a(vs),o=JC(),s=gc(),u=i.observable({value:!1}),c=i.observable({value:"v1"});e.___=()=>c.value,e.isCreditVisible=()=>u.value;const h=i.action(()=>{u.value=!0});let v="";e.getKey=()=>v||"";const g=5,f=3e3,E="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",S="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",w="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",_="%cPolotno Free Version. For development usage only. https://polotno.com/";let y=typeof window<"u"?window.location.origin:"";const p=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,m=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&p&&(y="headless"),y==="file://"&&m&&(y="electron");const P=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;let T=fetch;async function k(L){for(let I=0;I<g;I++)try{const R=await T((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:L,site:location.host,skdVersion:"2.25.4"})});if(i.runInAction(()=>{c.value=R.headers.get("x-api-version")}),!L)return console.warn(E),!1;if(R.status!==200){await new Promise(O=>setTimeout(O,f));continue}const A=await R.json();return A.is_valid||console.warn(S),A.is_paid||console.log(_,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),A.is_domain_valid||console.log(P,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(A.remove_background_enabled),A.is_paid||!1}catch{await new Promise(A=>setTimeout(A,f))}return console.error(w),!0}e.__=L=>{T=L}}(sc)),sc}var Fv={},b4;function Mm(){return b4||(b4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:r,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return r;case"mm":return r/(n/25.4);case"cm":return r/(n/2.54);case"in":return r/n}},e.pxToUnitRounded=({px:r,precious:t=2,dpi:n=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:r,dpi:n,unit:a}).toFixed(t)),e.unitToPx=({unitVal:r,dpi:t,unit:n})=>r/(0,e.pxToUnit)({px:1,unit:n,dpi:t}),e.pxToUnitString=r=>{const t=parseFloat((0,e.pxToUnit)(r).toFixed(1));switch(r.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(Fv)),Fv}var Dv={},w4;function ek(){return w4||(w4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=async function(r){for(let t=0;t<30;t++){const n=await r();if(n)return n;await new Promise(a=>setTimeout(a,50))}}}(Dv)),Dv}var ql={},Bv={},_4;function h_(){return _4||(_4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=function(n){return new Promise(a=>{const i=document.createElement("img");i.onload=async()=>{i.width===0||i.height===0?a(await(0,r.getSvgSize)(n)):a({width:i.width,height:i.height})},i.crossOrigin="anonymous",i.src=n})},e.loadImage=t,e.cropImage=async function(n,a){const i=await t(n),o=document.createElement("canvas");o.width=2*i.width,o.height=2*i.height,o.getContext("2d").drawImage(i,0,0,o.width,o.height);const s=document.createElement("canvas");s.width=a.width,s.height=a.height;const u=s.getContext("2d");let{cropX:c,cropY:h}=a;const v=o.width*a.cropWidth,g=o.height*a.cropHeight,f=a.width/a.height;let E,S;const w=v/g;return a.type==="svg"?(E=v,S=g):f>=w?(E=v,S=v/f):(E=g*f,S=g),u.drawImage(o,c*o.width,h*o.height,E,S,0,0,s.width,s.height),s.toDataURL("image/png")},e.getCrop=function(n,a){const{width:i,height:o}=n,s=i/o;let u,c;s>=a.width/a.height?(u=a.width,c=a.width/s):(u=a.height*s,c=a.height);const h=(a.width-u)/2,v=(a.height-c)/2;return{cropX:h/a.width,cropY:v/a.height,cropWidth:u/a.width,cropHeight:c/a.height}};const r=kp();function t(n){return new Promise((a,i)=>{const o=document.createElement("img");o.onload=()=>{a(o)},o.onerror=s=>{i(s)},o.crossOrigin="anonymous",o.src=n})}}(Bv)),Bv}var qv={},S4;function d_(){return S4||(S4=1,function(e){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t,n){let a={filter:"",html:void 0};switch(t){case r.warm:{const i=Math.max(0,Math.min(1,n??.5)),o=1+.3*i,s=1+.15*i,u=1;return a.filter="url(#warm-filter)",a.html=`
|
|
315
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
316
|
+
<filter id="warm-filter" color-interpolation-filters="sRGB">
|
|
317
|
+
<feColorMatrix type="matrix" values="
|
|
318
|
+
${o} 0 0 0 0
|
|
319
|
+
0 ${s} 0 0 0
|
|
320
|
+
0 0 ${u} 0 0
|
|
321
|
+
0 0 0 1 0" />
|
|
322
|
+
</filter>
|
|
323
|
+
</svg>`,a}case r.cold:{const i=Math.max(0,Math.min(1,n??.5)),o=1-.15*i,s=1-.1*i,u=1+.15*i;return a.filter="url(#cold-filter)",a.html=`
|
|
324
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
325
|
+
<filter id="cold-filter" color-interpolation-filters="sRGB">
|
|
326
|
+
<feColorMatrix type="matrix" values="
|
|
327
|
+
${o} 0 0 0 0
|
|
328
|
+
0 ${s} 0 0 0
|
|
329
|
+
0 0 ${u} 0 0
|
|
330
|
+
0 0 0 1 0" />
|
|
331
|
+
</filter>
|
|
332
|
+
</svg>`,a}case"natural":{const i=Math.max(0,Math.min(1,n??.5)),o=1+.1*i,s=1+.3*i,u=1+.2*i;return a.filter=`saturate(${s}) brightness(${o}) contrast(${u})`,a}case r.temperature:{const i=Math.max(-1,Math.min(1,n??0)),o=1+.15*i,s=1,u=1-.15*i;return a.filter="url(#temperature-filter)",a.html=`
|
|
333
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
334
|
+
<filter id="temperature-filter" color-interpolation-filters="sRGB">
|
|
335
|
+
<feColorMatrix type="matrix" values="
|
|
336
|
+
${o} 0 0 0 0
|
|
337
|
+
0 ${s} 0 0 0
|
|
338
|
+
0 0 ${u} 0 0
|
|
339
|
+
0 0 0 1 0" />
|
|
340
|
+
</filter>
|
|
341
|
+
</svg>
|
|
342
|
+
`,a}case r.contrast:{const i=100*Math.max(-1,Math.min(1,n??0)),o=259*(i+255)/(255*(259-i)),s=.5*(1-o);return a.filter="url(#contrast-filter)",a.html=`
|
|
343
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
344
|
+
<filter id="contrast-filter" color-interpolation-filters="sRGB">
|
|
345
|
+
<feComponentTransfer>
|
|
346
|
+
<feFuncR type="linear" slope="${o}" intercept="${s}" />
|
|
347
|
+
<feFuncG type="linear" slope="${o}" intercept="${s}" />
|
|
348
|
+
<feFuncB type="linear" slope="${o}" intercept="${s}" />
|
|
349
|
+
</feComponentTransfer>
|
|
350
|
+
</filter>
|
|
351
|
+
</svg>
|
|
352
|
+
`,a}case r.shadows:{const i=Math.max(-1,Math.min(1,n??0)),o=Math.min(Math.max(1-.6*i,.4),2.5);return a.filter="url(#shadows-filter)",a.html=`
|
|
353
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
354
|
+
<filter id="shadows-filter" color-interpolation-filters="sRGB">
|
|
355
|
+
<feComponentTransfer>
|
|
356
|
+
<feFuncR type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
357
|
+
<feFuncG type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
358
|
+
<feFuncB type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
359
|
+
</feComponentTransfer>
|
|
360
|
+
</filter>
|
|
361
|
+
</svg>
|
|
362
|
+
`,a}case r.white:case r.black:return null;case r.vibrance:{const i=Math.max(-1,Math.min(1,n??0)),o=.299,s=.587,u=.114;let c;c=i>=0?1+1.5*i:1+i;const h=1-c,v=h*o+c,g=h*s,f=h*u,E=h*o,S=h*s+c,w=h*u,_=h*o,y=h*s,p=h*u+c;return a.filter="url(#vibrance-filter)",a.html=`
|
|
363
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
364
|
+
<filter id="vibrance-filter" color-interpolation-filters="sRGB">
|
|
365
|
+
<feColorMatrix type="matrix" values="
|
|
366
|
+
${v} ${g} ${f} 0 0
|
|
367
|
+
${E} ${S} ${w} 0 0
|
|
368
|
+
${_} ${y} ${p} 0 0
|
|
369
|
+
0 0 0 1 0" />
|
|
370
|
+
</filter>
|
|
371
|
+
</svg>
|
|
372
|
+
`,a}case r.saturation:{const u=1+Math.max(-1,Math.min(1,n??0)),c=1-u,h=c*.2126+u,v=c*.7152,g=c*.0722,f=c*.2126,E=c*.7152+u,S=c*.0722,w=c*.2126,_=c*.7152,y=c*.0722+u;return a.filter="url(#saturation-filter)",a.html=`
|
|
373
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
374
|
+
<filter id="saturation-filter" color-interpolation-filters="sRGB">
|
|
375
|
+
<feColorMatrix type="matrix" values="
|
|
376
|
+
${h} ${v} ${g} 0 0
|
|
377
|
+
${f} ${E} ${S} 0 0
|
|
378
|
+
${w} ${_} ${y} 0 0
|
|
379
|
+
0 0 0 1 0" />
|
|
380
|
+
</filter>
|
|
381
|
+
</svg>
|
|
382
|
+
`,a}default:return null}},function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold",t.temperature="temperature",t.contrast="contrast",t.shadows="shadows",t.white="white",t.black="black",t.vibrance="vibrance",t.saturation="saturation"}(r||(e.Effects=r={}))}(qv)),qv}var zv={},x4;function tk(){return x4||(x4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getVideoSize=async function(r){return new Promise((t,n)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.src=r,a.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:o}=a;t({width:i,height:o})}),a.addEventListener("error",i=>{const o=r.slice(0,100);n(new Error(`Failed to load video: ${o}`))})})},e.getVideoDuration=async function(r){return new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=r,n.addEventListener("loadedmetadata",()=>{const{duration:a}=n;t(a)})})},e.getVideoPreview=async function(r,t=5){return new Promise((n,a)=>{var i=document.createElement("video"),o=document.createElement("canvas");o.width=480,o.height=360;var s=o.getContext("2d");i.crossOrigin="anonymous",i.src=r,i.addEventListener("error",u=>{a(u)}),i.addEventListener("loadeddata",function(){const u=i.videoWidth/i.videoHeight;o.width=480,o.height=480/u,i.currentTime=t}),i.addEventListener("seeked",function(){s.drawImage(i,0,0,o.width,o.height);try{var u=o.toDataURL();n(u)}catch(c){a(c)}})})},e.getVideoObjectPreview=async function(r,t,n){return new Promise((a,i)=>{const o=t.getContext("2d"),s=()=>{try{o.drawImage(r,0,0,t.width,t.height);const u=t.toDataURL();a(u),r.removeEventListener("seeked",s)}catch(u){i(u),r.removeEventListener("seeked",s)}};r.addEventListener("seeked",s),r.currentTime=n})}}(zv)),zv}var E4;function rk(){return E4||(E4=1,function(e){var r,t=ql&&ql.__createBinding||(Object.create?function(m,P,T,k){k===void 0&&(k=T);var L=Object.getOwnPropertyDescriptor(P,T);L&&!("get"in L?!P.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return P[T]}}),Object.defineProperty(m,k,L)}:function(m,P,T,k){k===void 0&&(k=T),m[k]=P[T]}),n=ql&&ql.__setModuleDefault||(Object.create?function(m,P){Object.defineProperty(m,"default",{enumerable:!0,value:P})}:function(m,P){m.default=P}),a=ql&&ql.__importStar||(r=function(m){return r=Object.getOwnPropertyNames||function(P){var T=[];for(var k in P)Object.prototype.hasOwnProperty.call(P,k)&&(T[T.length]=k);return T},r(m)},function(m){if(m&&m.__esModule)return m;var P={};if(m!=null)for(var T=r(m),k=0;k<T.length;k++)T[k]!=="default"&&t(P,m,T[k]);return n(P,m),P}),i=ql&&ql.__rest||function(m,P){var T={};for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&P.indexOf(k)<0&&(T[k]=m[k]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(k=Object.getOwnPropertySymbols(m);L<k.length;L++)P.indexOf(k[L])<0&&Object.prototype.propertyIsEnumerable.call(m,k[L])&&(T[k[L]]=m[k[L]])}return T};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=function(m){var P=new DOMParser().parseFromString(m,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)},e.jsonToDOM=y,e.jsonToHTML=async function({json:m,elementHook:P}){const T=await y({json:m,elementHook:P});return p({dom:T})};const o=h_(),s=a(kp()),u=Tm(),c=Nm(),h=d_(),v=tk(),g=Ih(),f=(m,P,...T)=>({type:m,props:P,children:T||[]}),E=async({element:m,page:P,store:T})=>{let{src:k}=m;if(m.type==="svg"&&Object.keys(m.colorsReplace).length){const Y=await s.urlToString(k);k=s.replaceColors(Y,new Map(Object.entries(m.colorsReplace)))}let L="";m.flipX&&(L+="scaleX(-1)"),m.flipY&&(L+="scaleY(-1)"),L||(L="none");const I={};if(m.clipSrc){const Y=await s.urlToBase64(m.clipSrc);I["clip-path"]=`url(${Y})`}const R=await(0,o.loadImage)(k),A=R.width*m.cropWidth,O=R.height*m.cropHeight,M=m.width/m.height;let q,D;const te=A/O;m.type==="svg"?(q=A,D=O):M>=te?(q=A,D=A/M):(q=O*M,D=O);const H=q/R.width,B=D/R.height,$=q/D>m.width/m.height?m.height/D:m.width/q,V=q*$/H,j=D*$/B,z=m.cropX*$*R.width,F=m.cropY*$*R.height;return f("div",{style:Object.assign(Object.assign({},I),{width:"100%",height:"100%",borderRadius:m.cornerRadius+"px",border:m.borderSize?`${m.borderSize}px solid ${m.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${k})`,transform:L,backgroundSize:`${Math.round(V)}px ${Math.round(j)}px`,backgroundPositionX:-Math.round(z)+"px",backgroundPositionY:-Math.round(F)+"px"})})},S=({element:m,type:P})=>{const T={"stroke-width":m.height,stroke:m.color,"line-cap":"round","stroke-linejoin":"round",opacity:m.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*m.height},${2*-m.height} 0,0 ${3*m.height},${2*m.height}`},T)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-m.height} 0,${2*m.height}`},T)):P==="circle"?f("circle",Object.assign({r:m.height},T)):P==="square"?f("polyline",Object.assign({points:`${-m.height},${-m.height} ${-m.height},${m.height} ${m.height},${m.height} ${m.height},${-m.height}`},T)):null},w={image:E,svg:E,text:async({element:m,page:P,store:T})=>{let k={top:0,left:0};m.fill.indexOf("gradient")>=0&&(k=Object.assign(Object.assign({},k),{backgroundColor:m.fill,backgroundImage:m.fill,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}));const L=m.backgroundPadding*(m.fontSize*m.lineHeight),I=f("div",{style:{position:"absolute",top:-L/2+"px",left:-L/2+"px",display:m.backgroundEnabled?"block":"none",width:m.width+L+"px",height:m.height+L+"px",backgroundColor:m.backgroundColor,borderRadius:m.backgroundCornerRadius*(m.fontSize*m.lineHeight*.5)+"px"}});m.verticalAlign==="middle"?(k.top="50%",k.transform="translateY(-50%)"):m.verticalAlign==="bottom"&&(k.bottom=0);const R=/<[a-z][\s\S]*>/i.test(m.text),A=Object.assign(Object.assign({},k),{position:"absolute",width:m.width+"px",color:m.fill,whiteSpace:"pre-wrap",fontSize:m.fontSize+"px",textAlign:m.align,fontFamily:m.fontFamily,textDecoration:m.textDecoration||"none",textTransform:m.textTransform||"none",lineHeight:m.lineHeight,letterSpacing:m.letterSpacing+"em",fontStyle:m.fontStyle,fontWeight:m.fontWeight,WebkitTextStroke:`${m.strokeWidth}px ${m.stroke}`,textStroke:`${m.strokeWidth}px ${m.stroke}`}),O="el-"+m.id,M=R?{id:O}:{},q=`<style>#${O} {${c.resetStyleContent}}</style>`,D=f("div",Object.assign(Object.assign({style:A},M),{innerHTML:R?`${q}${m.text}`:m.text.split(`
|
|
383
|
+
`).join("<br />")}));return f("div",{style:{position:"relative",width:"100%",height:"100%"}},I,D)},line:async({element:m,page:P,store:T})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:m.width,height:m.height,fill:m.color}),f("g",{transform:`translate(0 ${m.height/2})`},S({element:m,type:m.startHead})),f("g",{transform:`translate(${m.width} ${m.height/2}) rotate(180)`},S({element:m,type:m.endHead}))),figure:async({element:m,page:P,store:T,elementHook:k})=>{const L=(0,u.figureToSvg)(m),I=f("div",{innerHTML:L});return k&&k({dom:I,element:m})||I},group:async({element:m,page:P,store:T,elementHook:k})=>{const L=await Promise.all(m.children.map(R=>_({element:R,page:P,store:T,elementHook:k}))),I=f("div",{style:{transformOrigin:"top left",opacity:m.opacity}},...L);return k&&k({dom:I,element:m})||I},video:async({element:m,page:P,store:T,elementHook:k})=>{const{cropX:L,cropY:I,cropWidth:R,cropHeight:A}=m,O=await(0,v.getVideoSize)(m.src),M=O.width*R,q=O.height*A,D=m.width/m.height;let te,H;D>=M/q?(te=M,H=M/D):(te=q*D,H=q);const B=te/R,$=H/A,V=L*O.width,j=I*O.height,z=Math.max(m.width/O.width,m.height/O.height),F={position:"absolute",width:`${Math.round(B*z)}px`,height:`${Math.round($*z)}px`,left:-Math.round(V*z)+"px",top:-Math.round(j*z)+"px",objectFit:"fill"},Y=`video-${m.id}`,J=f("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:m.cornerRadius+"px",border:m.borderSize?`${m.borderSize}px solid ${m.borderColor}`:"none"}},f("video",{id:Y,src:m.src,style:F,controls:!0,playsInline:!0,muted:!0,volume:m.volume}));return k&&k({dom:J,element:m})||J},gif:E};async function _({element:m,page:P,store:T,elementHook:k}){let L=await w[m.type];if(L||(L=()=>f("div",{}),console.error(`HTML export does not support ${m.type} type...`)),!m.visible)return null;const I=await L({element:m,page:P,store:T}),R=[],A=[];if(m.blurEnabled&&R.push(`blur(${m.blurRadius/2}px)`),m.brightnessEnabled&&R.push(`brightness(${100*m.brightness+100}%)`),m.sepiaEnabled&&R.push("sepia()"),m.grayscaleEnabled&&R.push("grayscale()"),m.filters)for(const[M,q]of Object.entries(m.filters)){const D=(0,h.shapeFilterToCSS)(h.Effects[M],q.intensity);D&&(R.push(D.filter),D.html&&A.push(D.html))}m.shadowEnabled&&R.push(`drop-shadow(${m.shadowOffsetX}px ${m.shadowOffsetY}px ${m.shadowBlur}px ${m.shadowColor})`);const O=f("div",{id:m.id,style:{position:"absolute",left:m.x+"px",top:m.y+"px",width:m.width+"px",height:m.height+"px",transform:`rotate(${m.rotation}deg)`,transformOrigin:"top left",opacity:m.opacity,display:m.visible&&m.showInExport?"block":"none",filter:R.join(" ")||"none"}},I,...A);return k&&k({dom:O,element:m})||O}async function y({json:m,elementHook:P}){const T=await Promise.all(m.pages.map(I=>async function({page:R,store:A,elementHook:O}){const M=await Promise.all(R.children.map(H=>_({element:H,page:R,store:A,elementHook:O}))),q=R.width==="auto"?A.width:R.width,D=R.height==="auto"?A.height:R.height;let te={};if(R.background.indexOf("url")>=0||R.background.indexOf("http")>=0||R.background.indexOf(".jpg")>=0||R.background.indexOf(".png")>=0||R.background.indexOf(".jpeg")>=0){const{width:H,height:B}=await(0,o.loadImage)(R.background),$=await E({element:Object.assign({x:0,y:0,width:H,height:B,src:R.background,cornerRadius:0},(0,o.getCrop)({width:H,height:B},{width:H,height:B})),page:R,store:A});M.unshift($)}else te=Object.assign(Object.assign({},te),{backgroundColor:R.background});return f("div",{className:"page",id:R.id,style:Object.assign(Object.assign({},te),{width:q+"px",height:D+"px",overflow:"hidden",position:"relative"})},...M)}({page:I,store:m,elementHook:P}))),k=[];m.pages.forEach(I=>{I.children.forEach(R=>{R.type==="text"&&k.indexOf(R.fontFamily)===-1&&k.push(R.fontFamily)})});const L=k.map(I=>m.fonts.find(R=>R.fontFamily===I)?f("style",{},""):f("link",{href:(0,g.getGoogleFontsUrl)(I),rel:"stylesheet"}));return f("div",{className:"design"},...L,...T)}const p=({dom:m})=>{if(typeof m=="string")return m;if(!m)return"";const P=m.props,{innerHTML:T}=P,k=i(P,["innerHTML"]),L=Object.keys(k).map(I=>I==="style"&&typeof k[I]=="object"?`style="${Object.keys(k[I]).map(R=>`${R.replace(/[A-Z]/g,A=>`-${A.toLowerCase()}`)}: ${k[I][R]}`).join("; ")}"`:((R,A)=>typeof A=="object"?`${R}="${Object.keys(A).map(O=>`${O.replace(/-([a-z])/g,M=>M[1].toUpperCase())}:${A[O]};`).join(" ")}"`:`${R}="${A}"`)(I,k[I])).join(" ");return`<${m.type} ${L}>${T||m.children.map(I=>p({dom:I})).join("")}</${m.type}>`}}(ql)),ql}var zl={},P4;function nk(){return P4||(P4=1,function(e){var r,t=zl&&zl.__createBinding||(Object.create?function(p,m,P,T){T===void 0&&(T=P);var k=Object.getOwnPropertyDescriptor(m,P);k&&!("get"in k?!m.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return m[P]}}),Object.defineProperty(p,T,k)}:function(p,m,P,T){T===void 0&&(T=P),p[T]=m[P]}),n=zl&&zl.__setModuleDefault||(Object.create?function(p,m){Object.defineProperty(p,"default",{enumerable:!0,value:m})}:function(p,m){p.default=m}),a=zl&&zl.__importStar||(r=function(p){return r=Object.getOwnPropertyNames||function(m){var P=[];for(var T in m)Object.prototype.hasOwnProperty.call(m,T)&&(P[P.length]=T);return P},r(p)},function(p){if(p&&p.__esModule)return p;var m={};if(p!=null)for(var P=r(p),T=0;T<P.length;T++)P[T]!=="default"&&t(m,p,P[T]);return n(m,p),m}),i=zl&&zl.__rest||function(p,m){var P={};for(var T in p)Object.prototype.hasOwnProperty.call(p,T)&&m.indexOf(T)<0&&(P[T]=p[T]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function"){var k=0;for(T=Object.getOwnPropertySymbols(p);k<T.length;k++)m.indexOf(T[k])<0&&Object.prototype.propertyIsEnumerable.call(p,T[k])&&(P[T[k]]=p[T[k]])}return P};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=function(p){var m=new DOMParser().parseFromString(p,"image/svg+xml");return m.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(m)},e.jsonToDOM=_,e.jsonToSVG=async function({json:p,elementHook:m}){const P=await _({json:p,elementHook:m});return y({dom:P})};const o=h_(),s=a(kp()),u=Tm(),c=d_(),h=r0();e.forEveryChild=(p,m)=>{if(p.children)for(const P of p.children){if(m(P)===!0)break;(0,e.forEveryChild)(P,m)}};const v=(p,m,...P)=>({type:p,props:m,children:P||[]}),g=async({element:p,page:m,store:P})=>{let{src:T}=p;if(p.type==="svg"){const Y=await s.urlToString(T);T=s.replaceColors(Y,new Map(Object.entries(p.colorsReplace)))}else T=await(async Y=>{try{const J=await fetch(Y);if(typeof Buffer<"u"){const X=await J.arrayBuffer(),Q=Buffer.from(X).toString("base64");return`data:${J.headers.get("content-type")||"image/png"};base64,${Q}`}{const X=await J.blob();return new Promise((Q,ae)=>{const se=new FileReader;se.onloadend=()=>Q(se.result),se.onerror=ae,se.readAsDataURL(X)})}}catch(J){return console.error("Error converting URL to data URL:",J),Y}})(T);let k="";p.flipX&&(k+="scaleX(-1)"),p.flipY&&(k+="scaleY(-1)"),p.clipSrc&&await s.urlToBase64(p.clipSrc);const L=await(0,o.loadImage)(T),I=L.width*p.cropWidth,R=L.height*p.cropHeight,A=p.width/p.height;let O,M;const q=I/R;p.type==="svg"?(O=I,M=R):A>=q?(O=I,M=I/A):(O=R*A,M=R);const D=O/L.width,te=M/L.height,H=O/M>p.width/p.height?p.height/M:p.width/O,B=O*H/D,$=M*H/te,V=p.cropX*L.width*H,j=p.cropY*L.height*H,z=`clip-${p.id}`,F=T.replace(/&/g,"&");return v("g",{style:{transform:k}},v("defs",{},v("clipPath",{id:z},v("rect",{x:0,y:0,width:p.width,height:p.height}))),v("image",{href:F,x:-V,y:-j,width:B,height:$,preserveAspectRatio:"none","clip-path":`url(#${z})`}))},f=({element:p,type:m})=>{const P={"stroke-width":p.height,stroke:p.color,"line-cap":"round","stroke-linejoin":"round",opacity:p.opacity,fill:p.color};return m==="arrow"?v("polyline",Object.assign({points:`${3*p.height},${2*-p.height} 0,0 ${3*p.height},${2*p.height}`},P)):m==="triangle"?v("polygon",Object.assign({points:`${3*p.height},${2*-p.height} 0,0 ${3*p.height},${2*p.height}`},P)):m==="bar"?v("polyline",Object.assign({points:`0,${2*-p.height} 0,${2*p.height}`},P)):m==="circle"?v("circle",Object.assign({cx:2*p.height,cy:0,r:2*p.height},P)):m==="square"?v("polygon",Object.assign({points:`0,${2*-p.height} ${4*p.height},${2*-p.height} ${4*p.height},${2*p.height} 0,${2*p.height}`},P)):null},E={image:g,svg:g,text:async({element:p,page:m,store:P})=>{const T=(O,M,q,D,te)=>{const H=document.createElement("canvas").getContext("2d");return H.font=`${te} ${D} ${M}px ${q}`,H.measureText(O).width};let k=(0,h.removeTags)(p.text);p.textTransform=="uppercase"&&(k=k.toUpperCase());const L=((O,M,q,D,te,H)=>{const B=[];return O.split(`
|
|
384
|
+
`).forEach($=>{const V=$.split(" ");let j="";for(let z=0;z<V.length;z++){const F=j+V[z]+" ";T(F,q,D,te,H)>M+.5&&z>0?(B.push(j.trim()),j=V[z]+" "):j=F}B.push(j.trim())}),B})(k,p.width,p.fontSize,p.fontFamily,p.fontWeight,p.fontStyle),I=p.fontSize*p.lineHeight,R=p.align==="center"?"middle":p.align==="right"?"end":"start",A=L.map((O,M)=>v("tspan",{x:p.align==="center"?p.width/2:p.align==="right"?p.width:0,dy:M===0?0:I,innerHTML:O}));return v("g",{},v("text",{fill:p.fill,y:p.fontSize,"font-size":p.fontSize+"px","text-anchor":R,"font-family":p.fontFamily,"font-style":p.fontStyle,"font-weight":p.fontWeight,"text-decoration":p.textDecoration,"line-height":p.lineHeight,"letter-spacing":p.letterSpacing+"em","stroke-width":p.strokeWidth,stroke:p.stroke},...A))},line:async({element:p,page:m,store:P})=>v("g",{opacity:p.opacity},v("line",{x1:0,y1:p.height/2,x2:p.width,y2:p.height/2,stroke:p.color,"stroke-width":p.height,"stroke-dasharray":p.dash&&p.dash.length?p.dash.map(T=>T*p.height).join(" "):void 0}),v("g",{transform:`translate(0 ${p.height/2})`},f({element:p,type:p.startHead})),v("g",{transform:`translate(${p.width} ${p.height/2}) rotate(180)`},f({element:p,type:p.endHead}))),figure:async({element:p,page:m,store:P,elementHook:T})=>{const k=function(I){let R=I.replace(/<svg[^>]*>/,"");return R=R.replace(/<\/svg>/,""),R}((0,u.figureToSvg)(p)),L=v("g",{innerHTML:k});return T&&T({dom:L,element:p})||L},group:async({element:p,page:m,store:P,elementHook:T})=>{const k=await Promise.all(p.children.map(I=>S({element:I,page:m,store:P,elementHook:T}))),L=v("g",{opacity:p.opacity,style:{"transform-origin":"top left"}},...k);return T&&T({dom:L,element:p})||L},gif:g};async function S({element:p,page:m,store:P,elementHook:T}){let k=await E[p.type];k||(k=()=>v("g",{}),console.error(`SVG export does not support ${p.type} type...`));const L=await k({element:p,page:m,store:P}),I=[],R=[];if(p.blurEnabled&&I.push(`blur(${p.blurRadius/2}px)`),p.brightnessEnabled&&I.push(`brightness(${100*p.brightness+100}%)`),p.sepiaEnabled&&I.push("sepia()"),p.grayscaleEnabled&&I.push("grayscale()"),p.shadowEnabled&&I.push(`drop-shadow(${p.shadowOffsetX}px ${p.shadowOffsetY}px ${p.shadowBlur}px ${p.shadowColor})`),p.filters)for(const[O,M]of Object.entries(p.filters)){const q=(0,c.shapeFilterToCSS)(c.Effects[O],M.intensity);if(q&&(I.push(q.filter),q.html)){const D=q.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");R.push(D)}}const A=v("g",{className:"element",id:p.id,transform:p.type!=="group"?`translate(${p.x}, ${p.y}) rotate(${p.rotation})`:void 0,display:p.visible?void 0:"none",style:{"transform-origin":"top left",filter:I.join(" ")}},L,...R);return T&&T({dom:A,element:p})||A}async function w(p){try{const m=await fetch(p),P=await m.blob();return new Promise((T,k)=>{const L=new FileReader;L.onloadend=()=>T(L.result),L.onerror=k,L.readAsDataURL(P)})}catch(m){return console.error("Error embedding font:",m),p}}async function _({json:p,elementHook:m}){const P=await Promise.all(p.pages.map(L=>async function({page:I,store:R,elementHook:A}){const O=await Promise.all(I.children.map(D=>S({element:D,page:I,store:R,elementHook:A}))),M=I.background.indexOf("url")>=0||I.background.indexOf("http")>=0||I.background.indexOf(".jpg")>=0||I.background.indexOf(".png")>=0||I.background.indexOf(".jpeg")>=0;let q;if(M){const D=await(0,o.loadImage)(I.background);q=await(0,o.cropImage)(I.background,Object.assign({width:R.width,height:R.height,x:0,y:0},(0,o.getCrop)({width:R.width,height:R.height},{width:D.width,height:D.height})))}return v("g",{className:"page",style:{}},M?v("image",{"xlink:href":q,x:0,y:0,width:R.width,height:R.height,preserveAspectRatio:"none"}):v("rect",{x:0,y:0,width:R.width,height:R.height,fill:M?void 0:I.background}),...O)}({page:L,store:p,elementHook:m}))),T=[];(0,e.forEveryChild)({children:p.pages},L=>{L.type==="text"&&T.indexOf(L.fontFamily)===-1&&T.push(L.fontFamily)});const k=await async function(L,I){return await Promise.all(L.map(async R=>{var A,O;const M=I.find(q=>q.fontFamily===R);if(M){const q=await w(M.url);return v("style",{},`@font-face { font-family: ${R}; src: url(${q}); }`)}{const q=`https://fonts.googleapis.com/css?family=${R}:bi,normal,i,b`;try{const D=await fetch(q),te=await D.text(),H=(O=(A=te.match(/url\((.*?)\)/g))===null||A===void 0?void 0:A.map($=>$.replace(/url\((.*?)\)/,"$1")))===null||O===void 0?void 0:O.filter($=>$.startsWith("https"));if(!H?.length)throw new Error("No font URLs found");const B=await Promise.all(H.map(async $=>{const V=await w($),j=te.match(/font-style:\s*(.*?);/),z=te.match(/font-weight:\s*(.*?);/),F=j?j[1]:"normal",Y=z?z[1]:"normal";return`@font-face {
|
|
385
|
+
font-family: ${R};
|
|
386
|
+
font-style: ${F};
|
|
387
|
+
font-weight: ${Y};
|
|
388
|
+
src: url(${V});
|
|
389
|
+
}`}));return v("style",{},B.join(`
|
|
390
|
+
`))}catch(D){return console.error("Error embedding Google Font:",D),v("defs",{},v("style",{type:"text/css",innerHTML:`@import url('${q}');`.replace(/&/g,"&")}))}}}))}(T,p.fonts);return v("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${p.width} ${p.height}`,width:p.width,height:p.height},...k,...P)}const y=({dom:p,nestLevel:m=0})=>{if(typeof p=="string")return p;if(!p)return"";const P=p.props,{innerHTML:T}=P,k=i(P,["innerHTML"]),L=" ".repeat(m);return`${L}<${p.type} ${Object.keys(k).map(I=>((R,A)=>typeof A=="object"?`${R}="${Object.keys(A).map(O=>`${O}:${A[O]};`).join(" ")}"`:A==null||A===""?"":`${R}="${A}"`)(I,k[I])).join(" ")}>${T||`
|
|
391
|
+
`+p.children.map(I=>y({dom:I,nestLevel:m+1})).join("")}${L}</${p.type}>
|
|
392
|
+
`}}(zl)),zl}var Uv={},O4;function p_(){return O4||(O4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const r=hl,t=u0,n=Nh(),a=Im(),i=Nh(),o=Dh();e.Page=r.types.model("Page",{id:r.types.identifier,children:r.types.array(r.types.late(()=>n.ElementTypes)),width:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),height:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),background:"white",bleed:0,custom:r.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(s=>{const u=Object.assign({},s),c={};for(var h in u)h[0]!=="_"&&(c[h]=s[h]);return c}).views(s=>({get store(){return(0,r.getParentOfType)(s,a.Store)}})).views(s=>({get startTime(){let u=0;for(const c of s.store.pages){if(c.id===s.id)return u;u+=c.duration}return u},get _exportingOrRendering(){return s._exporting||s._rendering}})).views(s=>({get computedWidth(){return s.width==="auto"?s.store.width:s.width},get computedHeight(){return s.height==="auto"?s.store.height:s.height}})).actions(s=>({toJSON:()=>JSON.parse(JSON.stringify((0,r.getSnapshot)(s))),_forEachElementUp(u,c){const h=u.map(v=>({id:v,index:s.children.findIndex(g=>g.id===v)}));h.sort((v,g)=>g.index-v.index);for(const{index:v}of h){if(v==-1)continue;const g=v<s.children.length-1&&s.children[v+1],f=u.indexOf(g?.id)>=0;v===s.children.length-1||f||c(v)}},_forEachElementDown(u,c){const h=u.map(v=>({id:v,index:s.children.findIndex(g=>g.id===v)}));h.sort((v,g)=>v.index-g.index);for(const{index:v}of h){if(v==-1)continue;const g=v>0&&s.children[v-1],f=u.indexOf(g?.id)>=0;v===0||f||c(v)}return!1}})).actions(s=>({clone(u={}){const c=s.toJSON();c.children.forEach(f=>{f.id=(0,t.nanoid)(10),(0,i.forEveryChild)(f,E=>{E.id=(0,t.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},c),{id:(0,t.nanoid)(10)}),u),v=s.store.addPage(h),g=s.store.pages.indexOf(s);return v.setZIndex(g+1),v.select(),v},setZIndex(u){s.store.setPageZIndex(s.id,u)},set(u){Object.assign(s,u)},select(){s.store.selectPage(s.id)},addElement(u,{skipSelect:c=!1}={}){const h=i.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);"children"in u&&Array.isArray(u.children)&&(0,i.forEveryChild)(u,g=>{g.id=g.id||(0,t.nanoid)(10)});const v=h.create(Object.assign({id:(0,t.nanoid)(10)},u));return s.children.push(v),v.selectable&&!c&&s.store.selectElements([v.id]),v},canMoveElementsUp(u){let c=!1;return s._forEachElementUp(u,()=>{c=c||!0}),c},moveElementsUp(u){s._forEachElementUp(u,c=>{const h=s.children[c];(0,r.detach)(h),s.children.splice(c+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const c=[],h=[];s.children.forEach(v=>{u.indexOf(v.id)>=0?c.push(v):h.push(v)}),s.children.replace(h.concat(c))},canMoveElementsDown(u){let c=!1;return s._forEachElementDown(u,()=>{c=c||!0}),c},moveElementsDown(u){s._forEachElementDown(u,c=>{const h=s.children[c];(0,r.detach)(h),s.children.splice(c-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const c=[],h=[];s.children.forEach(v=>{u.indexOf(v.id)>=0?c.push(v):h.push(v)}),s.children.replace(c.concat(h))},setElementZIndex(u,c){const h=s.children.find(v=>v.id===u);h&&((0,r.detach)(h),s.children.remove(h),s.children.splice(c,0,h))},setSize({width:u,height:c,useMagic:h,softChange:v}){if(h){const g=[],f=M=>M.type==="image"&&M.x<1&&M.y<1&&M.width>=s.computedWidth-2&&M.height>=s.computedHeight-2;(0,i.forEveryChild)(s,M=>{M.type!=="group"&&(f(M)||g.push(M))});const E=g.length?(0,o.getTotalClientRect)(g):{x:0,y:0,width:s.computedWidth,height:s.computedHeight},S=1/4,w=Math.max(0,Math.min(E.x,s.computedWidth-E.x-E.width)),_=s.computedWidth*S,y=Math.max(0,w-_),p=Math.max(0,Math.min(E.y,s.computedHeight-E.y-E.height)),m=s.computedHeight*S,P=Math.max(0,p-m),T=s.computedWidth-2*y,k=s.computedHeight-2*P,L=u/T,I=c/k,R=Math.min(L,I),A=(u-T*R)/2-y*R,O=(c-k*R)/2-P*R;(0,i.forEveryChild)(s,M=>{M.type!=="group"&&(f(M)?M.set({x:M.x*R,y:M.y*R,width:M.width*L,height:M.height*I,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(M.set({x:A+M.x*R,y:O+M.y*R,width:M.width*R,height:M.height*R}),M.type==="text"?M.set({fontSize:M.fontSize*R}):M.type==="figure"&&M.set({strokeWidth:M.strokeWidth*R})))})}v||(s.width=u),v||(s.height=c)}})).actions(s=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),s.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),s.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),s.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),s.moveElementsBottom([u])},play(){s.store.play({startTime:s.startTime,endTime:s.startTime+s.duration})}}))}(Uv)),Uv}var Hv={},A4;function ik(){return A4||(A4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const r=hl;e.Audio=r.types.model("Audio",{id:r.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(t))})).actions(t=>({set(n){Object.assign(t,n)}}))}(Hv)),Hv}var C4;function Im(){return C4||(C4=1,function(e){var r,t=Is&&Is.__createBinding||(Object.create?function(O,M,q,D){D===void 0&&(D=q);var te=Object.getOwnPropertyDescriptor(M,q);te&&!("get"in te?!M.__esModule:te.writable||te.configurable)||(te={enumerable:!0,get:function(){return M[q]}}),Object.defineProperty(O,D,te)}:function(O,M,q,D){D===void 0&&(D=q),O[D]=M[q]}),n=Is&&Is.__setModuleDefault||(Object.create?function(O,M){Object.defineProperty(O,"default",{enumerable:!0,value:M})}:function(O,M){O.default=M}),a=Is&&Is.__importStar||(r=function(O){return r=Object.getOwnPropertyNames||function(M){var q=[];for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(q[q.length]=D);return q},r(O)},function(O){if(O&&O.__esModule)return O;var M={};if(O!=null)for(var q=r(O),D=0;D<q.length;D++)q[D]!=="default"&&t(M,O,q[D]);return n(M,O),M}),i=Is&&Is.__rest||function(O,M){var q={};for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&M.indexOf(D)<0&&(q[D]=O[D]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var te=0;for(D=Object.getOwnPropertySymbols(O);te<D.length;te++)M.indexOf(D[te])<0&&Object.prototype.propertyIsEnumerable.call(O,D[te])&&(q[D[te]]=O[D[te]])}return q},o=Is&&Is.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=A;const s=hl,u=XC(),c=u0,h=o(Hs()),v=vs,g=KC(),f=ZC(),E=QC(),S=Rm(),w=a(Ih()),_=gc(),y=jf(),p=Mm(),m=f_(),P=ek(),T=rk(),k=nk(),L=p_(),I=Nh(),R=ik();function A({key:O,showCredit:M}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:M,_key:O})}(0,s.setLivelinessChecking)("ignore"),e.Font=s.types.model("Font",{fontFamily:s.types.string,url:s.types.optional(s.types.string,""),styles:s.types.frozen()}).preProcessSnapshot(O=>Object.assign(Object.assign({},O),{fontFamily:O.fontFamily||O.name})),e.Store=s.types.model("Store",{role:"",pages:s.types.array(L.Page),fonts:s.types.array(e.Font),audios:s.types.array(R.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:s.types.frozen(),selectedElementsIds:s.types.array(s.types.string),animatedElementsIds:s.types.array(s.types.string),history:s.types.optional(u.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(O=>{const M=(0,v.computed)(()=>{const q={};return(0,I.forEveryChild)({children:O.pages},D=>(q[D.id]=D,!1)),q},{keepAlive:!0});return{get _idsMap(){return M.get()}}}).views(O=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),O.bleedVisible},get selectedElements(){return O.selectedElementsIds.map(M=>{for(const q of O.pages)for(const D of q.children)if(D.id===M)return D}).filter(M=>!!M)},get children(){return O.pages},get selectedShapes(){const M=[];return(0,I.forEveryChild)({children:O.selectedElements},q=>{q.type!=="group"&&M.push(q)}),M},get activePage(){return O.pages.slice().find(M=>M.id===O._activePageId)||(O.pages.length?O.pages[0]:null)},get duration(){let M=0;return O.pages.forEach(q=>{M+=q.duration}),M},get _hasCroppedImages(){return O.find(M=>M.type==="image"&&M._cropModeEnabled)},find(M){let q;return(0,I.forEveryChild)({children:O.pages},D=>{if(!q&&M(D))return q=D,!0}),q},getElementById:M=>O._idsMap[M]})).actions(O=>{let M=0,q=null,D=!1;return{afterCreate(){O.history.canUndo},setCurrentTime(te){O.currentTime=te},_togglePlaying(te=!O.isPlaying){O.isPlaying=te},play({animatedElementsIds:te=[],startTime:H=0,currentTime:B=0,endTime:$=O.duration,repeat:V=!1}={}){B&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),H=B),O.animatedElementsIds=(0,s.cast)(te),O.currentTime=H,O.isPlaying=!0,M=Date.now(),q=$,D=V,requestAnimationFrame(O.seek)},checkActivePage(){let te=0;for(const H of O.pages){if(O.currentTime>=H.startTime&&O.currentTime<H.startTime+H.duration){O.selectPage(H.id);break}te+=H.duration}},seek(){if(!O.isPlaying)return;const te=Date.now(),H=te-M;M=te,O.currentTime+=H,O.checkActivePage();const B=q||O.duration;O.isPlaying&&O.currentTime<B?requestAnimationFrame(O.seek):O.isPlaying&&D?(O.currentTime=0,requestAnimationFrame(O.seek)):O.stop()},stop(){O.isPlaying=!1,O.currentTime=0,O.animatedElementsIds=(0,s.cast)([]),O.checkActivePage()}}}).actions(O=>({__(){O._validated||((0,S.validateKey)(O._key,O._forceShowCredit),O._validated=!0)},set(M){Object.assign(O,M)},setUnit({unit:M,dpi:q}){O.unit=M||O.unit,O.dpi=q||O.dpi},setRole(M){O.role=M},addPage(M){const q=L.Page.create(Object.assign({id:(0,c.nanoid)(10)},M));return O.pages.push(q),O._activePageId=q.id,q},selectPage(M){O._activePageId=M},selectElements(M){const q=M.map(D=>O.getElementById(D)).sort((D,te)=>D.page.children.indexOf(D)-D.page.children.indexOf(te)).filter(D=>!!D).map(D=>D.id);O.selectedElementsIds=(0,s.cast)(q)},toggleBleed(M){O.bleedVisible=M??!O.bleedVisible},toggleRulers(M){O.rulesVisible=M??!O.rulesVisible},openSidePanel(M){O.openedSidePanel!==M&&(O.previousOpenedSidePanel=O.openedSidePanel,O.openedSidePanel=M)},setScale(M){O.scale=M},_setScaleToFit(M){O.scaleToFit=M},setElementsPixelRatio(M){O._elementsPixelRatio=M},setSize(M,q,D){O.pages.forEach(te=>{te.setSize({width:M,height:q,useMagic:D,softChange:!0})}),O.width=M,O.height=q},setPageZIndex(M,q){const D=O.pages.find(te=>te.id===M);D&&((0,s.detach)(D),O.pages.remove(D),O.pages.splice(q,0,D))},deletePages(M){const q=O.pages.indexOf(O.activePage);M.forEach(H=>{const B=O.pages.find($=>$.id===H);(0,s.destroy)(B)});const D=Math.min(O.pages.length-1,q),te=O.pages[D];te&&(O._activePageId=te.id),O.selectedElementsIds=(0,s.cast)(O.selectedElementsIds.filter(H=>O.getElementById(H)))},groupElements(M,q={}){const D=M.map(B=>O.getElementById(B)),te=D[0].page;if(D.forEach(B=>{B&&(0,s.detach)(B)}),!D.length)return;const H=Object.assign({id:(0,c.nanoid)(10),children:D,type:"group"},q);return te.children.push(H),O.selectedElementsIds=(0,s.cast)([H.id]),te.children.find(B=>B.id===H.id)},ungroupElements(M){const q=M.map(te=>O.getElementById(te)),D=[];q.forEach(te=>{if(te&&te.type==="group"){const H=te.page,B=H.children.indexOf(te);te.children.forEach($=>{D.push($.id)}),te.children.forEach($=>{(0,s.detach)($),H.children.push($)}),H.children.splice(B,1)}}),O.selectedElementsIds=(0,s.cast)(D)},deleteElements(M){const q=[];O.find(D=>(M.includes(D.id)&&q.push(D),!1)),q.forEach(D=>{(0,s.destroy)(D)}),O.selectedElementsIds=(0,s.cast)(O.selectedElementsIds.filter(D=>O.getElementById(D)))},on(M,q){if(M==="change"){let D=O.toJSON();return(0,s.onSnapshot)(O,te=>{const H=O.toJSON();!(0,m.deepEqual)(D,H)&&(D=H,q(H))})}},async _toCanvas({pixelRatio:M,ignoreBackground:q,pageId:D,mimeType:te,includeBleed:H,_skipTimeout:B,quickMode:$=!1}={}){var V;const j=M||1;D=D||((V=O.pages[0])===null||V===void 0?void 0:V.id);const z=O.pages.find(he=>he.id===D);if(!z)throw new Error(`No page for export with id ${D}`);const F=O._elementsPixelRatio;j>O._elementsPixelRatio&&O.setElementsPixelRatio(j),$?z?.set({_forceMount:!0}):z?.set({_exporting:!0});const Y=await(0,P.waitTillAvailable)(()=>h.default.stages.find(he=>he.getAttr("pageId")===D));if(!Y)throw z?.set({_forceMount:!1,_exporting:!1}),O.setElementsPixelRatio(F),new Error(`Export is failed. Can not find stage for page ${D}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);await O.waitLoading({_skipTimeout:B});const J=Y.findOne(".page-container");if(!J)throw O.setElementsPixelRatio(F),z?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const X=Y.position();Y.position({x:0,y:0}),Y.find("Transformer").forEach(he=>{he.setAttr("oldVisible",he.visible()),he.visible(!1)}),J.find(".page-background").forEach(he=>he.shadowEnabled(!1)),J.find(".page-background").forEach(he=>he.strokeEnabled(!1)),J.find(".highlighter").forEach(he=>he.visible(!1));const Q=J.findOne(".page-background-group"),ae=Q.clip();Q.clip({x:null,y:null,width:null,height:null});const se=J.findOne(".elements-container"),fe=se.clip();se.clip({x:null,y:null,width:null,height:null});const be=J.find(he=>he.getAttr("hideInExport"));be.forEach(he=>{he.setAttr("oldVisible",he.visible()),he.hide()});const _e=J.find(he=>!he.visible()&&he.getAttr("editModeEnabled"));_e.forEach(he=>{he.setAttr("oldVisible",he.visible()),he.show()}),q&&J.find(".page-background").forEach(he=>he.hide());const Ae=H?z.bleed:0;let Re=Ae;!O.bleedVisible&&H||(O.bleedVisible||H?O.bleedVisible&&H?Re=0:O.bleedVisible&&!H&&(Re=-z.bleed):Re=0);const Pe=document.createElement("canvas");Pe.width=Math.round((z.computedWidth+2*Ae)*j),Pe.height=Math.round((z.computedHeight+2*Ae)*j);const ye=Pe.getContext("2d");te==="image/jpeg"&&(ye.fillStyle="white",ye.fillRect(0,0,Pe.width,Pe.height));const nt=J.scale();J.scale({x:1,y:1});const Ce=J.toCanvas({x:J.x()-Re,y:J.y()-Re,width:z.computedWidth+2*Ae,height:z.computedHeight+2*Ae,pixelRatio:j});return J.scale(nt),ye.drawImage(Ce,0,0,Pe.width,Pe.height),h.default.Util.releaseCanvas(Ce),q&&J.find(".page-background").forEach(he=>he.show()),be.forEach(he=>{he.visible(he.getAttr("oldVisible"))}),_e.forEach(he=>{he.visible(he.getAttr("oldVisible"))}),J.find(".page-background").forEach(he=>he.shadowEnabled(!0)),J.find(".page-background").forEach(he=>he.strokeEnabled(!0)),Y.find("Transformer").forEach(he=>{he.visible(he.getAttr("oldVisible"))}),J.find(".highlighter").forEach(he=>he.visible(!0)),Q.clip(ae),se.clip(fe),Y.position(X),z?.set({_exporting:!1,_forceMount:!1}),await new Promise(he=>setTimeout(he)),O.setElementsPixelRatio(F),Pe},async toDataURL(M={}){var{mimeType:q,quality:D}=M,te=i(M,["mimeType","quality"]);const H=await O._toCanvas(Object.assign({mimeType:q},te)),B=H.toDataURL(q,D);return h.default.Util.releaseCanvas(H),B},async toBlob(M={}){var{mimeType:q,quality:D}=M,te=i(M,["mimeType","quality"]);const H=await O._toCanvas(Object.assign({mimeType:q},te)),B=await new Promise($=>{H.toBlob($,q,D)});return h.default.Util.releaseCanvas(H),B},async saveAsImage(M={}){var{fileName:q}=M,D=i(M,["fileName"]);const te=D.mimeType||"image/png",H=te.split("/")[1];(0,g.downloadFile)(await O.toDataURL(D),q||"polotno."+H,te)},async _toPDF(M){const q=M.dpi||O.dpi,D=M.parallel||1,te=M.unit||(O.unit==="px"?"mm":O.unit),H=M.pixelRatio||1,B=M.pageIds||O.pages.map(be=>be.id),$=O.pages.filter(be=>B.includes(be.id)),V=await(0,f.getJsPDF)(),j=be=>(0,p.pxToUnit)({px:be,unit:te,dpi:q}),z=M.cropMarkSize||0,F=j(z),Y=$[0]||{},J=M.includeBleed?Y.bleed:0,X=j(Y.computedWidth+2*J+2*F),Q=j(Y.computedHeight+2*J+2*F);var ae=new V({unit:te,orientation:X>Q?"landscape":"portrait",format:[X,Q],compress:!0,putOnlyUsedFonts:!0});ae.deletePage(1);const se=((be,_e)=>{for(var Ae=[],Re=0;Re<be.length;Re+=_e)Ae.push(be.slice(Re,Re+_e));return Ae})($,D);let fe=0;for(const be of se){const _e=be.map(async Ae=>{const Re=M.includeBleed?Ae.bleed:0,Pe=Ae.computedWidth+2*Re+2*z,ye=Ae.computedHeight+2*Re+2*z,nt=j(Pe),Ce=j(ye);let he=0,ke=H;for(;he<10;){he+=1,he===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const Te=await O.toDataURL(Object.assign(Object.assign({},M),{pageId:Ae.id,pixelRatio:ke}));if(Te.length>20)return M.onProgress&&M.onProgress(++fe/B.length*.9),{url:Te,width:nt,height:Ce,widthPx:Pe,heightPx:ye};ke*=.8}});(await Promise.all(_e)).forEach(({url:Ae,width:Re,height:Pe,widthPx:ye,heightPx:nt})=>{ae.addPage([Re,Pe],Re>Pe?"landscape":"portrait");const Ce=ae.getCurrentPageInfo();var he;switch(te){case"pt":he=1;break;case"mm":he=72/25.4;break;case"cm":he=72/2.54;break;case"in":he=72;break;case"px":he=.75;break;case"pc":case"em":he=12;break;case"ex":he=6;break;default:throw"Invalid unit: "+te}if(Ce.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:Re*he,topRightY:Pe*he},Ce.pageContext.artBox={bottomLeftX:j(z+J)*he,bottomLeftY:j(z+J)*he,topRightX:j(ye-z-J)*he,topRightY:j(nt-z-J)*he},Ce.pageContext.bleedBox={bottomLeftX:j(z+J)*he,bottomLeftY:j(z+J)*he,topRightX:j(ye-z-J)*he,topRightY:j(nt-z-J)*he},F){ae.setLineWidth(j(1));const ke=F+j(J);ae.line(ke,0,ke,F),ae.line(0,ke,F,ke),ae.line(Re-ke,0,Re-ke,F),ae.line(Re,ke,Re-F,ke),ae.line(0,Pe-ke,F,Pe-ke),ae.line(ke,Pe,ke,Pe-F),ae.line(Re,Pe-ke,Re-F,Pe-ke),ae.line(Re-ke,Pe,Re-ke,Pe-F)}ae.addImage(Ae,F,F,Re-2*F,Pe-2*F,void 0,"FAST")})}return ae},toPDFDataURL:async M=>(await O._toPDF(Object.assign({mimeType:"image/jpeg"},M))).output("datauristring"),async toGIFDataURL(M={}){const q=M.pixelRatio||1,D=await(0,E.createGIF)({width:O.width*q,height:O.height*q}),te=1e3/(M.fps||10),H=O.duration/te;for(let B=0;B<H-1;B++){const $=B*te||1;O.setCurrentTime($);let V=0,j="";for(const F of O.pages)if(V+=F.duration,F.set({_rendering:V>$}),V>$){j=F.id;break}const z=await O._toCanvas({pixelRatio:q,pageId:j,_skipTimeout:!0});D.addFrame(z.getContext("2d"),{delay:te,copy:!0})}for(const B of O.pages)B.set({_rendering:!1});return O.stop(),D.render(),new Promise(B=>{D.on("finished",function($){(function(V,j){var z=new FileReader;z.onload=function(F){j(F.target.result)},z.readAsDataURL(V)})($,B)})})},async saveAsGIF(M={}){var{fileName:q}=M,D=i(M,["fileName"]);const te=await O.toGIFDataURL(D);(0,g.downloadFile)(te,q||"polotno.gif")},async toHTML({elementHook:M}={elementHook:void 0}){const q=O.toJSON();return(0,T.jsonToHTML)({json:q,elementHook:M})},async saveAsHTML({fileName:M}={}){const q=await O.toHTML(),D="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(q)));(0,g.downloadFile)(D,M||"polotno.html")},async toSVG({elementHook:M,pageId:q}={elementHook:void 0,pageId:void 0}){var D;const te=O.toJSON();q=q||((D=te.pages[0])===null||D===void 0?void 0:D.id);const H=te.pages.find(B=>B.id===q);return(0,k.jsonToSVG)({json:Object.assign(Object.assign({},te),{pages:H?[H]:[]}),elementHook:M})},async saveAsSVG({fileName:M,elementHook:q,pageId:D}={}){const te=await O.toSVG({elementHook:q,pageId:D}),H="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(te)));(0,g.downloadFile)(H,M||"polotno.svg")},async saveAsPDF(M={}){var{fileName:q}=M,D=i(M,["fileName"]);(await O._toPDF(Object.assign({mimeType:"image/jpeg"},D))).save(q||"polotno.pdf")},async waitLoading({_skipTimeout:M=!1}={}){M||await new Promise(q=>setTimeout(q,50)),await(0,y.whenLoaded)()},toJSON:()=>({width:O.width,height:O.height,fonts:(0,s.getSnapshot)(O.fonts),pages:(0,s.getSnapshot)(O.pages),audios:(0,s.getSnapshot)(O.audios),unit:O.unit,dpi:O.dpi,custom:O.custom,schemaVersion:O.schemaVersion}),loadJSON(M,q=!1){var D;const te=JSON.parse(JSON.stringify(M)),H=te.schemaVersion||0;H<1&&_.flags.htmlRenderEnabled&&(0,I.forEveryChild)({children:te.pages},j=>{if(j.type==="text"){const F=j.letterSpacing*16;j.letterSpacing=F/j.fontSize}}),H<2&&(0,I.forEveryChild)({children:te.pages},j=>{j.filters&&Object.keys(j.filters).forEach(z=>{if(["warm","cold","natural"].includes(z))return;const F=j.filters[z];F&&typeof F.intensity=="number"&&(F.intensity=F.intensity/100)})}),delete te.schemaVersion;const B=O.pages.indexOf(O.activePage);let $=(D=te.pages[B]||te.pages[0])===null||D===void 0?void 0:D.id;te._activePageId=$;const V=Object.assign({},(0,s.getSnapshot)(O));Object.assign(V,te),V.history=q?O.history.toJSON():{history:[],undoIdx:-1},(0,s.applySnapshot)(O,V)},clear({keepHistory:M=!1}={}){const q=O.pages.map(D=>D.id);O.deletePages(q),O.custom=null,M||O.history.clear()},addFont(M){O.removeFont(M.fontFamily),O.fonts.push(M),O.loadFont(M.fontFamily)},removeFont(M){O.fonts.filter(q=>q.fontFamily===M).forEach(q=>(0,s.destroy)(q))},addAudio(M){const q=R.Audio.create(Object.assign({id:(0,c.nanoid)(10)},M));O.audios.push(q)},removeAudio(M){const q=O.audios.find(D=>D.id===M);q&&O.audios.remove(q)},async loadFont(M){const q=O.fonts.find(te=>te.fontFamily===M)||w.globalFonts.find(te=>te.fontFamily===M);let D=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return q?(q.styles&&(D=q.styles.map(te=>({fontStyle:te.fontStyle||"normal",fontWeight:te.fontWeight||"normal"}))),w.injectCustomFont(q)):w.injectGoogleFont(M),Promise.all(D.map(te=>w.loadFont(M,te.fontStyle,te.fontWeight)))},validate:M=>e.Store.validate(M,[{path:"",type:e.Store}]).map(q=>({path:"store"+q.context.map(D=>D.path).join("."),message:q.message}))})),e.default=A}(Is)),Is}var k4;function g_(){return k4||(k4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const r=hl,t=u0,n=Im(),a=p_(),i=Nh();e.Node=r.types.model("Node",{id:r.types.identifier,type:"none",name:"",opacity:1,custom:r.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var s in o)o[s]===null&&(o[s]=void 0);return o}).postProcessSnapshot(o=>{const s=Object.assign({},o),u={};for(var c in s)c[0]!=="_"&&(u[c]=o[c]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,r.getParentOfType)(o,a.Page)},get store(){return(0,r.getParentOfType)(o,n.Store)},get top(){let s=o;for(;;){if(!(0,r.hasParentOfType)(s,i.GroupElement))return s;s=(0,r.getParentOfType)(s,i.GroupElement)}},get parent(){return(0,r.hasParentOfType)(o,i.GroupElement)?(0,r.getParentOfType)(o,i.GroupElement):(0,r.hasParentOfType)(o,a.Page)?(0,r.getParentOfType)(o,a.Page):(0,r.hasParentOfType)(o,n.Store)?(0,r.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(o))})).actions(o=>({clone(s={},{skipSelect:u=!1}={}){const c=JSON.parse(JSON.stringify(o.toJSON()));return s.id=s.id||(0,t.nanoid)(10),(0,i.forEveryChild)(c,h=>{h.id=(0,t.nanoid)(10)}),Object.assign(c,s),o.page.addElement(c,{skipSelect:u})},set(s){Object.assign(o,s)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(s){o.parent.setElementZIndex(o.id,s)},beforeDestroy(){}}))}(Lv)),Lv}var Vv={},Gv={},L4;function ak(){return L4||(L4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const r=Dh(),t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},n={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:i,animation:o})=>{const s=a/o.duration;return o.type==="enter"?{opacity:s*i.opacity}:{opacity:(1-s)*i.opacity}},rotate:({dTime:a,element:i,animation:o})=>{const s=a/o.duration*360;return(0,r.rotateAroundCenter)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation},s)},blink:({dTime:a,element:i,animation:o})=>{const s=o.duration,u=a%s/(s/2),c=u<=1?u:2-u;return{opacity:i.opacity*c}},bounce:({dTime:a,element:i,animation:o})=>{var s;const u=o.duration,c=u/2,h=(s=o.data.strength)!==null&&s!==void 0?s:1,v={},g={x:i.x+i.width/3*h,y:i.y+i.height/3*h,width:i.width/3*h,height:i.height/3*h,fontSize:i.fontSize/3*h},f={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize},E=a%u/c,S=E<=1?E:2-E;for(let w in g){const _=g[w],y=f[w]-_;v[w]=_+S*y}return v},move:({dTime:a,element:i,animation:o})=>{var s;const u=t[o.data.direction]||t.right,c=(s=o.data.strength)!==null&&s!==void 0?s:1,h={};for(var v in u.from){let g=u.from[v],f=u.to[v];o.type==="exit"&&(g=u.to[v],f=-u.from[v]),g*=c,f*=c;const E=i[v]+g,S=i[v]+f-E;h[v]=E+a/o.duration*S}return h},zoom:({dTime:a,element:i,animation:o})=>{var s;const u={},c=1+(((o.data.direction||"in")==="in"?.75:1.25)-1)*((s=o.data.strength)!==null&&s!==void 0?s:1),h=i.rotation*Math.PI/180,v=Math.cos(h),g=Math.sin(h),f=i.width*(1-c),E=i.height*(1-c),S=(f*v-E*g)/2,w=(f*g+E*v)/2,_={x:i.x+S,y:i.y+w,width:i.width*c,height:i.height*c,fontSize:i.fontSize*c},y={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize};for(var p in _){let m=_[p],P=y[p];if(o.type==="exit"){const k=m;m=P,P=k}const T=P-m;u[p]=m+a/o.duration*T}return u},cameraZoom:({dTime:a,element:i,animation:o})=>{var s,u,c;const h={},v=o.data.direction||"right",g=n[v]||n.right,f=(s=o.data.movementStrength)!==null&&s!==void 0?s:.1,E=(u=o.data.shakeStrength)!==null&&u!==void 0?u:.015;c=o.data.zoomStrength;const S=a/o.duration,w=E*(1-S),_=Math.sin(12*S)*w*.7+Math.sin(8*S)*w*.3;o.type==="exit"&&Math.max(i.cropWidth||1,i.cropHeight||1),o.type;const y=1-Math.pow(1-S,2),p=i.cropX||0,m=i.cropY||0,P=i.cropWidth||1,T=i.cropHeight||1,k=P,L=T;let I,R,A=0,O=0;if(g.cropX){const M=g.cropX>0?1-(p+P):p;A=Math.min(M,Math.abs(f))*g.cropX}if(g.cropY){const M=g.cropY>0?1-(m+T):m;O=Math.min(M,Math.abs(f))*g.cropY}return o.type==="enter"?(I=g.cropX?p+A*(1-y):p,R=g.cropY?m+O*(1-y):m):(I=g.cropX?p+A*y:p,R=g.cropY?m+O*y:m),h.cropX=Math.max(0,Math.min(1-k,I+_*k)),h.cropY=Math.max(0,Math.min(1-L,R+_*L)),h.cropWidth=k,h.cropHeight=L,h}},e.animate=({element:a,dTime:i,animation:o})=>{const s=e.animations[o.name];return s?s({element:a,dTime:i,animation:o}):(console.error("Can not find animation type: "+o.name),{})},e.registerAnimation=(a,i)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=i}}(Gv)),Gv}var N4;function Bh(){return N4||(N4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.INDEPENDENT_FILTERS=e.ShapeFilter=e.getDiff=e.Animation=void 0;const r=hl,t=ak(),n=vs,a=g_();e.Animation=r.types.model("Animation",{delay:0,duration:500,enabled:!0,type:r.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:r.types.frozen({})}),e.getDiff=(i,o)=>{const s={};for(const u in o)if(typeof i[u]=="number"&&typeof o[u]=="number"){const c=o[u]-i[u];c!==0&&(s[u]=c)}return s},e.ShapeFilter=r.types.model("ShapeFilter",{intensity:1}),e.INDEPENDENT_FILTERS=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:r.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:r.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(i=>{const o=Object.assign(Object.assign({},i),{x:i.x||0,y:i.y||0,filters:Array.isArray(i.filters)?{}:i.filters});return"width"in i&&(o.width=o.width||1),"height"in i&&(o.height=o.height||1),i.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(i=>{const o=(0,n.observable)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize}),s=(0,n.action)(c=>{Object.assign(o,c)}),u=(0,n.action)(c=>{for(const h in c)typeof o[h]=="number"&&(o[h]=o[h]+c[h])});return{get a(){const{currentTime:c}=i.store;if(s({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize,cropX:i.cropX,cropY:i.cropY,cropWidth:i.cropWidth,cropHeight:i.cropHeight}),c===0)return o;const h=c-i.page.startTime;if(h>i.page.duration||h<0)return o;const v=i.store.animatedElementsIds;if(v.length&&!v.includes(i.id))return o;const g=i.animations.find(_=>_.type==="enter"),f=g?.enabled&&h<g.delay;f&&s({opacity:0});const E=g?.enabled&&h>=g.delay&&h<=g.delay+g.duration;if(E){const _=h-g.delay,y=(0,t.animate)({element:i,animation:g,dTime:_}),p=(0,e.getDiff)(i,y);u(p)}const S=i.animations.find(_=>_.type==="exit");if(!f&&!E&&S?.enabled&&h>=i.page.duration-S.duration-S.delay&&h<=i.page.duration-S.delay){const _=h-(i.page.duration-S.duration-S.delay),y=(0,t.animate)({element:i,animation:S,dTime:_}),p=(0,e.getDiff)(i,y);u(p)}S?.enabled&&h>=i.page.duration-S.delay&&s({opacity:0});const w=i.animations.find(_=>_.type==="loop");if(w?.enabled){const _=h,y=(0,t.animate)({element:i,animation:w,dTime:_}),p=(0,e.getDiff)(i,y);u(p)}return o},animated:c=>i.a[c]}}).actions(i=>({setAnimation(o,s){const u=i.animations.find(c=>c.type===o);u?Object.assign(u,s):i.animations.push(Object.assign({type:o},s))},setFilter(o,s){e.INDEPENDENT_FILTERS.includes(o)||i.filters.forEach((u,c)=>{e.INDEPENDENT_FILTERS.includes(c.toString())||i.filters.delete(c.toString())}),s==null?i.filters.delete(o):i.filters.set(o,{intensity:s})}}))}(Vv)),Vv}var Wv={},T4;function ok(){return T4||(T4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const r=hl,t=Bh();e.TextElement=t.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:r.types.optional(r.types.union(r.types.number,r.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(a){n._editModeEnabled=a??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Wv)),Wv}var $v={},R4;function jm(){return R4||(R4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const r=Bh();e.ImageElement=r.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,stretchEnabled:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(n){t._cropModeEnabled=n??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}($v)),$v}var Yv={},M4;function sk(){return M4||(M4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const r=jm();e.VideoElement=r.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Yv)),Yv}var Xv={},I4;function lk(){return I4||(I4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const r=hl,t=Bh();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:r.types.array(r.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Xv)),Xv}var Kv={},j4;function uk(){return j4||(j4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const r=hl,t=Bh();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:r.types.map(r.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource,colorsReplace:Array.isArray(n.colorsReplace)?{}:n.colorsReplace})).actions(n=>({replaceColor(a,i){n.colorsReplace.set(a,i)}}))}(Kv)),Kv}var Zv={},F4;function ck(){return F4||(F4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=hl,t=Bh();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:r.types.array(r.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(Zv)),Zv}var Qv={},D4;function fk(){return D4||(D4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const r=jm();e.GifElement=r.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(Qv)),Qv}var B4;function Nh(){return B4||(B4=1,function(e){var r=Jd&&Jd.__rest||function(S,w){var _={};for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&w.indexOf(y)<0&&(_[y]=S[y]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var p=0;for(y=Object.getOwnPropertySymbols(S);p<y.length;p++)w.indexOf(y[p])<0&&Object.prototype.propertyIsEnumerable.call(S,y[p])&&(_[y[p]]=S[y[p]])}return _};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(S,w){const _=S.type;if(!_)throw new Error('You must pass "type" attribute to custom model.');let y=i.Shape.named(_).props(S);w&&(y=w(y)),e.TYPES_MAP[_]=y,E.push(y)};const t=hl,n=u0,a=g_(),i=Bh(),o=ok(),s=jm(),u=sk(),c=lk(),h=uk(),v=ck(),g=fk();e.forEveryChild=(S,w)=>{if(S.children)for(const _ of S.children){if(w(_)===!0)break;(0,e.forEveryChild)(_,w)}};const f=[...new Array(20)].map((S,w)=>t.types.late(()=>E[w]));e.ElementTypes=t.types.union({dispatcher:S=>{const w=e.TYPES_MAP[S.type];if(!w)throw new Error(`Unknown element type: "${S.type}"`);return w}},h.SVGElement,o.TextElement,s.ImageElement,c.LineElement,u.VideoElement,v.FigureElement,g.GifElement,t.types.late(()=>e.GroupElement),...f),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(S=>({get draggable(){let w=!0;return(0,e.forEveryChild)(S,_=>{_.draggable||(w=!1)}),w},get resizable(){let w=!0;return(0,e.forEveryChild)(S,_=>{_.resizable||(w=!1)}),w},get contentEditable(){let w=!0;return(0,e.forEveryChild)(S,_=>{_.contentEditable||(w=!1)}),w},get styleEditable(){let w=!0;return(0,e.forEveryChild)(S,_=>{_.styleEditable||(w=!1)}),w},get locked(){let w=!0;return(0,e.forEveryChild)(S,_=>{_.locked||(w=!1)}),w}})).actions(S=>({set(w){var{draggable:_,contentEditable:y,styleEditable:p,resizable:m}=w,P=r(w,["draggable","contentEditable","styleEditable","resizable"]);_!==void 0&&(0,e.forEveryChild)(S,T=>{T.set({draggable:_})}),y!==void 0&&(0,e.forEveryChild)(S,T=>{T.set({contentEditable:y})}),p!==void 0&&(0,e.forEveryChild)(S,T=>{T.set({styleEditable:p})}),m!==void 0&&(0,e.forEveryChild)(S,T=>{T.set({resizable:m})}),Object.assign(S,P)},addElement(w,{skipSelect:_=!1}={}){const y=e.TYPES_MAP[w.type];if(!y)return void console.error("Can not find model with type "+w.type);w.children&&w.children.forEach(m=>{m.id=m.id||(0,n.nanoid)(10)});const p=y.create(Object.assign({id:(0,n.nanoid)(10)},w));return S.children.push(p),p.selectable&&!_&&S.store.selectElements([p.id]),p},setElementZIndex(w,_){const y=S.children.find(p=>p.id===w);y&&((0,t.detach)(y),S.children.remove(y),S.children.splice(_,0,y))}}));const E=[];e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:s.ImageElement,group:e.GroupElement,line:c.LineElement,video:u.VideoElement,figure:v.FigureElement,gif:g.GifElement}}(Jd)),Jd}var q4;function hk(){return q4||(q4=1,function(e){var r=Dd&&Dd.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(m,P){_[m]=P};const t=r(ai()),n=Us,a=r(Hs()),i=V8(),o=Om(),s=jC(),u=FC(),c=o_(),h=DC(),v=HC(),g=Fu,f=VC(),E=Nh(),S=gc(),w=(0,n.observer)(m=>{const{element:P,store:T}=m,{children:k}=P,L=P.selectable||T.role==="admin";return t.default.createElement(g.Group,{opacity:P.opacity,listening:L,hideInExport:!P.showInExport},k.map(I=>t.default.createElement(p,Object.assign({},m,{key:I.id,store:T,element:I}))))}),_={text:i.TextElement,image:o.ImageElement,svg:o.ImageElement,line:u.LineElement,video:c.VideoElement,figure:h.FigureElement,group:w,gif:v.GifElement},y=(m,P)=>{const T=[];(0,E.forEveryChild)(m,q=>{q.type!=="group"&&T.push(q.a)});const k=[];T.forEach(q=>{const D=[{x:0,y:0},{x:0+q.width,y:0},{x:0+q.width,y:0+q.height},{x:0,y:0+q.height}],te=new a.default.Transform;te.translate(q.x,q.y),te.rotate(a.default.Util.degToRad(q.rotation)),D.forEach(H=>{const B=te.point(H);k.push(B)})});const L=new a.default.Transform;L.rotate(-a.default.Util.degToRad(P));let I=1/0,R=1/0,A=-1/0,O=-1/0;k.forEach(q=>{const D=L.point(q);I=Math.min(I,D.x),R=Math.min(R,D.y),A=Math.max(A,D.x),O=Math.max(O,D.y)}),L.invert();const M=L.point({x:I,y:R});return{x:M.x,y:M.y,width:A-I,height:O-R,rotation:P}},p=(0,n.observer)(m=>{const{element:P,store:T}=m,[k,L]=t.default.useState(!1),I=T.selectedElements.indexOf(P)>=0&&P.selectable,R=P.parent.type==="group",A=(q=>{const[D,te]=t.default.useState(null);return t.default.useEffect(()=>{const H=setTimeout(()=>{const B=q.page.id,$=a.default.stages.find(V=>V.getAttr("pageId")===B);$||console.error("No stage is found for element",q.id),te($)});return()=>clearTimeout(H)},[q.id]),D})(P),O=A?.findOne("Transformer");t.default.useEffect(()=>{if(A){const q=te=>{const H=te.target.findAncestor(".element",!0),B=T.getElementById(H?.id()),$=B?.top,V=$?.id;L(V===P.id)};A.on("mouseover",q);const D=()=>{L(!1)};return A.on("mouseleave",D),()=>{A.off("mouseover",q),A.off("mouseleave",D)}}},[A]);let M=_[m.element.type];return m.element.type==="text"&&S.flags.htmlRenderEnabled&&(M=s.HTMLElement),m.element.visible?M?t.default.createElement(t.default.Fragment,null,t.default.createElement(M,Object.assign({},m)),(k||I)&&!R&&t.default.createElement(f.Highlighter,{element:P.type==="group"?{a:y(P,O?.rotation()||0)}:P})):(console.error("Can not find component for "+m.element.type),null):null});e.default=p}(Dd)),Dd}var Jv={},z4;function dk(){return z4||(z4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=function(r,t,n="scale"){const a=t.width/t.height;let i,o;a>=r.width/r.height?(i=r.width,o=r.width/a):(i=r.height*a,o=r.height);let s=0,u=0;return n==="left-top"?(s=0,u=0):n==="left-middle"?(s=0,u=(r.height-o)/2):n==="left-bottom"?(s=0,u=r.height-o):n==="center-top"?(s=(r.width-i)/2,u=0):n==="center-middle"?(s=(r.width-i)/2,u=(r.height-o)/2):n==="center-bottom"?(s=(r.width-i)/2,u=r.height-o):n==="right-top"?(s=r.width-i,u=0):n==="right-middle"?(s=r.width-i,u=(r.height-o)/2):n==="right-bottom"?(s=r.width-i,u=r.height-o):n==="scale"?(s=0,u=0,i=r.width,o=r.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:s,cropY:u,cropWidth:i,cropHeight:o}}}(Jv)),Jv}var U4;function pk(){return U4||(U4=1,function(e){var r=yf&&yf.__rest||function(F,Y){var J={};for(var X in F)Object.prototype.hasOwnProperty.call(F,X)&&Y.indexOf(X)<0&&(J[X]=F[X]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function"){var Q=0;for(X=Object.getOwnPropertySymbols(F);Q<X.length;Q++)Y.indexOf(X[Q])<0&&Object.prototype.propertyIsEnumerable.call(F,X[Q])&&(J[X[Q]]=F[X[Q]])}return J},t=yf&&yf.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(F,Y){R[F]=R[F]||Y,Object.assign(R[F],Y)};const n=t(ai()),a=Us,i=vs,o=Fu,s=t(t0()),u=t(Hs()),c=t(hk()),h=a_(),v=Om(),g=dk(),f=Rm(),E=Dh(),S=Mm(),w=gc(),_=rf(),y=Op(),p=pm(),m=Mh,P=u.default.DD._drag;window.removeEventListener("mousemove",P),u.default.DD._drag=function(F){(0,i.runInAction)(()=>{P.call(this,F)})},window.addEventListener("mousemove",u.default.DD._drag);const T=new u.default.Group,k=20;T.add(new u.default.Rect({width:k,height:k,fill:"white"})),T.add(new u.default.Path({scaleX:k/24,scaleY:k/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 L=T.toCanvas({pixelRatio:2,width:k,height:k}),I={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:F=>{F.hasName("rotater")&&F.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:L,fillPatternScaleX:20/k/2,fillPatternScaleY:20/k/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=F=>{Object.assign(I,F)};const R={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"]}},A=F=>n.default.createElement(o.Rect,Object.assign({},F,{preventDefault:!1})),O=F=>{var{url:Y}=F,J=r(F,["url"]);const[X,Q]=(0,s.default)(Y,"anonymous"),ae=X?(0,g.getCrop)(X,{width:J.width,height:J.height},"center-middle"):{};return(0,v.useImageLoader)(Q,Y,"page background"),n.default.createElement(o.Image,Object.assign({image:X},J,ae))},M=F=>{const Y=(0,y.useColor)({fill:F.fill,a:{width:F.width,height:F.height}});return n.default.createElement(o.Rect,Object.assign({},F,Y))},q=F=>{const{background:Y,scale:J,borderColor:X}=F,Q=r(F,["background","scale","borderColor"]),ae=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(Y)||(0,p.isGradient)(Y),[Y]),se=n.default.useMemo(()=>{const fe=document.createElement("canvas"),be=30;fe.width=60,fe.height=60;const _e=fe.getContext("2d");return _e&&(_e.fillStyle="black",_e.fillRect(be,0,be,be),_e.fillRect(0,be,be,be)),fe},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:se},Q,{opacity:.1,hideInExport:!0})),ae?n.default.createElement(M,Object.assign({fill:Y},Q)):n.default.createElement(O,Object.assign({url:Y},Q)))},D=(0,a.observer)(({selection:F,fill:Y="rgba(0, 161, 255, 0.3)",stroke:J="rgb(0, 161, 255)",strokeWidth:X=1})=>F.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(F.x1,F.x2),y:Math.min(F.y1,F.y2),width:Math.abs(F.x1-F.x2),height:Math.abs(F.y1-F.y2),fill:Y,stroke:J,strokeWidth:X}):null),te=(0,a.observer)(({x:F,y:Y,width:J,height:X,rotation:Q,anchor:ae,store:se,tagFill:fe,textFill:be})=>{const _e=(0,E.getClientRect)({x:F,y:Y,width:J,height:X,rotation:u.default.Util.radToDeg(Q)});if(ae===void 0)return null;const Ae=(X/2+70)*Math.cos(Q-Math.PI/2),Re=(X/2+70)*Math.sin(Q-Math.PI/2),Pe=(0,S.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:J/se.scale,precious:se.unit==="px"?0:1})+" x "+(0,S.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:X/se.scale,precious:se.unit==="px"?0:1})+(se.unit==="px"?"":" "+se.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(_e.minX+_e.maxX)/2+Ae,y:(_e.minY+_e.maxY)/2+Re,offsetX:14,offsetY:14,visible:ae==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:fe||"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:be||"white",padding:8,text:Math.round(u.default.Util.radToDeg(Q)).toString()+"°"})),n.default.createElement(o.Label,{x:(_e.minX+_e.maxX)/2,y:_e.maxY+20,visible:ae!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:fe||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:be||"white",padding:8,text:Pe})))}),H=(0,a.observer)(({elements:F,store:Y})=>{const J=F.filter(Q=>Q.alwaysOnTop),X=F.filter(Q=>!Q.alwaysOnTop).concat(J);return n.default.createElement(n.default.Fragment,null,X.map(Q=>n.default.createElement(c.default,{key:Q.id,store:Y,element:Q,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:F})=>{const[Y,J]=n.default.useState(!1),[X,Q]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(se=>{J(!0),Q(se)},[]),close:n.default.useCallback(()=>{J(!1)},[]),props:{isOpen:Y,offset:X,setIsOpen:J}}};let B=null;e.registerNextDomDrop=F=>{B=F};const $=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),V=atob("cmVk"),j=atob("djAuOS4y"),z=F=>n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{fill:V,height:200},n.default.createElement(o.Tag,{fill:V}),n.default.createElement(o.Text,Object.assign({},F,{fill:"white",text:$,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:F,page:Y,width:J,height:X,pageControlsEnabled:Q,backColor:ae,pageBorderColor:se,activePageBorderColor:fe,components:be,bleedColor:_e,altCloneEnabled:Ae,viewportSize:Re,selectionRectFill:Pe,selectionRectStroke:ye,selectionRectStrokeWidth:nt,snapGuideStroke:Ce,snapGuideStrokeWidth:he,snapGuideDash:ke,transformLabelFill:Te,transformLabelTextFill:ve})=>{const Se=F.bleedVisible?Y.bleed:0,je=Y.computedWidth+2*Se,Ue=Y.computedHeight+2*Se,ct=(J-je*F.scale)/2,mt=(X-Ue*F.scale)/2,yt=n.default.useRef(null),Je=n.default.useRef(null),lt=n.default.useRef(null),ze=Q==null||Q,[kt,pt]=n.default.useState(null),[Ut,Ht]=n.default.useState({}),Me=(0,e.useContextMenu)({store:F}),Oe=F.selectedElements.find(ut=>ut._cropModeEnabled),it=F.selectedShapes.filter(ut=>!ut.resizable).length>0,Lt=F.selectedShapes.filter(ut=>!ut.draggable).length>0,At=F.selectedElements.filter(ut=>!ut.visible).length>0;n.default.useLayoutEffect(()=>{var ut,St,Et;if(!yt.current)return;const et=yt.current.getStage(),qt=F.selectedShapes.map(Ft=>Ft._cropModeEnabled?null:et.findOne("#"+Ft.id)).filter(Ft=>Ft),gt=F.selectedElements.length===1&&((ut=F.selectedElements[0])===null||ut===void 0?void 0:ut.type)||"many";R[gt]?(yt.current.setAttrs(Object.assign(Object.assign({},I),R[gt])),gt!=="svg"&>!=="image"&>!=="gif"||F.selectedElements[0].keepRatio||yt.current.setAttrs({enabledAnchors:I.enabledAnchors}),gt==="text"&&w.flags.textVerticalResizeEnabled&&yt.current.setAttrs({enabledAnchors:(St=R.text.enabledAnchors)===null||St===void 0?void 0:St.concat(["bottom-center"])})):yt.current.setAttrs(I),it&&yt.current.enabledAnchors([]),Lt&&yt.current.rotateEnabled(!1),qt.find(Ft=>Ft?.isDragging())&&qt.forEach(Ft=>{Ft.isDragging()||Ft==null||Ft.startDrag()}),yt.current.nodes(qt),(Et=yt.current.getLayer())===null||Et===void 0||Et.batchDraw()},[F.selectedShapes,Oe,it,At,Lt]);const xt=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Jt=n.default.useRef(!1),nr=(0,_.isTouchDevice)(),Rt=(0,i.action)(ut=>{var St,Et,et,qt;if(nr)return;Jt.current=!1;const gt=ut.target.findAncestor(".elements-container"),Ft=ut.target.findAncestor("Transformer"),br=ut.target.findAncestor(".page-abs-container");if(gt||Ft||br)return;const hr=(St=ut.target.getStage())===null||St===void 0?void 0:St.getPointerPosition();hr.x-=(Et=ut.target.getStage())===null||Et===void 0?void 0:Et.x(),hr.y-=(et=ut.target.getStage())===null||et===void 0?void 0:et.y(),hr&&(xt.visible=!0,xt.x1=hr.x,xt.y1=hr.y,xt.x2=hr.x,xt.y2=hr.y,((qt=ut.target.getStage())===null||qt===void 0?void 0:qt.getPointersPositions().length)>=2&&(xt.visible=!1))});(({stageRef:ut,containerRef:St,viewportSize:Et})=>{n.default.useEffect(()=>{var et;const qt=(et=St.current)===null||et===void 0?void 0:et.closest(".polotno-workspace-inner");function gt(){var Ft;if(!ut.current)return;const br=(Ft=St.current)===null||Ft===void 0?void 0:Ft.getBoundingClientRect(),hr=qt?.getBoundingClientRect(),Qr=Math.max(0,hr.left-br.left-100),Sn=Math.max(0,hr.top-br.top-100);ut.current.position({x:-Qr,y:-Sn}),ut.current.container().style.transform=`translate(${Qr}px, ${Sn}px)`}return gt(),qt.addEventListener("scroll",gt),()=>{qt.removeEventListener("scroll",gt)}},[Et.width,Et.height])})({stageRef:Je,containerRef:lt,viewportSize:Re}),n.default.useEffect(()=>{const ut=(0,i.action)(Et=>{var et,qt,gt,Ft;if(!xt.visible)return;(et=Je.current)===null||et===void 0||et.setPointersPositions(Et);let br=(qt=Je.current)===null||qt===void 0?void 0:qt.getPointerPosition();br?(br.x-=(gt=Je.current)===null||gt===void 0?void 0:gt.x(),br.y-=(Ft=Je.current)===null||Ft===void 0?void 0:Ft.y()):br={x:xt.x2,y:xt.y2},xt.x2=br.x,xt.y2=br.y}),St=(0,i.action)(()=>{if(!xt.visible||!Je.current)return;const Et=Je.current.findOne(".selection"),et=Et?Et.getClientRect():{width:0,height:0,x:0,y:0};if(et.width&&et.height){const qt=[];Je.current.find(".element").forEach(Ft=>{const br=Ft.getClientRect(),hr=F.getElementById(Ft.id()),Qr=hr?.draggable,Sn=hr?.selectable;u.default.Util.haveIntersection(et,br)&&Qr&&Sn&&qt.push(hr.top.id)});const gt=[...new Set(qt)];F.selectElements(gt)}xt.visible=!1,Jt.current=!0});return window.addEventListener("mousemove",ut),window.addEventListener("touchmove",ut),window.addEventListener("mouseup",St),window.addEventListener("touchend",St),()=>{window.removeEventListener("mousemove",ut),window.removeEventListener("touchmove",ut),window.removeEventListener("mouseup",St),window.removeEventListener("touchend",St)}},[]);const Xt=n.default.useRef(!1);n.default.useEffect(()=>{var ut;let St;const Et=(ut=lt.current)===null||ut===void 0?void 0:ut.closest(".polotno-workspace-inner"),et=()=>{Xt.current=!0,clearTimeout(St),St=setTimeout(()=>{Xt.current=!1},300)};return Et.addEventListener("scroll",et),()=>{clearTimeout(St),Et.removeEventListener("scroll",et)}},[]);const Rr=ut=>{if(F.activePage!==Y&&Y.select(),Xt.current||Jt.current)return;const St=ut.evt.ctrlKey||ut.evt.metaKey||ut.evt.shiftKey,Et=ut.target.findAncestor(".elements-container"),et=ut.target.findAncestor(".page-abs-container"),qt=ut.target.findAncestor("Transformer");if(!(St||Et||qt||et))return void F.selectElements([]);const gt=ut.target.findAncestor(".element",!0),Ft=F.getElementById(gt?.id()),br=Ft?.top,hr=br?.id,Qr=F.selectedElementsIds.indexOf(hr)>=0;hr&&St&&!Qr?F.selectElements(F.selectedElementsIds.concat([hr])):hr&&St&&Qr?F.selectElements(F.selectedElementsIds.filter(Sn=>Sn!==hr)):!hr||St||Qr||F.selectElements([hr])};(0,h.useSnap)(yt,F,{stroke:Ce,strokeWidth:he,dash:ke});const Ze=F.activePage===Y,bt=be?.PageControls,Vt=be?.Tooltip,wt=be?.ContextMenu,Kt=1/F.scale,Yt=0/F.scale;return n.default.createElement("div",{ref:lt,onDragOver:ut=>ut.preventDefault(),onDrop:ut=>{if(ut.preventDefault(),!Je.current)return;Je.current.setPointersPositions(ut);const St=Je.current.findOne(".elements-container").getRelativePointerPosition(),Et=Je.current.getPointerPosition(),et=Je.current.getAllIntersections(Et).map(Ft=>Ft.findAncestor(".element",!0)).filter(Boolean),qt=[...new Set(et.reverse())].map(Ft=>F.getElementById(Ft.id())),gt=qt[0];B&&(B(St,gt,{elements:qt,page:Y}),B=null)},style:{position:"relative",width:J+"px",height:X+"px",overflow:"hidden"},className:"polotno-page-container"+(Ze?" active-page":"")},n.default.createElement(o.Stage,{ref:Je,width:Math.min(J,Re.width+200),height:Math.min(Re.height+200,X),onClick:Rr,onTap:Rr,onContextMenu:ut=>{ut.evt.preventDefault();const St=ut.target.findAncestor(".element",!0),Et=F.getElementById(St?.id()),et=Et?.top,qt=et?.id;qt?F.selectedElementsIds.indexOf(qt)>=0||F.selectElements([qt]):F.selectElements([]),Me.open({x:ut.evt.clientX,y:ut.evt.clientY})},onMouseDown:Rt,onMouseMove:ut=>{if(!ut.evt.altKey&&kt)return void pt(null);if(!ut.evt.altKey)return;const St=ut.target.findAncestor(".element",!0),Et=St?.id();if(!F.selectedElements[0]||F.selectedElementsIds.includes(Et))return;const et=(0,E.getTotalClientRect)(F.selectedShapes),qt=Et?F.getElementById(Et):{x:0,y:0,width:Y.computedWidth,height:Y.computedHeight,rotation:0},gt=(0,E.getClientRect)(qt),Ft=[];et.minX>gt.maxX&&Ft.push({distance:et.minX-gt.maxX,box1:et,box2:gt,points:[{x:et.minX,y:et.minY+et.height/2},{x:gt.maxX,y:et.minY+et.height/2},{x:gt.maxX,y:gt.minY+gt.height/2}]}),et.maxX<gt.minX&&Ft.push({distance:gt.minX-et.maxX,box1:et,box2:gt,points:[{x:et.maxX,y:et.minY+et.height/2},{x:gt.minX,y:et.minY+et.height/2},{x:gt.minX,y:gt.minY+gt.height/2}]}),et.minY>gt.maxY&&Ft.push({box1:et,box2:gt,distance:et.minY-gt.maxY,points:[{x:et.minX+et.width/2,y:et.minY},{x:et.minX+et.width/2,y:gt.maxY},{x:gt.minX+gt.width/2,y:gt.maxY}]}),et.maxY<gt.minY&&Ft.push({box1:et,box2:gt,distance:gt.minY-et.maxY,points:[{x:et.minX+et.width/2,y:et.maxY},{x:et.minX+et.width/2,y:gt.minY},{x:gt.minX+gt.width/2,y:gt.minY}]}),et.minX>=gt.minX&&et.maxX<=gt.maxX&&et.minY>=gt.minY&&et.maxY<=gt.maxY&&(Ft.push({distance:et.minX-gt.minX,box1:et,box2:gt,points:[{x:et.minX,y:et.minY+et.height/2},{x:gt.minX,y:et.minY+et.height/2},{x:gt.minX,y:gt.minY+gt.height/2}]}),Ft.push({distance:gt.maxX-et.maxX,box1:et,box2:gt,points:[{x:et.maxX,y:et.minY+et.height/2},{x:gt.maxX,y:et.minY+et.height/2},{x:gt.maxX,y:gt.minY+gt.height/2}]}),Ft.push({box1:et,box2:gt,distance:et.minY-gt.minY,points:[{x:et.minX+et.width/2,y:et.minY},{x:et.minX+et.width/2,y:gt.minY},{x:gt.minX+gt.width/2,y:gt.minY}]}),Ft.push({box1:et,box2:gt,distance:gt.maxY-et.maxY,points:[{x:et.minX+et.width/2,y:et.maxY},{x:et.minX+et.width/2,y:gt.maxY},{x:gt.minX+gt.width/2,y:gt.maxY}]})),JSON.stringify(kt)!==JSON.stringify(Ft)&&pt(Ft)},onDragStart:ut=>{var St;const Et=ut.target.findAncestor(".element",!0);if(Et){const et=F.getElementById(Et?.id()),qt=et?.top,gt=qt?.id;!(F.selectedElementsIds.indexOf(gt)>=0)&>&&(F.selectElements([gt]),ut.target.stopDrag(),ut.target.startDrag(ut),(St=yt.current)===null||St===void 0||St.startDrag(ut))}kt&&pt(null)},pageId:Y.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},n.default.createElement(o.Layer,null,n.default.createElement(A,{width:J,height:X,fill:ae}),n.default.createElement(o.Group,{x:ct,y:mt,scaleX:F.scale,scaleY:F.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:Se,y:Se},n.default.createElement(q,{x:-Y.bleed,y:-Y.bleed,width:Y.computedWidth+2*Y.bleed,height:Y.computedHeight+2*Y.bleed,background:Y.background,name:"page-background",preventDefault:!1,scale:F.scale})),n.default.createElement(o.Group,{x:Se,y:Se,name:"elements-container",listening:!F.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:Y.computedWidth,height:Y.computedHeight,listening:!1}),n.default.createElement(H,{elements:Y.children,store:F})),n.default.createElement(o.Rect,{stroke:_e,name:"bleed",strokeWidth:Y.bleed,x:Y.bleed/2,y:Y.bleed/2,width:Y.computedWidth+Y.bleed,height:Y.computedHeight+Y.bleed,listening:!1,visible:Y.bleed>0&&F.bleedVisible,hideInExport:!0}),(0,f.___)()===j&&n.default.createElement(z,{name:"hit-detection",x:-Kt/2-Yt,y:-Kt/2-Yt,width:je+Kt+2*Yt,height:Ue+Kt+2*Yt}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,J,0,J,X,0,X,0,0,ct,mt,ct,X-mt,J-ct,X-mt,J-ct,mt,ct,mt],listening:!1,closed:!0,fill:ae}),n.default.createElement(o.Group,{x:ct,y:mt,scaleX:F.scale,scaleY:F.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Kt/2-Yt,y:-Kt/2-Yt,width:je+Kt+2*Yt,height:Ue+Kt+2*Yt,stroke:Ze&&F.pages.length>1?fe:se,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ct+Se*F.scale,y:mt+Se*F.scale,scaleX:F.scale,scaleY:F.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:yt,onDragStart:ut=>{var St;!((St=ut.evt)===null||St===void 0)&&St.altKey&&Ae&&F.selectedElements.forEach(Et=>{const et=Et.clone({},{skipSelect:!0}),qt=Y.children.indexOf(Et);Y.setElementZIndex(et.id,qt)}),F.history.startTransaction()},onDragEnd:()=>{F.history.endTransaction()},onTransformStart:()=>{F.history.startTransaction(),pt(null)},boundBoxFunc:(ut,St)=>{const Et=Math.abs(St.width)<1||Math.abs(St.height)<1,et=Math.abs(ut.width)<1||Math.abs(ut.height)<1;return Et&&!et?ut:St},onTransform:ut=>{var St,Et;const et=yt.current.nodes(),qt=et[et.length-1];if(ut.target!==qt)return;const gt=(St=yt.current)===null||St===void 0?void 0:St.__getNodeRect(),Ft=(Et=yt.current)===null||Et===void 0?void 0:Et.getActiveAnchor();Ht({anchor:Ft,x:gt.x,y:gt.y,rotation:gt.rotation,width:gt.width,height:gt.height})},onTransformEnd:ut=>{Ht({}),F.history.endTransaction()},visible:!F.isPlaying}),kt&&kt.map(({points:ut,distance:St,box1:Et,box2:et},qt)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:qt,listening:!1},n.default.createElement(o.Rect,Object.assign({},Et,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},et,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[ut[0].x,ut[0].y,ut[1].x,ut[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[ut[1].x,ut[1].y,ut[2].x,ut[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(ut[0].x+ut[1].x)/2,y:(ut[0].y+ut[1].y)/2,offsetY:-10,scaleX:1/F.scale,scaleY:1/F.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,S.pxToUnitString)({unit:F.unit,dpi:F.dpi,px:St})})))),Y._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:je,height:Ue,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:je,height:Ue,align:"center",verticalAlign:"middle"})),Vt&&n.default.createElement(Vt,{components:be,store:F,page:Y,stageRef:Je}),wt&&n.default.createElement(m.Html,null,n.default.createElement(wt,Object.assign({components:be,store:F},Me.props)))),n.default.createElement(te,Object.assign({},Ut,{store:F,tagFill:Te,textFill:ve})),n.default.createElement(D,{selection:xt,fill:Pe,stroke:ye,strokeWidth:nt}),(0,f.isCreditVisible)()&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:J-170,y:X-18,onMouseEnter:ut=>{ut.target.getStage().container().style.cursor="pointer"},onMouseLeave:ut=>{ut.target.getStage().container().style.cursor=""},onTouchStart:ut=>{ut.cancelBubble=!0},onMouseDown:ut=>{ut.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),ze&&bt&&n.default.createElement(bt,{store:F,page:Y,xPadding:ct,yPadding:mt}))})}(yf)),yf}var ep={},H4;function gk(){return H4||(H4=1,function(e){var r=ep&&ep.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=r(ai()),n=Dh(),a=Mm(),i=Us,o=i_(),s=(0,o.styled)("div",t.default.forwardRef)`
|
|
393
|
+
position: absolute;
|
|
394
|
+
top: 0;
|
|
395
|
+
left: 0;
|
|
396
|
+
pointer-events: none;
|
|
397
|
+
`,u=(0,o.styled)("div",t.default.forwardRef)`
|
|
398
|
+
height: 14px;
|
|
399
|
+
position: sticky;
|
|
400
|
+
font-size: 8px;
|
|
401
|
+
line-height: 14px;
|
|
402
|
+
top: 0;
|
|
403
|
+
left: 0;
|
|
404
|
+
color: grey;
|
|
405
|
+
border-bottom: 1px solid grey;
|
|
406
|
+
background-color: #e8e8e8;
|
|
407
|
+
overflow: hidden;
|
|
408
|
+
`,c=(0,o.styled)("div",t.default.forwardRef)`
|
|
409
|
+
left: 0;
|
|
410
|
+
width: 14px;
|
|
411
|
+
position: sticky;
|
|
412
|
+
font-size: 8px;
|
|
413
|
+
line-height: 14px;
|
|
414
|
+
color: grey;
|
|
415
|
+
border-right: 1px solid grey;
|
|
416
|
+
background-color: #e8e8e8;
|
|
417
|
+
overflow: hidden;
|
|
418
|
+
`,h=(0,o.styled)("div",t.default.forwardRef)`
|
|
419
|
+
position: absolute;
|
|
420
|
+
border-left: 1px solid grey;
|
|
421
|
+
padding-left: 2px;
|
|
422
|
+
`,v=(0,o.styled)("div",t.default.forwardRef)`
|
|
423
|
+
position: absolute;
|
|
424
|
+
left: 14px;
|
|
425
|
+
border-left: 1px solid grey;
|
|
426
|
+
padding-left: 2px;
|
|
427
|
+
transform: rotate(90deg);
|
|
428
|
+
transform-origin: left top;
|
|
429
|
+
overflow: hidden;
|
|
430
|
+
`,g=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,i.observer)(({store:f,width:E,height:S})=>{const w=t.default.useRef(null);if(!f.activePage)return null;const _=f.activePage,y=(f.bleedVisible&&_.bleed,_.computedWidth*f.scale),p=_.computedHeight*f.scale,m=(E-y)/2,P=(T=A=>(0,a.unitToPx)({unitVal:A,dpi:f.dpi,unit:f.unit})*f.scale,g.find(A=>T(A)>30)||1e4);var T;const k=(0,a.unitToPx)({unitVal:P,dpi:f.dpi,unit:f.unit})*f.scale,L=Math.round(y/k)+1,I=Math.round(p/k)+1,R=(0,n.getTotalClientRect)(f.selectedShapes);return t.default.createElement(s,{ref:w,className:"polotno-rulers"},t.default.createElement(u,{style:{width:E+"px"},className:"polotno-x-ruler"},[...Array(L)].map((A,O)=>t.default.createElement(h,{key:O,style:{left:m+O*k+"px",width:k+"px"}},f.unit==="px"||P>=1?Math.round(P*O):(P*O).toFixed(1))),!!f.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:m+R.x*f.scale+"px",height:"14px",width:R.width*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),f.pages.map((A,O)=>{var M;const q=A.computedHeight*f.scale,D=(S-q)/2;return t.default.createElement(c,{key:A.id,style:{height:S+"px"},className:"polotno-y-ruler"},[...Array(I)].map((te,H)=>t.default.createElement(v,{key:H,style:{top:D+H*k-14+"px",width:k+"px"}},f.unit==="px"||P>=1?Math.round(P*H):(P*H).toFixed(1))),((M=f.selectedShapes[0])===null||M===void 0?void 0:M.page)===A&&t.default.createElement("div",{style:{position:"absolute",top:D+R.y*f.scale-14+"px",width:"14px",height:R.height*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(ep)),ep}var tp={},V4;function vk(){return V4||(V4=1,function(e){var r=tp&&tp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=r(ai()),n=Us,a=vs;e.AudioElement=(0,n.observer)(({audio:i,store:o})=>{const[s,u]=function(c){const[h,v]=t.default.useState(null),[g,f]=t.default.useState("loading");return t.default.useEffect(()=>{const E=new Audio(c),S=()=>{f("loaded"),v(E)},w=()=>{f("failed"),v(null)};return E.addEventListener("canplay",S),E.addEventListener("error",w),()=>{E.removeEventListener("canplay",S),E.removeEventListener("error",w)}},[c]),[h,g]}(i.src);return t.default.useEffect(()=>{s&&o.history.ignore(()=>{i.set({duration:1e3*s.duration})})},[s,i,o.history]),t.default.useEffect(()=>{if(!s)return;const c=()=>{s.currentTime=i.startTime*i.duration/1e3},h=()=>{const g=i.endTime*i.duration/1e3;s.currentTime>=g&&(s.pause(),s.currentTime=i.startTime*i.duration/1e3)};s.addEventListener("ended",c),s.addEventListener("timeupdate",h);const v=(0,a.autorun)(()=>{const g=o.animatedElementsIds;if(g.length&&!g.includes(i.id))return;const f=o.currentTime-i.delay,E=i.duration*(i.endTime-i.startTime),S=f>=0&&f<E;if(!o.isPlaying||o.animatedElementsIds.length!==0||!S)return void s.pause();s.volume=i.volume,s.paused&&s.play();const w=f%E/1e3+i.startTime*i.duration/1e3,_=s.currentTime;Math.abs(_-w)>.5&&w!==_&&(s.currentTime=w)});return()=>{s.pause(),s.removeEventListener("ended",c),s.removeEventListener("timeupdate",h),v()}},[o.isPlaying,i.startTime,i.endTime,i.volume,s]),null})}(tp)),tp}var e2={},t2={},G4;function mk(){return G4||(G4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const r=Nh(),t=Dh();let n={data:[],pageId:""};const a="polotno_clipboard",i=(s,u)=>{n={data:JSON.parse(JSON.stringify(s)),pageId:u};try{localStorage.setItem(a,JSON.stringify(s)),localStorage.setItem(a+"_page",u)}catch{}},o=()=>{try{const s=localStorage.getItem(a),u=localStorage.getItem(a+"_page");if(s)return{data:JSON.parse(s),pageId:u}}catch{}return n};e.copy=s=>{var u;s.selectedElements.length!==0&&i(s.selectedElements.map(c=>c.toJSON()),(u=s.activePage)===null||u===void 0?void 0:u.id)},e.cut=s=>{var u;i(s.selectedElements.map(h=>h.toJSON()),(u=s.activePage)===null||u===void 0?void 0:u.id);let c=s.selectedElements.filter(h=>h.removable).map(h=>h.id);s.deleteElements(c)},e.paste=s=>{s.history.transaction(()=>{var u,c;let h=0,v=0;const{data:g,pageId:f}=o();if(f===((u=s.activePage)===null||u===void 0?void 0:u.id))h=s.width/20,v=s.height/20;else{const S=[];(0,r.forEveryChild)({children:g},_=>{_.type!=="group"&&S.push(_)});const w=(0,t.getTotalClientRect)(S);w.maxX>s.width&&(h=-w.minX),w.maxY>s.height&&(v=-w.minY)}const E=[];(0,r.forEveryChild)({children:g},S=>{delete S.id,S.type!=="group"&&(S.x+=h,S.y+=v)}),g.forEach(S=>{var w;const _=(w=s.activePage)===null||w===void 0?void 0:w.addElement(S);_&&E.push(_.id)}),i(g,(c=s.activePage)===null||c===void 0?void 0:c.id),s.selectElements(E)})},e.isClipboardEmpty=()=>o().data.length===0}(t2)),t2}var W4;function yk(){return W4||(W4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,n){var a,i,o,s;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((i=document.activeElement)===null||i===void 0?void 0:i.tagName)==="TEXTAREA"||((o=document.activeElement)===null||o===void 0?void 0:o.contentEditable)==="true")return;const u=n.selectedElements.filter(v=>v.removable).map(v=>v.id);t.keyCode!==46&&t.keyCode!==8||n.deleteElements(u);const c=t.ctrlKey||t.metaKey,h=t.shiftKey;if(!c||h||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),n.history.undo()),c&&h&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),n.history.redo()),c&&t.code==="KeyA"){t.preventDefault();const v=(s=n.activePage)===null||s===void 0?void 0:s.children.filter(f=>f.selectable),g=v?.map(f=>f.id)||[];n.selectElements(g)}c&&t.code==="KeyC"&&(t.preventDefault(),(0,r.copy)(n)),c&&t.code==="KeyX"&&(t.preventDefault(),(0,r.cut)(n)),c&&t.code==="KeyV"&&(t.preventDefault(),(0,r.paste)(n)),t.code==="ArrowDown"&&(t.preventDefault(),n.selectedShapes.forEach(v=>{v.draggable&&v.set({y:v.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),n.selectedShapes.forEach(v=>{v.draggable&&v.set({y:v.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),n.selectedShapes.forEach(v=>{v.draggable&&v.set({x:v.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),n.selectedShapes.forEach(v=>{v.draggable&&v.set({x:v.x+1})}))};const r=mk()}(e2)),e2}var r2={},$4;function bk(){return $4||($4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const r=vs,t=(0,r.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),n=s=>s&&typeof s=="object";function a(s,u){Object.keys(u).forEach(c=>{const h=s[c],v=u[c];n(v)&&n(h)?a(h,v):s[c]=v})}function i(s,u,c=""){Object.keys(u).forEach(h=>{const v=u[h],g=c?`${c}.${h}`:h;n(v)?n(s[h])?i(s[h],v,g):console.warn(`Missing nested translation object at '${g}'`):s[h]===void 0&&console.warn(`Missing translation '${g}'`)})}e.setTranslations=(0,r.action)((s,{validate:u=!1}={})=>{u&&i(s,t),a(t,s)}),e.getTranslations=()=>(0,r.toJS)(t);const o={};e.t=s=>{const u=function(v,g){var f,E=g.split("."),S=v;for(f=0;f<E.length;++f){if(S[E[f]]==null)return;S=S[E[f]]}return S}(t,s);if(u!==void 0)return u;o[s]||(o[s]=!0,console.warn(`Missing translation '${s}'`));const c=s.split("."),h=c[c.length-1]||" ";return h.charAt(0).toUpperCase()+h.slice(1)}}(r2)),r2}var Y4;function wk(){return Y4||(Y4=1,function(e){var r=Kh&&Kh.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=r(ai()),n=Us,a=r(pk()),i=gk(),o=vk(),s=yk(),u=bk(),c=({store:g})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,u.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{g.addPage()}},(0,u.t)("workspace.addPage"))),h=({width:g,height:f,xPadding:E,yPadding:S,backgroundColor:w})=>t.default.createElement("div",{style:{width:g+"px",height:f+"px",backgroundColor:w,paddingLeft:E+"px",paddingRight:E+"px",paddingTop:S+"px",paddingBottom:S+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),v=[4,6];e.WorkspaceCanvas=(0,n.observer)(({store:g,pageControlsEnabled:f,backgroundColor:E,pageBorderColor:S,activePageBorderColor:w,bleedColor:_,snapGuideStroke:y,snapGuideStrokeWidth:p,snapGuideDash:m,selectionRectFill:P,selectionRectStroke:T,selectionRectStrokeWidth:k,transformLabelFill:L,transformLabelTextFill:I,components:R,onKeyDown:A,paddingX:O,paddingY:M,altCloneEnabled:q=!0,visiblePagesOffset:D,renderOnlyActivePage:te})=>{var H;const B=O??20,$=M??55,[V,j]=t.default.useState({width:100,height:100}),z=t.default.useRef(V),F=t.default.useRef(null),Y=t.default.useRef(null),J=g.bleedVisible?Math.max(0,...g.pages.map(Se=>Se.bleed)):0,X=Math.max(...g.pages.map(Se=>Se.computedWidth)),Q=Math.max(...g.pages.map(Se=>Se.computedHeight)),ae=((H=g.activePage)===null||H===void 0?void 0:H.computedHeight)||0,se=X+2*J,fe=(te?ae:Q)+2*J,be=async({skipTimeout:Se}={skipTimeout:!1})=>{if(Se||await new Promise(ze=>setTimeout(ze,50)),F.current===null)return;const je=F.current.getBoundingClientRect();je.width!==0&&je.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
431
|
+
Width or height of parent elements is equal 0.
|
|
432
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
433
|
+
For simpler debugging here is the log of the parent element:`),console.log(F.current));const Ue=Y.current.clientWidth||je.width,ct={width:Ue,height:je.height};(z.current.width!==ct.width||z.current.height!==ct.height)&&(j(ct),z.current=ct);const mt=(Ue-2*B)/se,yt=g.pages.length>1?3.1:2,Je=(je.height-$*yt)/fe,lt=g.pages.length?Math.max(Math.min(mt,Je),.01):1;g.scaleToFit!==lt&&(g.setScale(lt),g._setScaleToFit(lt))};t.default.useLayoutEffect(()=>{be({skipTimeout:!0})},[]),t.default.useEffect(()=>{be()},[se,fe]),t.default.useEffect(()=>{g.__()},[]),t.default.useEffect(()=>{const Se=F.current;if(window.ResizeObserver){const je=new ResizeObserver(()=>{be({skipTimeout:!0})});return je.observe(Se),()=>je.unobserve(Se)}{const je=setInterval(()=>{be({skipTimeout:!0})},100);return()=>clearInterval(je)}},[se,fe]);const _e=Math.max(B,(V.width-se*g.scale)/2),Ae=te?1:g.pages.length,Re=fe*g.scale*Ae,Pe=Math.max($,(V.height-Re)/Ae/2);t.default.useEffect(()=>{const Se=je=>{(A||s.handleHotkey)(je,g)};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[]),t.default.useEffect(()=>{var Se;const je=Ue=>{if(Ue.ctrlKey||Ue.metaKey){Ue.preventDefault();const Je=Math.max(5,g.scaleToFit),lt=Math.min(.1,g.scaleToFit),ze=.03,kt=(ct=Ue.deltaY<0?g.scale*(1+ze):g.scale/(1+ze),mt=lt,yt=Je,Math.max(mt,Math.min(yt,ct)));return void g.setScale(kt)}var ct,mt,yt};return(Se=Y.current)===null||Se===void 0||Se.addEventListener("wheel",je),()=>{var Ue;return(Ue=Y.current)===null||Ue===void 0?void 0:Ue.removeEventListener("wheel",je)}},[]);const ye=t.default.useRef(!1);((Se,je,Ue,ct,mt,yt)=>{const Je=t.default.useRef({width:je,height:Ue}),lt=t.default.useRef({top:0,left:0}),ze=t.default.useRef(!1),kt=t.default.useRef(mt.pages.length);ze.current=kt.current!==mt.pages.length,kt.current=mt.pages.length,t.default.useEffect(()=>{const pt=Se.current,Ut=Ht=>{lt.current={top:pt.scrollTop,left:pt.scrollLeft}};return pt.addEventListener("scroll",Ut),()=>{pt.removeEventListener("scroll",Ut)}},[]),t.default.useLayoutEffect(()=>{if(!Se.current||ze.current)return;const pt=Se.current,Ut=(lt.current.left+pt.offsetWidth/2)/Je.current.width,Ht=(lt.current.top+pt.offsetHeight/2)/Je.current.height;yt.current=!0,pt.scrollLeft=Ut*je-pt.offsetWidth/2,pt.scrollTop=Ht*Ue-pt.offsetHeight/2,Je.current={width:je,height:Ue}},[ct,je,Ue])})(Y,se*g.scale+2*_e,fe*g.scale+2*Pe,g.scale,g,ye);const{handleScroll:nt}=((Se,je,Ue,ct,mt,yt)=>{const Je=t.default.useRef(!1),lt=t.default.useRef(null),ze=t.default.useRef(!1);t.default.useEffect(()=>{const pt=Se.current,Ut=()=>{mt.current};return pt.addEventListener("scroll",Ut),()=>{pt.removeEventListener("scroll",Ut)}},[]);const kt=Ue.pages.indexOf(Ue.activePage);return t.default.useLayoutEffect(()=>{if(yt||!Ue.activePage||!Se.current||Je.current)return;const pt=Se.current,Ut=Ue.pages.indexOf(Ue.activePage)*je;let Ht=()=>{};return(Math.abs(Ut-pt.scrollTop)>.5*je||ze.current)&&(ze.current=!0,Ht=(({element:Me,scrollTop:Oe=0,duration:it=300,onFinish:Lt=()=>{}})=>{const At=Me.scrollTop,xt=Oe-At;let Jt=0,nr=!1;if(it===0)return Me.scrollTop=Oe,()=>{};const Rt=()=>{if(nr)return;Jt+=20;const Rr=Xt(Jt,At,xt,it);Me.scrollTop=Rr,Jt<it?setTimeout(Rt,20):Lt()},Xt=(Rr,Ze,bt,Vt)=>(Rr/=Vt/2)<1?bt/2*Rr*Rr+Ze:-bt/2*(--Rr*(Rr-2)-1)+Ze;return Rt(),()=>{nr=!0}})({element:pt,scrollTop:Ut,onFinish:()=>{ze.current=!1},duration:Ue.isPlaying?0:300})),Ht},[Ue.activePage,kt,Ue.isPlaying,yt]),{handleScroll:pt=>{if(yt||ze.current)return;Je.current=!0,clearTimeout(lt.current),lt.current=setTimeout(()=>{Je.current=!1},300);const Ut=pt.currentTarget.childNodes[0].offsetHeight,Ht=pt.currentTarget.scrollTop,Me=Math.floor((Ht+ct.height/3)/Ut),Oe=Ue.pages[Me];Oe&&Ue.activePage!==Oe&&Oe.select()}}})(Y,fe*g.scale+2*Pe,g,V,ye,te),Ce=V.width>=se*g.scale+2*_e,he=E||"rgba(232, 232, 232, 0.9)",ke=g.pages.indexOf(g.activePage),Te=R?.NoPages||c,ve=D??Math.min(3,Math.max(1,Math.ceil(V.height/2/(fe*g.scale))));return t.default.createElement("div",{ref:F,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:he,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:Y,onScroll:nt,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:Ce?"hidden":"auto"},className:"polotno-workspace-inner"},g.pages.map((Se,je)=>{const Ue=Se===g.activePage;if(te&&!Ue&&!Se._exportingOrRendering&&!Se._forceMount)return null;if(!(Math.abs(je-ke)<=ve||Se._exportingOrRendering||Se._forceMount))return t.default.createElement(h,{key:Se.id,width:se*g.scale+2*_e,height:fe*g.scale+2*Pe,backgroundColor:he,xPadding:_e,yPadding:Pe});const ct=t.default.createElement(a.default,{key:Se.id,page:Se,xPadding:_e,yPadding:Pe,width:se*g.scale+2*_e,height:fe*g.scale+2*Pe,store:g,pageControlsEnabled:f,backColor:he,pageBorderColor:S||"lightgrey",activePageBorderColor:w||"rgb(0, 161, 255)",altCloneEnabled:q,bleedColor:_||"rgba(255, 0, 0, 0.1)",selectionRectFill:P,selectionRectStroke:T,selectionRectStrokeWidth:k,snapGuideStroke:y||"rgb(0, 161, 255)",snapGuideStrokeWidth:p||1,snapGuideDash:m||v,transformLabelFill:L,transformLabelTextFill:I,components:R,viewportSize:V});return(Se._exportingOrRendering||Se._forceMount)&&!Ue&&te?t.default.createElement("div",{style:{display:"none"},key:Se.id},ct):ct}),g.rulesVisible&&t.default.createElement(i.TopRules,{store:g,xPadding:_e,yPadding:Pe,width:se*g.scale+2*_e,height:fe*g.scale+2*Pe}),g.pages.length===0&&t.default.createElement(Te,{store:g}),g.audios.map(Se=>t.default.createElement(o.AudioElement,{key:Se.id,audio:Se,store:g}))))}),e.default=e.WorkspaceCanvas}(Kh)),Kh}var _k=wk(),Sk=Im(),xk=If(),ap=gc(),n2=jf(),Ek=Ih();const Pk="modulepreload",Ok=function(e,r){return new URL(e,r).href},X4={},C2=function(r,t,n){let a=Promise.resolve();if(t&&t.length>0){let c=function(h){return Promise.all(h.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");a=c(t.map(h=>{if(h=Ok(h,n),h in X4)return;X4[h]=!0;const v=h.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(!!n)for(let S=o.length-1;S>=0;S--){const w=o[S];if(w.href===h&&(!v||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${g}`))return;const E=document.createElement("link");if(E.rel=v?"stylesheet":Pk,v||(E.as="script"),E.crossOrigin="",E.href=h,u&&E.setAttribute("nonce",u),document.head.appendChild(E),v)return new Promise((S,w)=>{E.addEventListener("load",S),E.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return a.then(o=>{for(const s of o||[])s.status==="rejected"&&i(s.reason);return r().catch(i)})};function kn(e){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kn(e)}var Po=Uint8Array,Bs=Uint16Array,Fm=Int32Array,c0=new Po([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),f0=new Po([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),k2=new Po([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),v_=function(e,r){for(var t=new Bs(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var a=new Fm(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)a[i]=i-t[n]<<5|n;return{b:t,r:a}},m_=v_(c0,2),y_=m_.b,L2=m_.r;y_[28]=258,L2[258]=28;var b_=v_(f0,0),Ak=b_.b,K4=b_.r,N2=new Bs(32768);for(var ni=0;ni<32768;++ni){var qc=(ni&43690)>>1|(ni&21845)<<1;qc=(qc&52428)>>2|(qc&13107)<<2,qc=(qc&61680)>>4|(qc&3855)<<4,N2[ni]=((qc&65280)>>8|(qc&255)<<8)>>1}var Ru=function(e,r,t){for(var n=e.length,a=0,i=new Bs(r);a<n;++a)e[a]&&++i[e[a]-1];var o=new Bs(r);for(a=1;a<r;++a)o[a]=o[a-1]+i[a-1]<<1;var s;if(t){s=new Bs(1<<r);var u=15-r;for(a=0;a<n;++a)if(e[a])for(var c=a<<4|e[a],h=r-e[a],v=o[e[a]-1]++<<h,g=v|(1<<h)-1;v<=g;++v)s[N2[v]>>u]=c}else for(s=new Bs(n),a=0;a<n;++a)e[a]&&(s[a]=N2[o[e[a]-1]++]>>15-e[a]);return s},Xc=new Po(288);for(var ni=0;ni<144;++ni)Xc[ni]=8;for(var ni=144;ni<256;++ni)Xc[ni]=9;for(var ni=256;ni<280;++ni)Xc[ni]=7;for(var ni=280;ni<288;++ni)Xc[ni]=8;var mp=new Po(32);for(var ni=0;ni<32;++ni)mp[ni]=5;var Ck=Ru(Xc,9,0),kk=Ru(Xc,9,1),Lk=Ru(mp,5,0),Nk=Ru(mp,5,1),i2=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},Ul=function(e,r,t){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(r&7)&t},a2=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},Dm=function(e){return(e+7)/8|0},w_=function(e,r,t){return(t==null||t>e.length)&&(t=e.length),new Po(e.subarray(r,t))},Tk=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Gl=function(e,r,t){var n=new Error(r||Tk[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Gl),!t)throw n;return n},Rk=function(e,r,t,n){var a=e.length,i=0;if(!a||r.f&&!r.l)return t||new Po(0);var o=!t,s=o||r.i!=2,u=r.i;o&&(t=new Po(a*3));var c=function(be){var _e=t.length;if(be>_e){var Ae=new Po(Math.max(_e*2,be));Ae.set(t),t=Ae}},h=r.f||0,v=r.p||0,g=r.b||0,f=r.l,E=r.d,S=r.m,w=r.n,_=a*8;do{if(!f){h=Ul(e,v,1);var y=Ul(e,v+1,3);if(v+=3,y)if(y==1)f=kk,E=Nk,S=9,w=5;else if(y==2){var T=Ul(e,v,31)+257,k=Ul(e,v+10,15)+4,L=T+Ul(e,v+5,31)+1;v+=14;for(var I=new Po(L),R=new Po(19),A=0;A<k;++A)R[k2[A]]=Ul(e,v+A*3,7);v+=k*3;for(var O=i2(R),M=(1<<O)-1,q=Ru(R,O,1),A=0;A<L;){var D=q[Ul(e,v,M)];v+=D&15;var p=D>>4;if(p<16)I[A++]=p;else{var te=0,H=0;for(p==16?(H=3+Ul(e,v,3),v+=2,te=I[A-1]):p==17?(H=3+Ul(e,v,7),v+=3):p==18&&(H=11+Ul(e,v,127),v+=7);H--;)I[A++]=te}}var B=I.subarray(0,T),$=I.subarray(T);S=i2(B),w=i2($),f=Ru(B,S,1),E=Ru($,w,1)}else Gl(1);else{var p=Dm(v)+4,m=e[p-4]|e[p-3]<<8,P=p+m;if(P>a){u&&Gl(0);break}s&&c(g+m),t.set(e.subarray(p,P),g),r.b=g+=m,r.p=v=P*8,r.f=h;continue}if(v>_){u&&Gl(0);break}}s&&c(g+131072);for(var V=(1<<S)-1,j=(1<<w)-1,z=v;;z=v){var te=f[a2(e,v)&V],F=te>>4;if(v+=te&15,v>_){u&&Gl(0);break}if(te||Gl(2),F<256)t[g++]=F;else if(F==256){z=v,f=null;break}else{var Y=F-254;if(F>264){var A=F-257,J=c0[A];Y=Ul(e,v,(1<<J)-1)+y_[A],v+=J}var X=E[a2(e,v)&j],Q=X>>4;X||Gl(3),v+=X&15;var $=Ak[Q];if(Q>3){var J=f0[Q];$+=a2(e,v)&(1<<J)-1,v+=J}if(v>_){u&&Gl(0);break}s&&c(g+131072);var ae=g+Y;if(g<$){var se=i-$,fe=Math.min($,ae);for(se+g<0&&Gl(3);g<fe;++g)t[g]=n[se+g]}for(;g<ae;++g)t[g]=t[g-$]}}r.l=f,r.p=z,r.b=g,r.f=h,f&&(h=1,r.m=S,r.d=E,r.n=w)}while(!h);return g!=t.length&&o?w_(t,0,g):t.subarray(0,g)},lc=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8},rp=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8,e[n+2]|=t>>16},o2=function(e,r){for(var t=[],n=0;n<e.length;++n)e[n]&&t.push({s:n,f:e[n]});var a=t.length,i=t.slice();if(!a)return{t:S_,l:0};if(a==1){var o=new Po(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(P,T){return P.f-T.f}),t.push({s:-1,f:25001});var s=t[0],u=t[1],c=0,h=1,v=2;for(t[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=a-1;)s=t[t[c].f<t[v].f?c++:v++],u=t[c!=h&&t[c].f<t[v].f?c++:v++],t[h++]={s:-1,f:s.f+u.f,l:s,r:u};for(var g=i[0].s,n=1;n<a;++n)i[n].s>g&&(g=i[n].s);var f=new Bs(g+1),E=T2(t[h-1],f,0);if(E>r){var n=0,S=0,w=E-r,_=1<<w;for(i.sort(function(T,k){return f[k.s]-f[T.s]||T.f-k.f});n<a;++n){var y=i[n].s;if(f[y]>r)S+=_-(1<<E-f[y]),f[y]=r;else break}for(S>>=w;S>0;){var p=i[n].s;f[p]<r?S-=1<<r-f[p]++-1:++n}for(;n>=0&&S;--n){var m=i[n].s;f[m]==r&&(--f[m],++S)}E=r}return{t:new Po(f),l:E}},T2=function(e,r,t){return e.s==-1?Math.max(T2(e.l,r,t+1),T2(e.r,r,t+1)):r[e.s]=t},Z4=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new Bs(++r),n=0,a=e[0],i=1,o=function(u){t[n++]=u},s=1;s<=r;++s)if(e[s]==a&&s!=r)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=e[s]}return{c:t.subarray(0,n),n:r}},np=function(e,r){for(var t=0,n=0;n<r.length;++n)t+=e[n]*r[n];return t},__=function(e,r,t){var n=t.length,a=Dm(r+2);e[a]=n&255,e[a+1]=n>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<n;++i)e[a+i+4]=t[i];return(a+4+n)*8},Q4=function(e,r,t,n,a,i,o,s,u,c,h){lc(r,h++,t),++a[256];for(var v=o2(a,15),g=v.t,f=v.l,E=o2(i,15),S=E.t,w=E.l,_=Z4(g),y=_.c,p=_.n,m=Z4(S),P=m.c,T=m.n,k=new Bs(19),L=0;L<y.length;++L)++k[y[L]&31];for(var L=0;L<P.length;++L)++k[P[L]&31];for(var I=o2(k,7),R=I.t,A=I.l,O=19;O>4&&!R[k2[O-1]];--O);var M=c+5<<3,q=np(a,Xc)+np(i,mp)+o,D=np(a,g)+np(i,S)+o+14+3*O+np(k,R)+2*k[16]+3*k[17]+7*k[18];if(u>=0&&M<=q&&M<=D)return __(r,h,e.subarray(u,u+c));var te,H,B,$;if(lc(r,h,1+(D<q)),h+=2,D<q){te=Ru(g,f,0),H=g,B=Ru(S,w,0),$=S;var V=Ru(R,A,0);lc(r,h,p-257),lc(r,h+5,T-1),lc(r,h+10,O-4),h+=14;for(var L=0;L<O;++L)lc(r,h+3*L,R[k2[L]]);h+=3*O;for(var j=[y,P],z=0;z<2;++z)for(var F=j[z],L=0;L<F.length;++L){var Y=F[L]&31;lc(r,h,V[Y]),h+=R[Y],Y>15&&(lc(r,h,F[L]>>5&127),h+=F[L]>>12)}}else te=Ck,H=Xc,B=Lk,$=mp;for(var L=0;L<s;++L){var J=n[L];if(J>255){var Y=J>>18&31;rp(r,h,te[Y+257]),h+=H[Y+257],Y>7&&(lc(r,h,J>>23&31),h+=c0[Y]);var X=J&31;rp(r,h,B[X]),h+=$[X],X>3&&(rp(r,h,J>>5&8191),h+=f0[X])}else rp(r,h,te[J]),h+=H[J]}return rp(r,h,te[256]),h+H[256]},Mk=new Fm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),S_=new Po(0),Ik=function(e,r,t,n,a,i){var o=i.z||e.length,s=new Po(n+o+5*(1+Math.ceil(o/7e3))+a),u=s.subarray(n,s.length-a),c=i.l,h=(i.r||0)&7;if(r){h&&(u[0]=i.r>>3);for(var v=Mk[r-1],g=v>>13,f=v&8191,E=(1<<t)-1,S=i.p||new Bs(32768),w=i.h||new Bs(E+1),_=Math.ceil(t/3),y=2*_,p=function(Re){return(e[Re]^e[Re+1]<<_^e[Re+2]<<y)&E},m=new Fm(25e3),P=new Bs(288),T=new Bs(32),k=0,L=0,I=i.i||0,R=0,A=i.w||0,O=0;I+2<o;++I){var M=p(I),q=I&32767,D=w[M];if(S[q]=D,w[M]=q,A<=I){var te=o-I;if((k>7e3||R>24576)&&(te>423||!c)){h=Q4(e,u,0,m,P,T,L,R,O,I-O,h),R=k=L=0,O=I;for(var H=0;H<286;++H)P[H]=0;for(var H=0;H<30;++H)T[H]=0}var B=2,$=0,V=f,j=q-D&32767;if(te>2&&M==p(I-j))for(var z=Math.min(g,te)-1,F=Math.min(32767,I),Y=Math.min(258,te);j<=F&&--V&&q!=D;){if(e[I+B]==e[I+B-j]){for(var J=0;J<Y&&e[I+J]==e[I+J-j];++J);if(J>B){if(B=J,$=j,J>z)break;for(var X=Math.min(j,J-2),Q=0,H=0;H<X;++H){var ae=I-j+H&32767,se=S[ae],fe=ae-se&32767;fe>Q&&(Q=fe,D=ae)}}}q=D,D=S[q],j+=q-D&32767}if($){m[R++]=268435456|L2[B]<<18|K4[$];var be=L2[B]&31,_e=K4[$]&31;L+=c0[be]+f0[_e],++P[257+be],++T[_e],A=I+B,++k}else m[R++]=e[I],++P[e[I]]}}for(I=Math.max(I,A);I<o;++I)m[R++]=e[I],++P[e[I]];h=Q4(e,u,c,m,P,T,L,R,O,I-O,h),c||(i.r=h&7|u[h/8|0]<<3,h-=7,i.h=w,i.p=S,i.i=I,i.w=A)}else{for(var I=i.w||0;I<o+c;I+=65535){var Ae=I+65535;Ae>=o&&(u[h/8|0]=c,Ae=o),h=__(u,h+1,e.subarray(I,Ae))}i.i=o}return w_(s,0,n+Dm(h)+a)},x_=function(){var e=1,r=0;return{p:function(t){for(var n=e,a=r,i=t.length|0,o=0;o!=i;){for(var s=Math.min(o+2655,i);o<s;++o)a+=n+=t[o];n=(n&65535)+15*(n>>16),a=(a&65535)+15*(a>>16)}e=n,r=a},d:function(){return e%=65521,r%=65521,(e&255)<<24|(e&65280)<<8|(r&255)<<8|r>>8}}},jk=function(e,r,t,n,a){if(!a&&(a={l:1},r.dictionary)){var i=r.dictionary.subarray(-32768),o=new Po(i.length+e.length);o.set(i),o.set(e,i.length),e=o,a.w=i.length}return Ik(e,r.level==null?6:r.level,r.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+r.mem,t,n,a)},E_=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8},Fk=function(e,r){var t=r.level,n=t==0?0:t<6?1:t==9?3:2;if(e[0]=120,e[1]=n<<6|(r.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,r.dictionary){var a=x_();a.p(r.dictionary),E_(e,2,a.d())}},Dk=function(e,r){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Gl(6,"invalid zlib data"),(e[1]>>5&1)==1&&Gl(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function R2(e,r){r||(r={});var t=x_();t.p(e);var n=jk(e,r,r.dictionary?6:2,4);return Fk(n,r),E_(n,n.length-4,t.d()),n}function Bk(e,r){return Rk(e.subarray(Dk(e),-4),{i:2},r,r)}var qk=typeof TextDecoder<"u"&&new TextDecoder,zk=0;try{qk.decode(S_,{stream:!0}),zk=1}catch{}var yr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function s2(){yr.console&&typeof yr.console.log=="function"&&yr.console.log.apply(yr.console,arguments)}var Yn={log:s2,warn:function(e){yr.console&&(typeof yr.console.warn=="function"?yr.console.warn.apply(yr.console,arguments):s2.call(null,arguments))},error:function(e){yr.console&&(typeof yr.console.error=="function"?yr.console.error.apply(yr.console,arguments):s2(e))}};function l2(e,r,t){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){_f(n.response,r,t)},n.onerror=function(){Yn.error("could not download file")},n.send()}function J4(e){var r=new XMLHttpRequest;r.open("HEAD",e,!1);try{r.send()}catch{}return r.status>=200&&r.status<=299}function f1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}var cp,M2,_f=yr.saveAs||((typeof window>"u"?"undefined":kn(window))!=="object"||window!==yr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,r,t){var n=yr.URL||yr.webkitURL,a=document.createElement("a");r=r||e.name||"download",a.download=r,a.rel="noopener",typeof e=="string"?(a.href=e,a.origin!==location.origin?J4(a.href)?l2(e,r,t):f1(a,a.target="_blank"):f1(a)):(a.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(a.href)},4e4),setTimeout(function(){f1(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,t){if(r=r||e.name||"download",typeof e=="string")if(J4(e))l2(e,r,t);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){f1(n)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:kn(i)!=="object"&&(Yn.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(e,t),r)}:function(e,r,t,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return l2(e,r,t);var a=e.type==="application/octet-stream",i=/constructor/i.test(yr.HTMLElement)||yr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":kn(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var h=s.result;h=o?h:h.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=h:location=h,n=null},s.readAsDataURL(e)}else{var u=yr.URL||yr.webkitURL,c=u.createObjectURL(e);n?n.location=c:location.href=c,n=null,setTimeout(function(){u.revokeObjectURL(c)},4e4)}});/**
|
|
434
|
+
* A class to parse color values
|
|
435
|
+
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
436
|
+
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
437
|
+
* @license Use it if you like it
|
|
438
|
+
*/function P_(e){var r;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],n=0;n<t.length;n++){var a=t[n].re,i=t[n].process,o=a.exec(e);o&&(r=i(o),this.r=r[0],this.g=r[1],this.b=r[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),u=this.g.toString(16),c=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+s+u+c}}/**
|
|
439
|
+
* @license
|
|
440
|
+
* Joseph Myers does not specify a particular license for his work.
|
|
441
|
+
*
|
|
442
|
+
* Author: Joseph Myers
|
|
443
|
+
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
444
|
+
*
|
|
445
|
+
* Modified by: Owen Leong
|
|
446
|
+
*/function u2(e,r){var t=e[0],n=e[1],a=e[2],i=e[3];t=_o(t,n,a,i,r[0],7,-680876936),i=_o(i,t,n,a,r[1],12,-389564586),a=_o(a,i,t,n,r[2],17,606105819),n=_o(n,a,i,t,r[3],22,-1044525330),t=_o(t,n,a,i,r[4],7,-176418897),i=_o(i,t,n,a,r[5],12,1200080426),a=_o(a,i,t,n,r[6],17,-1473231341),n=_o(n,a,i,t,r[7],22,-45705983),t=_o(t,n,a,i,r[8],7,1770035416),i=_o(i,t,n,a,r[9],12,-1958414417),a=_o(a,i,t,n,r[10],17,-42063),n=_o(n,a,i,t,r[11],22,-1990404162),t=_o(t,n,a,i,r[12],7,1804603682),i=_o(i,t,n,a,r[13],12,-40341101),a=_o(a,i,t,n,r[14],17,-1502002290),t=So(t,n=_o(n,a,i,t,r[15],22,1236535329),a,i,r[1],5,-165796510),i=So(i,t,n,a,r[6],9,-1069501632),a=So(a,i,t,n,r[11],14,643717713),n=So(n,a,i,t,r[0],20,-373897302),t=So(t,n,a,i,r[5],5,-701558691),i=So(i,t,n,a,r[10],9,38016083),a=So(a,i,t,n,r[15],14,-660478335),n=So(n,a,i,t,r[4],20,-405537848),t=So(t,n,a,i,r[9],5,568446438),i=So(i,t,n,a,r[14],9,-1019803690),a=So(a,i,t,n,r[3],14,-187363961),n=So(n,a,i,t,r[8],20,1163531501),t=So(t,n,a,i,r[13],5,-1444681467),i=So(i,t,n,a,r[2],9,-51403784),a=So(a,i,t,n,r[7],14,1735328473),t=xo(t,n=So(n,a,i,t,r[12],20,-1926607734),a,i,r[5],4,-378558),i=xo(i,t,n,a,r[8],11,-2022574463),a=xo(a,i,t,n,r[11],16,1839030562),n=xo(n,a,i,t,r[14],23,-35309556),t=xo(t,n,a,i,r[1],4,-1530992060),i=xo(i,t,n,a,r[4],11,1272893353),a=xo(a,i,t,n,r[7],16,-155497632),n=xo(n,a,i,t,r[10],23,-1094730640),t=xo(t,n,a,i,r[13],4,681279174),i=xo(i,t,n,a,r[0],11,-358537222),a=xo(a,i,t,n,r[3],16,-722521979),n=xo(n,a,i,t,r[6],23,76029189),t=xo(t,n,a,i,r[9],4,-640364487),i=xo(i,t,n,a,r[12],11,-421815835),a=xo(a,i,t,n,r[15],16,530742520),t=Eo(t,n=xo(n,a,i,t,r[2],23,-995338651),a,i,r[0],6,-198630844),i=Eo(i,t,n,a,r[7],10,1126891415),a=Eo(a,i,t,n,r[14],15,-1416354905),n=Eo(n,a,i,t,r[5],21,-57434055),t=Eo(t,n,a,i,r[12],6,1700485571),i=Eo(i,t,n,a,r[3],10,-1894986606),a=Eo(a,i,t,n,r[10],15,-1051523),n=Eo(n,a,i,t,r[1],21,-2054922799),t=Eo(t,n,a,i,r[8],6,1873313359),i=Eo(i,t,n,a,r[15],10,-30611744),a=Eo(a,i,t,n,r[6],15,-1560198380),n=Eo(n,a,i,t,r[13],21,1309151649),t=Eo(t,n,a,i,r[4],6,-145523070),i=Eo(i,t,n,a,r[11],10,-1120210379),a=Eo(a,i,t,n,r[2],15,718787259),n=Eo(n,a,i,t,r[9],21,-343485551),e[0]=Vc(t,e[0]),e[1]=Vc(n,e[1]),e[2]=Vc(a,e[2]),e[3]=Vc(i,e[3])}function h0(e,r,t,n,a,i){return r=Vc(Vc(r,e),Vc(n,i)),Vc(r<<a|r>>>32-a,t)}function _o(e,r,t,n,a,i,o){return h0(r&t|~r&n,e,r,a,i,o)}function So(e,r,t,n,a,i,o){return h0(r&n|t&~n,e,r,a,i,o)}function xo(e,r,t,n,a,i,o){return h0(r^t^n,e,r,a,i,o)}function Eo(e,r,t,n,a,i,o){return h0(t^(r|~n),e,r,a,i,o)}function O_(e){var r,t=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=e.length;r+=64)u2(n,Uk(e.substring(r-64,r)));e=e.substring(r-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r<e.length;r++)a[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(u2(n,a),r=0;r<16;r++)a[r]=0;return a[14]=8*t,u2(n,a),n}function Uk(e){var r,t=[];for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}cp=yr.atob.bind(yr),M2=yr.btoa.bind(yr);var ew="0123456789abcdef".split("");function Hk(e){for(var r="",t=0;t<4;t++)r+=ew[e>>8*t+4&15]+ew[e>>8*t&15];return r}function Vk(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function I2(e){return O_(e).map(Vk).join("")}var Gk=function(e){for(var r=0;r<e.length;r++)e[r]=Hk(e[r]);return e.join("")}(O_("hello"))!="5d41402abc4b2a76b9719d911017c592";function Vc(e,r){if(Gk){var t=(65535&e)+(65535&r);return(e>>16)+(r>>16)+(t>>16)<<16|65535&t}return e+r&4294967295}/**
|
|
447
|
+
* @license
|
|
448
|
+
* FPDF is released under a permissive license: there is no usage restriction.
|
|
449
|
+
* You may embed it freely in your application (commercial or not), with or
|
|
450
|
+
* without modifications.
|
|
451
|
+
*
|
|
452
|
+
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
453
|
+
*/function j2(e,r){var t,n,a,i;if(e!==t){for(var o=(a=e,i=1+(256/e.length>>0),new Array(i+1).join(a)),s=[],u=0;u<256;u++)s[u]=u;var c=0;for(u=0;u<256;u++){var h=s[u];c=(c+h+o.charCodeAt(u))%256,s[u]=s[c],s[c]=h}t=e,n=s}else s=n;var v=r.length,g=0,f=0,E="";for(u=0;u<v;u++)f=(f+(h=s[g=(g+1)%256]))%256,s[g]=s[f],s[f]=h,o=s[(s[g]+s[f])%256],E+=String.fromCharCode(r.charCodeAt(u)^o);return E}/**
|
|
454
|
+
* @license
|
|
455
|
+
* Licensed under the MIT License.
|
|
456
|
+
* http://opensource.org/licenses/mit-license
|
|
457
|
+
* Author: Owen Leong (@owenl131)
|
|
458
|
+
* Date: 15 Oct 2020
|
|
459
|
+
* References:
|
|
460
|
+
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
461
|
+
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
462
|
+
* http://www.fpdf.org/en/script/script37.php
|
|
463
|
+
*/var tw={print:4,modify:8,copy:16,"annot-forms":32};function lh(e,r,t,n){this.v=1,this.r=2;var a=192;e.forEach(function(s){if(tw.perm!==void 0)throw new Error("Invalid permission: "+s);a+=tw[s]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(r+this.padding).substr(0,32),o=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,o),this.P=-(1+(255^a)),this.encryptionKey=I2(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=j2(this.encryptionKey,this.padding)}function uh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var r="",t=e.length,n=0;n<t;n++){var a=e.charCodeAt(n);a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?r+="#"+("0"+a.toString(16)).slice(-2):r+=e[n]}return r}function rw(e){if(kn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var r={};this.subscribe=function(t,n,a){if(a=a||!1,typeof t!="string"||typeof n!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");r.hasOwnProperty(t)||(r[t]={});var i=Math.random().toString(35);return r[t][i]=[n,!!a],i},this.unsubscribe=function(t){for(var n in r)if(r[n][t])return delete r[n][t],Object.keys(r[n]).length===0&&delete r[n],!0;return!1},this.publish=function(t){if(r.hasOwnProperty(t)){var n=Array.prototype.slice.call(arguments,1),a=[];for(var i in r[t]){var o=r[t][i];try{o[0].apply(e,n)}catch(s){yr.console&&Yn.error("jsPDF PubSub Error",s.message,s)}o[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return r}}function D1(e){if(!(this instanceof D1))return new D1(e);var r="opacity,stroke-opacity".split(",");for(var t in e)e.hasOwnProperty(t)&&r.indexOf(t)>=0&&(this[t]=e[t]);this.id="",this.objectNumber=-1}function A_(e,r){this.gState=e,this.matrix=r,this.id="",this.objectNumber=-1}function Sf(e,r,t,n,a){if(!(this instanceof Sf))return new Sf(e,r,t,n,a);this.type=e==="axial"?2:3,this.coords=r,this.colors=t,A_.call(this,n,a)}function dh(e,r,t,n,a){if(!(this instanceof dh))return new dh(e,r,t,n,a);this.boundingBox=e,this.xStep=r,this.yStep=t,this.stream="",this.cloneIndex=0,A_.call(this,n,a)}function vr(e){var r,t=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],a=arguments[2],i=arguments[3],o=[],s=1,u=16,c="S",h=null;kn(e=e||{})==="object"&&(t=e.orientation,n=e.unit||n,a=e.format||a,i=e.compress||e.compressPdf||i,(h=e.encryption||null)!==null&&(h.userPassword=h.userPassword||"",h.ownerPassword=h.ownerPassword||"",h.userPermissions=h.userPermissions||[]),s=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(r=e.precision),e.floatPrecision!==void 0&&(u=e.floatPrecision),c=e.defaultPathOperation||"S"),o=e.filters||(i===!0?["FlateEncode"]:o),n=n||"mm",t=(""+(t||"P")).toLowerCase();var v=e.putOnlyUsedFonts||!1,g={},f={internal:{},__private__:{}};f.__private__.PubSub=rw;var E="1.3",S=f.__private__.getPdfVersion=function(){return E};f.__private__.setPdfVersion=function(K){E=K};var w={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return w};var _=f.__private__.getPageFormat=function(K){return w[K]};a=a||"a4";var y={COMPAT:"compat",ADVANCED:"advanced"},p=y.COMPAT;function m(){this.saveGraphicsState(),ye(new wt(ze,0,0,-ze,0,Ko()*ze).toString()+" cm"),this.setFontSize(this.getFontSize()/ze),c="n",p=y.ADVANCED}function P(){this.restoreGraphicsState(),c="S",p=y.COMPAT}var T=f.__private__.combineFontStyleAndFontWeight=function(K,ce){if(K=="bold"&&ce=="normal"||K=="bold"&&ce==400||K=="normal"&&ce=="italic"||K=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(K=ce==400||ce==="normal"?K==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||K!=="normal"?(ce==700?"bold":ce)+""+K:"bold"),K};f.advancedAPI=function(K){var ce=p===y.COMPAT;return ce&&m.call(this),typeof K!="function"||(K(this),ce&&P.call(this)),this},f.compatAPI=function(K){var ce=p===y.ADVANCED;return ce&&P.call(this),typeof K!="function"||(K(this),ce&&m.call(this)),this},f.isAdvancedAPI=function(){return p===y.ADVANCED};var k,L=function(K){if(p!==y.ADVANCED)throw new Error(K+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=f.roundToPrecision=f.__private__.roundToPrecision=function(K,ce){var Le=r||ce;if(isNaN(K)||isNaN(Le))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return K.toFixed(Le).replace(/0+$/,"")};k=f.hpf=f.__private__.hpf=typeof u=="number"?function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.hpf");return I(K,u)}:u==="smart"?function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.hpf");return I(K,K>-1&&K<1?16:5)}:function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.hpf");return I(K,16)};var R=f.f2=f.__private__.f2=function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.f2");return I(K,2)},A=f.__private__.f3=function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.f3");return I(K,3)},O=f.scale=f.__private__.scale=function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.scale");return p===y.COMPAT?K*ze:p===y.ADVANCED?K:void 0},M=function(K){return p===y.COMPAT?Ko()-K:p===y.ADVANCED?K:void 0},q=function(K){return O(M(K))};f.__private__.setPrecision=f.setPrecision=function(K){typeof parseInt(K,10)=="number"&&(r=parseInt(K,10))};var D,te="00000000000000000000000000000000",H=f.__private__.getFileId=function(){return te},B=f.__private__.setFileId=function(K){return te=K!==void 0&&/^[a-fA-F0-9]{32}$/.test(K)?K.toUpperCase():te.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),h!==null&&(mn=new lh(h.userPermissions,h.userPassword,h.ownerPassword,te)),te};f.setFileId=function(K){return B(K),this},f.getFileId=function(){return H()};var $=f.__private__.convertDateToPDFDate=function(K){var ce=K.getTimezoneOffset(),Le=ce<0?"+":"-",Fe=Math.floor(Math.abs(ce/60)),Ke=Math.abs(ce%60),ht=[Le,Y(Fe),"'",Y(Ke),"'"].join("");return["D:",K.getFullYear(),Y(K.getMonth()+1),Y(K.getDate()),Y(K.getHours()),Y(K.getMinutes()),Y(K.getSeconds()),ht].join("")},V=f.__private__.convertPDFDateToDate=function(K){var ce=parseInt(K.substr(2,4),10),Le=parseInt(K.substr(6,2),10)-1,Fe=parseInt(K.substr(8,2),10),Ke=parseInt(K.substr(10,2),10),ht=parseInt(K.substr(12,2),10),Pt=parseInt(K.substr(14,2),10);return new Date(ce,Le,Fe,Ke,ht,Pt,0)},j=f.__private__.setCreationDate=function(K){var ce;if(K===void 0&&(K=new Date),K instanceof Date)ce=$(K);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(K))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=K}return D=ce},z=f.__private__.getCreationDate=function(K){var ce=D;return K==="jsDate"&&(ce=V(D)),ce};f.setCreationDate=function(K){return j(K),this},f.getCreationDate=function(K){return z(K)};var F,Y=f.__private__.padd2=function(K){return("0"+parseInt(K)).slice(-2)},J=f.__private__.padd2Hex=function(K){return("00"+(K=K.toString())).substr(K.length)},X=0,Q=[],ae=[],se=0,fe=[],be=[],_e=!1,Ae=ae,Re=function(){X=0,se=0,ae=[],Q=[],fe=[],gt=Et(),Ft=Et()};f.__private__.setCustomOutputDestination=function(K){_e=!0,Ae=K};var Pe=function(K){_e||(Ae=K)};f.__private__.resetCustomOutputDestination=function(){_e=!1,Ae=ae};var ye=f.__private__.out=function(K){return K=K.toString(),se+=K.length+1,Ae.push(K),Ae},nt=f.__private__.write=function(K){return ye(arguments.length===1?K.toString():Array.prototype.join.call(arguments," "))},Ce=f.__private__.getArrayBuffer=function(K){for(var ce=K.length,Le=new ArrayBuffer(ce),Fe=new Uint8Array(Le);ce--;)Fe[ce]=K.charCodeAt(ce);return Le},he=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return he};var ke=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(K){return ke=p===y.ADVANCED?K/ze:K,this};var Te,ve=f.__private__.getFontSize=f.getFontSize=function(){return p===y.COMPAT?ke:ke*ze},Se=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(K){return Se=K,this},f.__private__.getR2L=f.getR2L=function(){return Se};var je,Ue=f.__private__.setZoomMode=function(K){var ce=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(K))Te=K;else if(isNaN(K)){if(ce.indexOf(K)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+K+'" is not recognized.');Te=K}else Te=parseInt(K,10)};f.__private__.getZoomMode=function(){return Te};var ct,mt=f.__private__.setPageMode=function(K){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(K)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+K+'" is not recognized.');je=K};f.__private__.getPageMode=function(){return je};var yt=f.__private__.setLayoutMode=function(K){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(K)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+K+'" is not recognized.');ct=K};f.__private__.getLayoutMode=function(){return ct},f.__private__.setDisplayMode=f.setDisplayMode=function(K,ce,Le){return Ue(K),yt(ce),mt(Le),this};var Je={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(K){if(Object.keys(Je).indexOf(K)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Je[K]},f.__private__.getDocumentProperties=function(){return Je},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(K){for(var ce in Je)Je.hasOwnProperty(ce)&&K[ce]&&(Je[ce]=K[ce]);return this},f.__private__.setDocumentProperty=function(K,ce){if(Object.keys(Je).indexOf(K)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Je[K]=ce};var lt,ze,kt,pt,Ut,Ht={},Me={},Oe=[],it={},Lt={},At={},xt={},Jt=null,nr=0,Rt=[],Xt=new rw(f),Rr=e.hotfixes||[],Ze={},bt={},Vt=[],wt=function K(ce,Le,Fe,Ke,ht,Pt){if(!(this instanceof K))return new K(ce,Le,Fe,Ke,ht,Pt);isNaN(ce)&&(ce=1),isNaN(Le)&&(Le=0),isNaN(Fe)&&(Fe=0),isNaN(Ke)&&(Ke=1),isNaN(ht)&&(ht=0),isNaN(Pt)&&(Pt=0),this._matrix=[ce,Le,Fe,Ke,ht,Pt]};Object.defineProperty(wt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(K){this._matrix[0]=K}}),Object.defineProperty(wt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(K){this._matrix[1]=K}}),Object.defineProperty(wt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(K){this._matrix[2]=K}}),Object.defineProperty(wt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(K){this._matrix[3]=K}}),Object.defineProperty(wt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(K){this._matrix[4]=K}}),Object.defineProperty(wt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(K){this._matrix[5]=K}}),Object.defineProperty(wt.prototype,"a",{get:function(){return this._matrix[0]},set:function(K){this._matrix[0]=K}}),Object.defineProperty(wt.prototype,"b",{get:function(){return this._matrix[1]},set:function(K){this._matrix[1]=K}}),Object.defineProperty(wt.prototype,"c",{get:function(){return this._matrix[2]},set:function(K){this._matrix[2]=K}}),Object.defineProperty(wt.prototype,"d",{get:function(){return this._matrix[3]},set:function(K){this._matrix[3]=K}}),Object.defineProperty(wt.prototype,"e",{get:function(){return this._matrix[4]},set:function(K){this._matrix[4]=K}}),Object.defineProperty(wt.prototype,"f",{get:function(){return this._matrix[5]},set:function(K){this._matrix[5]=K}}),Object.defineProperty(wt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(wt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(wt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(wt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),wt.prototype.join=function(K){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(k).join(K)},wt.prototype.multiply=function(K){var ce=K.sx*this.sx+K.shy*this.shx,Le=K.sx*this.shy+K.shy*this.sy,Fe=K.shx*this.sx+K.sy*this.shx,Ke=K.shx*this.shy+K.sy*this.sy,ht=K.tx*this.sx+K.ty*this.shx+this.tx,Pt=K.tx*this.shy+K.ty*this.sy+this.ty;return new wt(ce,Le,Fe,Ke,ht,Pt)},wt.prototype.decompose=function(){var K=this.sx,ce=this.shy,Le=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty,Pt=Math.sqrt(K*K+ce*ce),zt=(K/=Pt)*Le+(ce/=Pt)*Fe;Le-=K*zt,Fe-=ce*zt;var sr=Math.sqrt(Le*Le+Fe*Fe);return zt/=sr,K*(Fe/=sr)<ce*(Le/=sr)&&(K=-K,ce=-ce,zt=-zt,Pt=-Pt),{scale:new wt(Pt,0,0,sr,0,0),translate:new wt(1,0,0,1,Ke,ht),rotate:new wt(K,ce,-ce,K,0,0),skew:new wt(1,0,zt,1,0,0)}},wt.prototype.toString=function(K){return this.join(" ")},wt.prototype.inversed=function(){var K=this.sx,ce=this.shy,Le=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty,Pt=1/(K*Fe-ce*Le),zt=Fe*Pt,sr=-ce*Pt,wr=-Le*Pt,mr=K*Pt;return new wt(zt,sr,wr,mr,-zt*Ke-wr*ht,-sr*Ke-mr*ht)},wt.prototype.applyToPoint=function(K){var ce=K.x*this.sx+K.y*this.shx+this.tx,Le=K.x*this.shy+K.y*this.sy+this.ty;return new Xn(ce,Le)},wt.prototype.applyToRectangle=function(K){var ce=this.applyToPoint(K),Le=this.applyToPoint(new Xn(K.x+K.w,K.y+K.h));return new mi(ce.x,ce.y,Le.x-ce.x,Le.y-ce.y)},wt.prototype.clone=function(){var K=this.sx,ce=this.shy,Le=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty;return new wt(K,ce,Le,Fe,Ke,ht)},f.Matrix=wt;var Kt=f.matrixMult=function(K,ce){return ce.multiply(K)},Yt=new wt(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Yt;var ut=function(K,ce){if(!Lt[K]){var Le=(ce instanceof Sf?"Sh":"P")+(Object.keys(it).length+1).toString(10);ce.id=Le,Lt[K]=Le,it[Le]=ce,Xt.publish("addPattern",ce)}};f.ShadingPattern=Sf,f.TilingPattern=dh,f.addShadingPattern=function(K,ce){return L("addShadingPattern()"),ut(K,ce),this},f.beginTilingPattern=function(K){L("beginTilingPattern()"),Qs(K.boundingBox[0],K.boundingBox[1],K.boundingBox[2]-K.boundingBox[0],K.boundingBox[3]-K.boundingBox[1],K.matrix)},f.endTilingPattern=function(K,ce){L("endTilingPattern()"),ce.stream=be[F].join(`
|
|
464
|
+
`),ut(K,ce),Xt.publish("endTilingPattern",ce),Vt.pop().restore()};var St=f.__private__.newObject=function(){var K=Et();return et(K,!0),K},Et=f.__private__.newObjectDeferred=function(){return X++,Q[X]=function(){return se},X},et=function(K,ce){return ce=typeof ce=="boolean"&&ce,Q[K]=se,ce&&ye(K+" 0 obj"),K},qt=f.__private__.newAdditionalObject=function(){var K={objId:Et(),content:""};return fe.push(K),K},gt=Et(),Ft=Et(),br=f.__private__.decodeColorString=function(K){var ce=K.split(" ");if(ce.length!==2||ce[1]!=="g"&&ce[1]!=="G")ce.length===5&&(ce[4]==="k"||ce[4]==="K")&&(ce=[(1-ce[0])*(1-ce[3]),(1-ce[1])*(1-ce[3]),(1-ce[2])*(1-ce[3]),"r"]);else{var Le=parseFloat(ce[0]);ce=[Le,Le,Le,"r"]}for(var Fe="#",Ke=0;Ke<3;Ke++)Fe+=("0"+Math.floor(255*parseFloat(ce[Ke])).toString(16)).slice(-2);return Fe},hr=f.__private__.encodeColorString=function(K){var ce;typeof K=="string"&&(K={ch1:K});var Le=K.ch1,Fe=K.ch2,Ke=K.ch3,ht=K.ch4,Pt=K.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Le=="string"&&Le.charAt(0)!=="#"){var zt=new P_(Le);if(zt.ok)Le=zt.toHex();else if(!/^\d*\.?\d*$/.test(Le))throw new Error('Invalid color "'+Le+'" passed to jsPDF.encodeColorString.')}if(typeof Le=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Le)&&(Le="#"+Le[1]+Le[1]+Le[2]+Le[2]+Le[3]+Le[3]),typeof Le=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Le)){var sr=parseInt(Le.substr(1),16);Le=sr>>16&255,Fe=sr>>8&255,Ke=255&sr}if(Fe===void 0||ht===void 0&&Le===Fe&&Fe===Ke)if(typeof Le=="string")ce=Le+" "+Pt[0];else switch(K.precision){case 2:ce=R(Le/255)+" "+Pt[0];break;case 3:default:ce=A(Le/255)+" "+Pt[0]}else if(ht===void 0||kn(ht)==="object"){if(ht&&!isNaN(ht.a)&&ht.a===0)return ce=["1.","1.","1.",Pt[1]].join(" ");if(typeof Le=="string")ce=[Le,Fe,Ke,Pt[1]].join(" ");else switch(K.precision){case 2:ce=[R(Le/255),R(Fe/255),R(Ke/255),Pt[1]].join(" ");break;default:case 3:ce=[A(Le/255),A(Fe/255),A(Ke/255),Pt[1]].join(" ")}}else if(typeof Le=="string")ce=[Le,Fe,Ke,ht,Pt[2]].join(" ");else switch(K.precision){case 2:ce=[R(Le),R(Fe),R(Ke),R(ht),Pt[2]].join(" ");break;case 3:default:ce=[A(Le),A(Fe),A(Ke),A(ht),Pt[2]].join(" ")}return ce},Qr=f.__private__.getFilters=function(){return o},Sn=f.__private__.putStream=function(K){var ce=(K=K||{}).data||"",Le=K.filters||Qr(),Fe=K.alreadyAppliedFilters||[],Ke=K.addLength1||!1,ht=ce.length,Pt=K.objectId,zt=function(ei){return ei};if(h!==null&&Pt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");h!==null&&(zt=mn.encryptor(Pt,0));var sr={};Le===!0&&(Le=["FlateEncode"]);var wr=K.additionalKeyValues||[],mr=(sr=vr.API.processDataByFilters!==void 0?vr.API.processDataByFilters(ce,Le):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(Fe)?Fe.join(" "):Fe.toString());if(sr.data.length!==0&&(wr.push({key:"Length",value:sr.data.length}),Ke===!0&&wr.push({key:"Length1",value:ht})),mr.length!=0)if(mr.split("/").length-1==1)wr.push({key:"Filter",value:mr});else{wr.push({key:"Filter",value:"["+mr+"]"});for(var Or=0;Or<wr.length;Or+=1)if(wr[Or].key==="DecodeParms"){for(var Nn=[],Pn=0;Pn<sr.reverseChain.split("/").length-1;Pn+=1)Nn.push("null");Nn.push(wr[Or].value),wr[Or].value="["+Nn.join(" ")+"]"}}ye("<<");for(var Bn=0;Bn<wr.length;Bn++)ye("/"+wr[Bn].key+" "+wr[Bn].value);ye(">>"),sr.data.length!==0&&(ye("stream"),ye(zt(sr.data)),ye("endstream"))},Ni=f.__private__.putPage=function(K){var ce=K.number,Le=K.data,Fe=K.objId,Ke=K.contentsObjId;et(Fe,!0),ye("<</Type /Page"),ye("/Parent "+K.rootDictionaryObjId+" 0 R"),ye("/Resources "+K.resourceDictionaryObjId+" 0 R"),ye("/MediaBox ["+parseFloat(k(K.mediaBox.bottomLeftX))+" "+parseFloat(k(K.mediaBox.bottomLeftY))+" "+k(K.mediaBox.topRightX)+" "+k(K.mediaBox.topRightY)+"]"),K.cropBox!==null&&ye("/CropBox ["+k(K.cropBox.bottomLeftX)+" "+k(K.cropBox.bottomLeftY)+" "+k(K.cropBox.topRightX)+" "+k(K.cropBox.topRightY)+"]"),K.bleedBox!==null&&ye("/BleedBox ["+k(K.bleedBox.bottomLeftX)+" "+k(K.bleedBox.bottomLeftY)+" "+k(K.bleedBox.topRightX)+" "+k(K.bleedBox.topRightY)+"]"),K.trimBox!==null&&ye("/TrimBox ["+k(K.trimBox.bottomLeftX)+" "+k(K.trimBox.bottomLeftY)+" "+k(K.trimBox.topRightX)+" "+k(K.trimBox.topRightY)+"]"),K.artBox!==null&&ye("/ArtBox ["+k(K.artBox.bottomLeftX)+" "+k(K.artBox.bottomLeftY)+" "+k(K.artBox.topRightX)+" "+k(K.artBox.topRightY)+"]"),typeof K.userUnit=="number"&&K.userUnit!==1&&ye("/UserUnit "+K.userUnit),Xt.publish("putPage",{objId:Fe,pageContext:Rt[ce],pageNumber:ce,page:Le}),ye("/Contents "+Ke+" 0 R"),ye(">>"),ye("endobj");var ht=Le.join(`
|
|
465
|
+
`);return p===y.ADVANCED&&(ht+=`
|
|
466
|
+
Q`),et(Ke,!0),Sn({data:ht,filters:Qr(),objectId:Ke}),ye("endobj"),Fe},Si=f.__private__.putPages=function(){var K,ce,Le=[];for(K=1;K<=nr;K++)Rt[K].objId=Et(),Rt[K].contentsObjId=Et();for(K=1;K<=nr;K++)Le.push(Ni({number:K,data:be[K],objId:Rt[K].objId,contentsObjId:Rt[K].contentsObjId,mediaBox:Rt[K].mediaBox,cropBox:Rt[K].cropBox,bleedBox:Rt[K].bleedBox,trimBox:Rt[K].trimBox,artBox:Rt[K].artBox,userUnit:Rt[K].userUnit,rootDictionaryObjId:gt,resourceDictionaryObjId:Ft}));et(gt,!0),ye("<</Type /Pages");var Fe="/Kids [";for(ce=0;ce<nr;ce++)Fe+=Le[ce]+" 0 R ";ye(Fe+"]"),ye("/Count "+nr),ye(">>"),ye("endobj"),Xt.publish("postPutPages")},fa=function(K){Xt.publish("putFont",{font:K,out:ye,newObject:St,putStream:Sn}),K.isAlreadyPutted!==!0&&(K.objectNumber=St(),ye("<<"),ye("/Type /Font"),ye("/BaseFont /"+uh(K.postScriptName)),ye("/Subtype /Type1"),typeof K.encoding=="string"&&ye("/Encoding /"+K.encoding),ye("/FirstChar 32"),ye("/LastChar 255"),ye(">>"),ye("endobj"))},_s=function(){for(var K in Ht)Ht.hasOwnProperty(K)&&(v===!1||v===!0&&g.hasOwnProperty(K))&&fa(Ht[K])},Go=function(K){K.objectNumber=St();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[k(K.x),k(K.y),k(K.x+K.width),k(K.y+K.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+K.matrix.toString()+"]"});var Le=K.pages[1].join(`
|
|
467
|
+
`);Sn({data:Le,additionalKeyValues:ce,objectId:K.objectNumber}),ye("endobj")},tu=function(){for(var K in Ze)Ze.hasOwnProperty(K)&&Go(Ze[K])},mc=function(K,ce){var Le,Fe=[],Ke=1/(ce-1);for(Le=0;Le<1;Le+=Ke)Fe.push(Le);if(Fe.push(1),K[0].offset!=0){var ht={offset:0,color:K[0].color};K.unshift(ht)}if(K[K.length-1].offset!=1){var Pt={offset:1,color:K[K.length-1].color};K.push(Pt)}for(var zt="",sr=0,wr=0;wr<Fe.length;wr++){for(Le=Fe[wr];Le>K[sr+1].offset;)sr++;var mr=K[sr].offset,Or=(Le-mr)/(K[sr+1].offset-mr),Nn=K[sr].color,Pn=K[sr+1].color;zt+=J(Math.round((1-Or)*Nn[0]+Or*Pn[0]).toString(16))+J(Math.round((1-Or)*Nn[1]+Or*Pn[1]).toString(16))+J(Math.round((1-Or)*Nn[2]+Or*Pn[2]).toString(16))}return zt.trim()},Fn=function(K,ce){ce||(ce=21);var Le=St(),Fe=mc(K.colors,ce),Ke=[];Ke.push({key:"FunctionType",value:"0"}),Ke.push({key:"Domain",value:"[0.0 1.0]"}),Ke.push({key:"Size",value:"["+ce+"]"}),Ke.push({key:"BitsPerSample",value:"8"}),Ke.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ke.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Sn({data:Fe,additionalKeyValues:Ke,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Le}),ye("endobj"),K.objectNumber=St(),ye("<< /ShadingType "+K.type),ye("/ColorSpace /DeviceRGB");var ht="/Coords ["+k(parseFloat(K.coords[0]))+" "+k(parseFloat(K.coords[1]))+" ";K.type===2?ht+=k(parseFloat(K.coords[2]))+" "+k(parseFloat(K.coords[3])):ht+=k(parseFloat(K.coords[2]))+" "+k(parseFloat(K.coords[3]))+" "+k(parseFloat(K.coords[4]))+" "+k(parseFloat(K.coords[5])),ye(ht+="]"),K.matrix&&ye("/Matrix ["+K.matrix.toString()+"]"),ye("/Function "+Le+" 0 R"),ye("/Extend [true true]"),ye(">>"),ye("endobj")},Bu=function(K,ce){var Le=Et(),Fe=St();ce.push({resourcesOid:Le,objectOid:Fe}),K.objectNumber=Fe;var Ke=[];Ke.push({key:"Type",value:"/Pattern"}),Ke.push({key:"PatternType",value:"1"}),Ke.push({key:"PaintType",value:"1"}),Ke.push({key:"TilingType",value:"1"}),Ke.push({key:"BBox",value:"["+K.boundingBox.map(k).join(" ")+"]"}),Ke.push({key:"XStep",value:k(K.xStep)}),Ke.push({key:"YStep",value:k(K.yStep)}),Ke.push({key:"Resources",value:Le+" 0 R"}),K.matrix&&Ke.push({key:"Matrix",value:"["+K.matrix.toString()+"]"}),Sn({data:K.stream,additionalKeyValues:Ke,objectId:K.objectNumber}),ye("endobj")},oo=function(K){var ce;for(ce in it)it.hasOwnProperty(ce)&&(it[ce]instanceof Sf?Fn(it[ce]):it[ce]instanceof dh&&Bu(it[ce],K))},dl=function(K){for(var ce in K.objectNumber=St(),ye("<<"),K)switch(ce){case"opacity":ye("/ca "+R(K[ce]));break;case"stroke-opacity":ye("/CA "+R(K[ce]))}ye(">>"),ye("endobj")},Vs=function(){var K;for(K in At)At.hasOwnProperty(K)&&dl(At[K])},qu=function(){for(var K in ye("/XObject <<"),Ze)Ze.hasOwnProperty(K)&&Ze[K].objectNumber>=0&&ye("/"+K+" "+Ze[K].objectNumber+" 0 R");Xt.publish("putXobjectDict"),ye(">>")},ru=function(){mn.oid=St(),ye("<<"),ye("/Filter /Standard"),ye("/V "+mn.v),ye("/R "+mn.r),ye("/U <"+mn.toHexString(mn.U)+">"),ye("/O <"+mn.toHexString(mn.O)+">"),ye("/P "+mn.P),ye(">>"),ye("endobj")},so=function(){for(var K in ye("/Font <<"),Ht)Ht.hasOwnProperty(K)&&(v===!1||v===!0&&g.hasOwnProperty(K))&&ye("/"+K+" "+Ht[K].objectNumber+" 0 R");ye(">>")},gi=function(){if(Object.keys(it).length>0){for(var K in ye("/Shading <<"),it)it.hasOwnProperty(K)&&it[K]instanceof Sf&&it[K].objectNumber>=0&&ye("/"+K+" "+it[K].objectNumber+" 0 R");Xt.publish("putShadingPatternDict"),ye(">>")}},Jr=function(K){if(Object.keys(it).length>0){for(var ce in ye("/Pattern <<"),it)it.hasOwnProperty(ce)&&it[ce]instanceof f.TilingPattern&&it[ce].objectNumber>=0&&it[ce].objectNumber<K&&ye("/"+ce+" "+it[ce].objectNumber+" 0 R");Xt.publish("putTilingPatternDict"),ye(">>")}},Nr=function(){if(Object.keys(At).length>0){var K;for(K in ye("/ExtGState <<"),At)At.hasOwnProperty(K)&&At[K].objectNumber>=0&&ye("/"+K+" "+At[K].objectNumber+" 0 R");Xt.publish("putGStateDict"),ye(">>")}},cn=function(K){et(K.resourcesOid,!0),ye("<<"),ye("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),so(),gi(),Jr(K.objectOid),Nr(),qu(),ye(">>"),ye("endobj")},vi=function(){var K=[];_s(),Vs(),tu(),oo(K),Xt.publish("putResources"),K.forEach(cn),cn({resourcesOid:Ft,objectOid:Number.MAX_SAFE_INTEGER}),Xt.publish("postPutResources")},Ti=function(){Xt.publish("putAdditionalObjects");for(var K=0;K<fe.length;K++){var ce=fe[K];et(ce.objId,!0),ye(ce.content),ye("endobj")}Xt.publish("postPutAdditionalObjects")},Ia=function(K){Me[K.fontName]=Me[K.fontName]||{},Me[K.fontName][K.fontStyle]=K.id},ja=function(K,ce,Le,Fe,Ke){var ht={id:"F"+(Object.keys(Ht).length+1).toString(10),postScriptName:K,fontName:ce,fontStyle:Le,encoding:Fe,isStandardFont:Ke||!1,metadata:{}};return Xt.publish("addFont",{font:ht,instance:this}),Ht[ht.id]=ht,Ia(ht),ht.id},oi=function(K){for(var ce=0,Le=he.length;ce<Le;ce++){var Fe=ja.call(this,K[ce][0],K[ce][1],K[ce][2],he[ce][3],!0);v===!1&&(g[Fe]=!0);var Ke=K[ce][0].split("-");Ia({id:Fe,fontName:Ke[0],fontStyle:Ke[1]||""})}Xt.publish("addFonts",{fonts:Ht,dictionary:Me})},Ri=function(K){return K.foo=function(){try{return K.apply(this,arguments)}catch(Fe){var ce=Fe.stack||"";~ce.indexOf(" at ")&&(ce=ce.split(" at ")[1]);var Le="Error in function "+ce.split(`
|
|
468
|
+
`)[0].split("<")[0]+": "+Fe.message;if(!yr.console)throw new Error(Le);yr.console.error(Le,Fe),yr.alert&&alert(Le)}},K.foo.bar=K,K.foo},pl=function(K,ce){var Le,Fe,Ke,ht,Pt,zt,sr,wr,mr;if(Ke=(ce=ce||{}).sourceEncoding||"Unicode",Pt=ce.outputEncoding,(ce.autoencode||Pt)&&Ht[lt].metadata&&Ht[lt].metadata[Ke]&&Ht[lt].metadata[Ke].encoding&&(ht=Ht[lt].metadata[Ke].encoding,!Pt&&Ht[lt].encoding&&(Pt=Ht[lt].encoding),!Pt&&ht.codePages&&(Pt=ht.codePages[0]),typeof Pt=="string"&&(Pt=ht[Pt]),Pt)){for(sr=!1,zt=[],Le=0,Fe=K.length;Le<Fe;Le++)(wr=Pt[K.charCodeAt(Le)])?zt.push(String.fromCharCode(wr)):zt.push(K[Le]),zt[Le].charCodeAt(0)>>8&&(sr=!0);K=zt.join("")}for(Le=K.length;sr===void 0&&Le!==0;)K.charCodeAt(Le-1)>>8&&(sr=!0),Le--;if(!sr)return K;for(zt=ce.noBOM?[]:[254,255],Le=0,Fe=K.length;Le<Fe;Le++){if((mr=(wr=K.charCodeAt(Le))>>8)>>8)throw new Error("Character at position "+Le+" of string '"+K+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");zt.push(mr),zt.push(wr-(mr<<8))}return String.fromCharCode.apply(void 0,zt)},ha=f.__private__.pdfEscape=f.pdfEscape=function(K,ce){return pl(K,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Wo=f.__private__.beginPage=function(K){be[++nr]=[],Rt[nr]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(K[0]),topRightY:Number(K[1])}},Gs(nr),Pe(be[F])},nu=function(K,ce){var Le,Fe,Ke;switch(t=ce||t,typeof K=="string"&&(Le=_(K.toLowerCase()),Array.isArray(Le)&&(Fe=Le[0],Ke=Le[1])),Array.isArray(K)&&(Fe=K[0]*ze,Ke=K[1]*ze),isNaN(Fe)&&(Fe=a[0],Ke=a[1]),(Fe>14400||Ke>14400)&&(Yn.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),Ke=Math.min(14400,Ke)),a=[Fe,Ke],t.substr(0,1)){case"l":Ke>Fe&&(a=[Ke,Fe]);break;case"p":Fe>Ke&&(a=[Ke,Fe])}Wo(a),Os(Ba),ye(xn),lu!==0&&ye(lu+" J"),As!==0&&ye(As+" j"),Xt.publish("addPage",{pageNumber:nr})},da=function(K){K>0&&K<=nr&&(be.splice(K,1),Rt.splice(K,1),nr--,F>nr&&(F=nr),this.setPage(F))},Gs=function(K){K>0&&K<=nr&&(F=K)},af=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return be.length-1},iu=function(K,ce,Le){var Fe,Ke=void 0;return Le=Le||{},K=K!==void 0?K:Ht[lt].fontName,ce=ce!==void 0?ce:Ht[lt].fontStyle,Fe=K.toLowerCase(),Me[Fe]!==void 0&&Me[Fe][ce]!==void 0?Ke=Me[Fe][ce]:Me[K]!==void 0&&Me[K][ce]!==void 0?Ke=Me[K][ce]:Le.disableWarning===!1&&Yn.warn("Unable to look up font label for font '"+K+"', '"+ce+"'. Refer to getFontList() for available fonts."),Ke||Le.noFallback||(Ke=Me.times[ce])==null&&(Ke=Me.times.normal),Ke},Fr=f.__private__.putInfo=function(){var K=St(),ce=function(Fe){return Fe};for(var Le in h!==null&&(ce=mn.encryptor(K,0)),ye("<<"),ye("/Producer ("+ha(ce("jsPDF "+vr.version))+")"),Je)Je.hasOwnProperty(Le)&&Je[Le]&&ye("/"+Le.substr(0,1).toUpperCase()+Le.substr(1)+" ("+ha(ce(Je[Le]))+")");ye("/CreationDate ("+ha(ce(D))+")"),ye(">>"),ye("endobj")},Ss=f.__private__.putCatalog=function(K){var ce=(K=K||{}).rootDictionaryObjId||gt;switch(St(),ye("<<"),ye("/Type /Catalog"),ye("/Pages "+ce+" 0 R"),Te||(Te="fullwidth"),Te){case"fullwidth":ye("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ye("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ye("/OpenAction [3 0 R /Fit]");break;case"original":ye("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Le=""+Te;Le.substr(Le.length-1)==="%"&&(Te=parseInt(Te)/100),typeof Te=="number"&&ye("/OpenAction [3 0 R /XYZ null null "+R(Te)+"]")}switch(ct||(ct="continuous"),ct){case"continuous":ye("/PageLayout /OneColumn");break;case"single":ye("/PageLayout /SinglePage");break;case"two":case"twoleft":ye("/PageLayout /TwoColumnLeft");break;case"tworight":ye("/PageLayout /TwoColumnRight")}je&&ye("/PageMode /"+je),Xt.publish("putCatalog"),ye(">>"),ye("endobj")},Ws=f.__private__.putTrailer=function(){ye("trailer"),ye("<<"),ye("/Size "+(X+1)),ye("/Root "+X+" 0 R"),ye("/Info "+(X-1)+" 0 R"),h!==null&&ye("/Encrypt "+mn.oid+" 0 R"),ye("/ID [ <"+te+"> <"+te+"> ]"),ye(">>")},$s=f.__private__.putHeader=function(){ye("%PDF-"+E),ye("%ºß¬à")},yc=f.__private__.putXRef=function(){var K="0000000000";ye("xref"),ye("0 "+(X+1)),ye("0000000000 65535 f ");for(var ce=1;ce<=X;ce++)typeof Q[ce]=="function"?ye((K+Q[ce]()).slice(-10)+" 00000 n "):Q[ce]!==void 0?ye((K+Q[ce]).slice(-10)+" 00000 n "):ye("0000000000 00000 n ")},$o=f.__private__.buildDocument=function(){Re(),Pe(ae),Xt.publish("buildDocument"),$s(),Si(),Ti(),vi(),h!==null&&ru(),Fr(),Ss();var K=se;return yc(),Ws(),ye("startxref"),ye(""+K),ye("%%EOF"),Pe(be[F]),ae.join(`
|
|
469
|
+
`)},xs=f.__private__.getBlob=function(K){return new Blob([Ce(K)],{type:"application/pdf"})},Es=f.output=f.__private__.output=Ri(function(K,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",K){case void 0:return $o();case"save":f.save(ce.filename);break;case"arraybuffer":return Ce($o());case"blob":return xs($o());case"bloburi":case"bloburl":if(yr.URL!==void 0&&typeof yr.URL.createObjectURL=="function")return yr.URL&&yr.URL.createObjectURL(xs($o()))||void 0;Yn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Le="",Fe=$o();try{Le=M2(Fe)}catch{Le=M2(unescape(encodeURIComponent(Fe)))}return"data:application/pdf;filename="+ce.filename+";base64,"+Le;case"pdfobjectnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var Ke="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ht=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';ce.pdfObjectUrl&&(Ke=ce.pdfObjectUrl,ht="");var Pt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ke+'"'+ht+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(ce)+");<\/script></body></html>",zt=yr.open();return zt!==null&&zt.document.write(Pt),zt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var sr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(ce.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+ce.filename+'" width="500px" height="400px" /></body></html>',wr=yr.open();if(wr!==null){wr.document.write(sr);var mr=this;wr.document.documentElement.querySelector("#pdfViewer").onload=function(){wr.document.title=ce.filename,wr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(mr.output("bloburl"))}}return wr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(yr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Or='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",ce)+'"></iframe></body></html>',Nn=yr.open();if(Nn!==null&&(Nn.document.write(Or),Nn.document.title=ce.filename),Nn||typeof safari>"u")return Nn;break;case"datauri":case"dataurl":return yr.document.location.href=this.output("datauristring",ce);default:return null}}),Ps=function(K){return Array.isArray(Rr)===!0&&Rr.indexOf(K)>-1};switch(n){case"pt":ze=1;break;case"mm":ze=72/25.4;break;case"cm":ze=72/2.54;break;case"in":ze=72;break;case"px":ze=Ps("px_scaling")==1?.75:96/72;break;case"pc":case"em":ze=12;break;case"ex":ze=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);ze=n}var mn=null;j(),B();var Yo=function(K){return h!==null?mn.encryptor(K,0):function(ce){return ce}},Fa=f.__private__.getPageInfo=f.getPageInfo=function(K){if(isNaN(K)||K%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Rt[K].objId,pageNumber:K,pageContext:Rt[K]}},Dt=f.__private__.getPageInfoByObjId=function(K){if(isNaN(K)||K%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in Rt)if(Rt[ce].objId===K)break;return Fa(ce)},Ys=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:Rt[F].objId,pageNumber:F,pageContext:Rt[F]}};f.addPage=function(){return nu.apply(this,arguments),this},f.setPage=function(){return Gs.apply(this,arguments),Pe.call(this,be[F]),this},f.insertPage=function(K){return this.addPage(),this.movePage(F,K),this},f.movePage=function(K,ce){var Le,Fe;if(K>ce){Le=be[K],Fe=Rt[K];for(var Ke=K;Ke>ce;Ke--)be[Ke]=be[Ke-1],Rt[Ke]=Rt[Ke-1];be[ce]=Le,Rt[ce]=Fe,this.setPage(ce)}else if(K<ce){Le=be[K],Fe=Rt[K];for(var ht=K;ht<ce;ht++)be[ht]=be[ht+1],Rt[ht]=Rt[ht+1];be[ce]=Le,Rt[ce]=Fe,this.setPage(ce)}return this},f.deletePage=function(){return da.apply(this,arguments),this},f.__private__.text=f.text=function(K,ce,Le,Fe,Ke){var ht,Pt,zt,sr,wr,mr,Or,Nn,Pn,Bn=(Fe=Fe||{}).scope||this;if(typeof K=="number"&&typeof ce=="number"&&(typeof Le=="string"||Array.isArray(Le))){var ei=Le;Le=ce,ce=K,K=ei}if(arguments[3]instanceof wt?(L("The transform parameter of text() with a Matrix value"),Pn=Ke):(zt=arguments[4],sr=arguments[5],kn(Or=arguments[3])==="object"&&Or!==null||(typeof zt=="string"&&(sr=zt,zt=null),typeof Or=="string"&&(sr=Or,Or=null),typeof Or=="number"&&(zt=Or,Or=null),Fe={flags:Or,angle:zt,align:sr})),isNaN(ce)||isNaN(Le)||K==null)throw new Error("Invalid arguments passed to jsPDF.text");if(K.length===0)return Bn;var ui="",Ua=!1,Ea=typeof Fe.lineHeightFactor=="number"?Fe.lineHeightFactor:Mi,Pa=Bn.internal.scaleFactor;function Zo(on){return on=on.split(" ").join(Array(Fe.TabLen||9).join(" ")),ha(on,Or)}function Qo(on){for(var Kr,qn=on.concat(),ti=[],Io=qn.length;Io--;)typeof(Kr=qn.shift())=="string"?ti.push(Kr):Array.isArray(on)&&(Kr.length===1||Kr[1]===void 0&&Kr[2]===void 0)?ti.push(Kr[0]):ti.push([Kr[0],Kr[1],Kr[2]]);return ti}function Di(on,Kr){var qn;if(typeof on=="string")qn=Kr(on)[0];else if(Array.isArray(on)){for(var ti,Io,_l=on.concat(),nl=[],cu=_l.length;cu--;)typeof(ti=_l.shift())=="string"?nl.push(Kr(ti)[0]):Array.isArray(ti)&&typeof ti[0]=="string"&&(Io=Kr(ti[0],ti[1],ti[2]),nl.push([Io[0],Io[1],Io[2]]));qn=nl}return qn}var Ha=!1,Js=!0;if(typeof K=="string")Ha=!0;else if(Array.isArray(K)){var bl=K.concat();Pt=[];for(var ra,an=bl.length;an--;)(typeof(ra=bl.shift())!="string"||Array.isArray(ra)&&typeof ra[0]!="string")&&(Js=!1);Ha=Js}if(Ha===!1)throw new Error('Type of text must be string or Array. "'+K+'" is not recognized.');typeof K=="string"&&(K=K.match(/[\r?\n]/)?K.split(/\r\n|\r|\n/g):[K]);var el=ke/Bn.internal.scaleFactor,wl=el*(Ea-1);switch(Fe.baseline){case"bottom":Le-=wl;break;case"top":Le+=el-wl;break;case"hanging":Le+=el-2*wl;break;case"middle":Le+=el/2-wl}if((mr=Fe.maxWidth||0)>0&&(typeof K=="string"?K=Bn.splitTextToSize(K,mr):Object.prototype.toString.call(K)==="[object Array]"&&(K=K.reduce(function(on,Kr){return on.concat(Bn.splitTextToSize(Kr,mr))},[]))),ht={text:K,x:ce,y:Le,options:Fe,mutex:{pdfEscape:ha,activeFontKey:lt,fonts:Ht,activeFontSize:ke}},Xt.publish("preProcessText",ht),K=ht.text,zt=(Fe=ht.options).angle,!(Pn instanceof wt)&&zt&&typeof zt=="number"){zt*=Math.PI/180,Fe.rotationDirection===0&&(zt=-zt),p===y.ADVANCED&&(zt=-zt);var Oa=Math.cos(zt),Va=Math.sin(zt);Pn=new wt(Oa,Va,-Va,Oa,0,0)}else zt&&zt instanceof wt&&(Pn=zt);p!==y.ADVANCED||Pn||(Pn=Yt),(wr=Fe.charSpace||ta)!==void 0&&(ui+=k(O(wr))+` Tc
|
|
470
|
+
`,this.setCharSpace(this.getCharSpace()||0)),(Nn=Fe.horizontalScale)!==void 0&&(ui+=k(100*Nn)+` Tz
|
|
471
|
+
`),Fe.lang;var xi=-1,tl=Fe.renderingMode!==void 0?Fe.renderingMode:Fe.stroke,co=Bn.internal.getCurrentPageInfo().pageContext;switch(tl){case 0:case!1:case"fill":xi=0;break;case 1:case!0:case"stroke":xi=1;break;case 2:case"fillThenStroke":xi=2;break;case 3:case"invisible":xi=3;break;case 4:case"fillAndAddForClipping":xi=4;break;case 5:case"strokeAndAddPathForClipping":xi=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":xi=6;break;case 7:case"addToPathForClipping":xi=7}var Hu=co.usedRenderingMode!==void 0?co.usedRenderingMode:-1;xi!==-1?ui+=xi+` Tr
|
|
472
|
+
`:Hu!==-1&&(ui+=`0 Tr
|
|
473
|
+
`),xi!==-1&&(co.usedRenderingMode=xi),sr=Fe.align||"left";var yi,Bi=ke*Ea,Cs=Bn.internal.pageSize.getWidth(),Co=Ht[lt];wr=Fe.charSpace||ta,mr=Fe.maxWidth||0,Or=Object.assign({autoencode:!0,noBOM:!0},Fe.flags);var bi=[],Jo=function(on){return Bn.getStringUnitWidth(on,{font:Co,charSpace:wr,fontSize:ke,doKerning:!1})*ke/Pa};if(Object.prototype.toString.call(K)==="[object Array]"){var ci;Pt=Qo(K),sr!=="left"&&(yi=Pt.map(Jo));var qi,es=0;if(sr==="right"){ce-=yi[0],K=[],an=Pt.length;for(var Xr=0;Xr<an;Xr++)Xr===0?(qi=Ii(ce),ci=ji(Le)):(qi=O(es-yi[Xr]),ci=-Bi),K.push([Pt[Xr],qi,ci]),es=yi[Xr]}else if(sr==="center"){ce-=yi[0]/2,K=[],an=Pt.length;for(var fo=0;fo<an;fo++)fo===0?(qi=Ii(ce),ci=ji(Le)):(qi=O((es-yi[fo])/2),ci=-Bi),K.push([Pt[fo],qi,ci]),es=yi[fo]}else if(sr==="left"){K=[],an=Pt.length;for(var rl=0;rl<an;rl++)K.push(Pt[rl])}else if(sr==="justify"&&Co.encoding==="Identity-H"){K=[],an=Pt.length,mr=mr!==0?mr:Cs;for(var ko=0,Dr=0;Dr<an;Dr++)if(ci=Dr===0?ji(Le):-Bi,qi=Dr===0?Ii(ce):ko,Dr<an-1){var Lo=O((mr-yi[Dr])/(Pt[Dr].split(" ").length-1)),Kn=Pt[Dr].split(" ");K.push([Kn[0]+" ",qi,ci]),ko=0;for(var Mr=1;Mr<Kn.length;Mr++){var On=(Jo(Kn[Mr-1]+" "+Kn[Mr])-Jo(Kn[Mr]))*Pa+Lo;Mr==Kn.length-1?K.push([Kn[Mr],On,0]):K.push([Kn[Mr]+" ",On,0]),ko-=On}}else K.push([Pt[Dr],qi,ci]);K.push(["",ko,0])}else{if(sr!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(K=[],an=Pt.length,mr=mr!==0?mr:Cs,Dr=0;Dr<an;Dr++)ci=Dr===0?ji(Le):-Bi,qi=Dr===0?Ii(ce):0,Dr<an-1?bi.push(k(O((mr-yi[Dr])/(Pt[Dr].split(" ").length-1)))):bi.push(0),K.push([Pt[Dr],qi,ci])}}var Zn=typeof Fe.R2L=="boolean"?Fe.R2L:Se;Zn===!0&&(K=Di(K,function(on,Kr,qn){return[on.split("").reverse().join(""),Kr,qn]})),ht={text:K,x:ce,y:Le,options:Fe,mutex:{pdfEscape:ha,activeFontKey:lt,fonts:Ht,activeFontSize:ke}},Xt.publish("postProcessText",ht),K=ht.text,Ua=ht.mutex.isHex||!1;var ts=Ht[lt].encoding;ts!=="WinAnsiEncoding"&&ts!=="StandardEncoding"||(K=Di(K,function(on,Kr,qn){return[Zo(on),Kr,qn]})),Pt=Qo(K),K=[];for(var No,To,Ga,Tn=0,ho=1,Ro=Array.isArray(Pt[0])?ho:Tn,Mo="",zi=function(on,Kr,qn){var ti="";return qn instanceof wt?(qn=typeof Fe.angle=="number"?Kt(qn,new wt(1,0,0,1,on,Kr)):Kt(new wt(1,0,0,1,on,Kr),qn),p===y.ADVANCED&&(qn=Kt(new wt(1,0,0,-1,0,0),qn)),ti=qn.join(" ")+` Tm
|
|
474
|
+
`):ti=k(on)+" "+k(Kr)+` Td
|
|
475
|
+
`,ti},fn=0;fn<Pt.length;fn++){switch(Mo="",Ro){case ho:Ga=(Ua?"<":"(")+Pt[fn][0]+(Ua?">":")"),No=parseFloat(Pt[fn][1]),To=parseFloat(Pt[fn][2]);break;case Tn:Ga=(Ua?"<":"(")+Pt[fn]+(Ua?">":")"),No=Ii(ce),To=ji(Le)}bi!==void 0&&bi[fn]!==void 0&&(Mo=bi[fn]+` Tw
|
|
476
|
+
`),fn===0?K.push(Mo+zi(No,To,Pn)+Ga):Ro===Tn?K.push(Mo+Ga):Ro===ho&&K.push(Mo+zi(No,To,Pn)+Ga)}K=Ro===Tn?K.join(` Tj
|
|
477
|
+
T* `):K.join(` Tj
|
|
478
|
+
`),K+=` Tj
|
|
479
|
+
`;var Ei=`BT
|
|
480
|
+
/`;return Ei+=lt+" "+ke+` Tf
|
|
481
|
+
`,Ei+=k(ke*Ea)+` TL
|
|
482
|
+
`,Ei+=En+`
|
|
483
|
+
`,Ei+=ui,Ei+=K,ye(Ei+="ET"),g[lt]=!0,Bn};var lo=f.__private__.clip=f.clip=function(K){return ye(K==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return lo("evenodd")},f.__private__.discardPath=f.discardPath=function(){return ye("n"),this};var Oo=f.__private__.isValidStyle=function(K){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(K)!==-1&&(ce=!0),ce};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(K){return Oo(K)&&(c=K),this};var zu=f.__private__.getStyle=f.getStyle=function(K){var ce=c;switch(K){case"D":case"S":ce="S";break;case"F":ce="f";break;case"FD":case"DF":ce="B";break;case"f":case"f*":case"B":case"B*":ce=K}return ce},Xs=f.close=function(){return ye("h"),this};f.stroke=function(){return ye("S"),this},f.fill=function(K){return Dn("f",K),this},f.fillEvenOdd=function(K){return Dn("f*",K),this},f.fillStroke=function(K){return Dn("B",K),this},f.fillStrokeEvenOdd=function(K){return Dn("B*",K),this};var Dn=function(K,ce){kn(ce)==="object"?ou(ce,K):ye(K)},Ks=function(K){K===null||p===y.ADVANCED&&K===void 0||(K=zu(K),ye(K))};function au(K,ce,Le,Fe,Ke){var ht=new dh(ce||this.boundingBox,Le||this.xStep,Fe||this.yStep,this.gState,Ke||this.matrix);ht.stream=this.stream;var Pt=K+"$$"+this.cloneIndex+++"$$";return ut(Pt,ht),ht}var ou=function(K,ce){var Le=Lt[K.key],Fe=it[Le];if(Fe instanceof Sf)ye("q"),ye(of(ce)),Fe.gState&&f.setGState(Fe.gState),ye(K.matrix.toString()+" cm"),ye("/"+Le+" sh"),ye("Q");else if(Fe instanceof dh){var Ke=new wt(1,0,0,-1,0,Ko());K.matrix&&(Ke=Ke.multiply(K.matrix||Yt),Le=au.call(Fe,K.key,K.boundingBox,K.xStep,K.yStep,Ke).id),ye("q"),ye("/Pattern cs"),ye("/"+Le+" scn"),Fe.gState&&f.setGState(Fe.gState),ye(ce),ye("Q")}},of=function(K){switch(K){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},uo=f.moveTo=function(K,ce){return ye(k(O(K))+" "+k(q(ce))+" m"),this},si=f.lineTo=function(K,ce){return ye(k(O(K))+" "+k(q(ce))+" l"),this},Da=f.curveTo=function(K,ce,Le,Fe,Ke,ht){return ye([k(O(K)),k(q(ce)),k(O(Le)),k(q(Fe)),k(O(Ke)),k(q(ht)),"c"].join(" ")),this};f.__private__.line=f.line=function(K,ce,Le,Fe,Ke){if(isNaN(K)||isNaN(ce)||isNaN(Le)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.line");return p===y.COMPAT?this.lines([[Le-K,Fe-ce]],K,ce,[1,1],Ke||"S"):this.lines([[Le-K,Fe-ce]],K,ce,[1,1]).stroke()},f.__private__.lines=f.lines=function(K,ce,Le,Fe,Ke,ht){var Pt,zt,sr,wr,mr,Or,Nn,Pn,Bn,ei,ui,Ua;if(typeof K=="number"&&(Ua=Le,Le=ce,ce=K,K=Ua),Fe=Fe||[1,1],ht=ht||!1,isNaN(ce)||isNaN(Le)||!Array.isArray(K)||!Array.isArray(Fe)||!Oo(Ke)||typeof ht!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(uo(ce,Le),Pt=Fe[0],zt=Fe[1],wr=K.length,ei=ce,ui=Le,sr=0;sr<wr;sr++)(mr=K[sr]).length===2?(ei=mr[0]*Pt+ei,ui=mr[1]*zt+ui,si(ei,ui)):(Or=mr[0]*Pt+ei,Nn=mr[1]*zt+ui,Pn=mr[2]*Pt+ei,Bn=mr[3]*zt+ui,ei=mr[4]*Pt+ei,ui=mr[5]*zt+ui,Da(Or,Nn,Pn,Bn,ei,ui));return ht&&Xs(),Ks(Ke),this},f.path=function(K){for(var ce=0;ce<K.length;ce++){var Le=K[ce],Fe=Le.c;switch(Le.op){case"m":uo(Fe[0],Fe[1]);break;case"l":si(Fe[0],Fe[1]);break;case"c":Da.apply(this,Fe);break;case"h":Xs()}}return this},f.__private__.rect=f.rect=function(K,ce,Le,Fe,Ke){if(isNaN(K)||isNaN(ce)||isNaN(Le)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.rect");return p===y.COMPAT&&(Fe=-Fe),ye([k(O(K)),k(q(ce)),k(O(Le)),k(O(Fe)),"re"].join(" ")),Ks(Ke),this},f.__private__.triangle=f.triangle=function(K,ce,Le,Fe,Ke,ht,Pt){if(isNaN(K)||isNaN(ce)||isNaN(Le)||isNaN(Fe)||isNaN(Ke)||isNaN(ht)||!Oo(Pt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Le-K,Fe-ce],[Ke-Le,ht-Fe],[K-Ke,ce-ht]],K,ce,[1,1],Pt,!0),this},f.__private__.roundedRect=f.roundedRect=function(K,ce,Le,Fe,Ke,ht,Pt){if(isNaN(K)||isNaN(ce)||isNaN(Le)||isNaN(Fe)||isNaN(Ke)||isNaN(ht)||!Oo(Pt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var zt=4/3*(Math.SQRT2-1);return Ke=Math.min(Ke,.5*Le),ht=Math.min(ht,.5*Fe),this.lines([[Le-2*Ke,0],[Ke*zt,0,Ke,ht-ht*zt,Ke,ht],[0,Fe-2*ht],[0,ht*zt,-Ke*zt,ht,-Ke,ht],[2*Ke-Le,0],[-Ke*zt,0,-Ke,-ht*zt,-Ke,-ht],[0,2*ht-Fe],[0,-ht*zt,Ke*zt,-ht,Ke,-ht]],K+Ke,ce,[1,1],Pt,!0),this},f.__private__.ellipse=f.ellipse=function(K,ce,Le,Fe,Ke){if(isNaN(K)||isNaN(ce)||isNaN(Le)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ht=4/3*(Math.SQRT2-1)*Le,Pt=4/3*(Math.SQRT2-1)*Fe;return uo(K+Le,ce),Da(K+Le,ce-Pt,K+ht,ce-Fe,K,ce-Fe),Da(K-ht,ce-Fe,K-Le,ce-Pt,K-Le,ce),Da(K-Le,ce+Pt,K-ht,ce+Fe,K,ce+Fe),Da(K+ht,ce+Fe,K+Le,ce+Pt,K+Le,ce),Ks(Ke),this},f.__private__.circle=f.circle=function(K,ce,Le,Fe){if(isNaN(K)||isNaN(ce)||isNaN(Le)||!Oo(Fe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(K,ce,Le,Le,Fe)},f.setFont=function(K,ce,Le){return Le&&(ce=T(ce,Le)),lt=iu(K,ce,{disableWarning:!1}),this};var su=f.__private__.getFont=f.getFont=function(){return Ht[iu.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var K,ce,Le={};for(K in Me)if(Me.hasOwnProperty(K))for(ce in Le[K]=[],Me[K])Me[K].hasOwnProperty(ce)&&Le[K].push(ce);return Le},f.addFont=function(K,ce,Le,Fe,Ke){var ht=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ht.indexOf(arguments[3])!==-1?Ke=arguments[3]:arguments[3]&&ht.indexOf(arguments[3])==-1&&(Le=T(Le,Fe)),Ke=Ke||"Identity-H",ja.call(this,K,ce,Le,Ke)};var Mi,Ba=e.lineWidth||.200025,Ao=f.__private__.getLineWidth=f.getLineWidth=function(){return Ba},Os=f.__private__.setLineWidth=f.setLineWidth=function(K){return Ba=K,ye(k(O(K))+" w"),this};f.__private__.setLineDash=vr.API.setLineDash=vr.API.setLineDashPattern=function(K,ce){if(K=K||[],ce=ce||0,isNaN(ce)||!Array.isArray(K))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return K=K.map(function(Le){return k(O(Le))}).join(" "),ce=k(O(ce)),ye("["+K+"] "+ce+" d"),this};var gl=f.__private__.getLineHeight=f.getLineHeight=function(){return ke*Mi};f.__private__.getLineHeight=f.getLineHeight=function(){return ke*Mi};var Uu=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(K){return typeof(K=K||1.15)=="number"&&(Mi=K),this},li=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return Mi};Uu(e.lineHeight);var Ii=f.__private__.getHorizontalCoordinate=function(K){return O(K)},ji=f.__private__.getVerticalCoordinate=function(K){return p===y.ADVANCED?K:Rt[F].mediaBox.topRightY-Rt[F].mediaBox.bottomLeftY-O(K)},vl=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(K){return k(Ii(K))},xa=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(K){return k(ji(K))},xn=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return br(xn)},f.__private__.setStrokeColor=f.setDrawColor=function(K,ce,Le,Fe){return xn=hr({ch1:K,ch2:ce,ch3:Le,ch4:Fe,pdfColorType:"draw",precision:2}),ye(xn),this};var Fi=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return br(Fi)},f.__private__.setFillColor=f.setFillColor=function(K,ce,Le,Fe){return Fi=hr({ch1:K,ch2:ce,ch3:Le,ch4:Fe,pdfColorType:"fill",precision:2}),ye(Fi),this};var En=e.textColor||"0 g",ea=f.__private__.getTextColor=f.getTextColor=function(){return br(En)};f.__private__.setTextColor=f.setTextColor=function(K,ce,Le,Fe){return En=hr({ch1:K,ch2:ce,ch3:Le,ch4:Fe,pdfColorType:"text",precision:3}),this};var ta=e.charSpace,qa=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(ta||0)};f.__private__.setCharSpace=f.setCharSpace=function(K){if(isNaN(K))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return ta=K,this};var lu=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function(K){var ce=f.CapJoinStyles[K];if(ce===void 0)throw new Error("Line cap style of '"+K+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return lu=ce,ye(ce+" J"),this};var As=0;f.__private__.setLineJoin=f.setLineJoin=function(K){var ce=f.CapJoinStyles[K];if(ce===void 0)throw new Error("Line join style of '"+K+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return As=ce,ye(ce+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(K){if(K=K||0,isNaN(K))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ye(k(O(K))+" M"),this},f.GState=D1,f.setGState=function(K){(K=typeof K=="string"?At[xt[K]]:Zs(null,K)).equals(Jt)||(ye("/"+K.id+" gs"),Jt=K)};var Zs=function(K,ce){if(!K||!xt[K]){var Le=!1;for(var Fe in At)if(At.hasOwnProperty(Fe)&&At[Fe].equals(ce)){Le=!0;break}if(Le)ce=At[Fe];else{var Ke="GS"+(Object.keys(At).length+1).toString(10);At[Ke]=ce,ce.id=Ke}return K&&(xt[K]=ce.id),Xt.publish("addGState",ce),ce}};f.addGState=function(K,ce){return Zs(K,ce),this},f.saveGraphicsState=function(){return ye("q"),Oe.push({key:lt,size:ke,color:En}),this},f.restoreGraphicsState=function(){ye("Q");var K=Oe.pop();return lt=K.key,ke=K.size,En=K.color,Jt=null,this},f.setCurrentTransformationMatrix=function(K){return ye(K.toString()+" cm"),this},f.comment=function(K){return ye("#"+K),this};var Xn=function(K,ce){var Le=K||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Le},set:function(ht){isNaN(ht)||(Le=parseFloat(ht))}});var Fe=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Fe},set:function(ht){isNaN(ht)||(Fe=parseFloat(ht))}});var Ke="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ke},set:function(ht){Ke=ht.toString()}}),this},mi=function(K,ce,Le,Fe){Xn.call(this,K,ce),this.type="rect";var Ke=Le||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ke},set:function(Pt){isNaN(Pt)||(Ke=parseFloat(Pt))}});var ht=Fe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ht},set:function(Pt){isNaN(Pt)||(ht=parseFloat(Pt))}}),this},nn=function(){this.page=nr,this.currentPage=F,this.pages=be.slice(0),this.pagesContext=Rt.slice(0),this.x=kt,this.y=pt,this.matrix=Ut,this.width=Xo(F),this.height=Ko(F),this.outputDestination=Ae,this.id="",this.objectNumber=-1};nn.prototype.restore=function(){nr=this.page,F=this.currentPage,Rt=this.pagesContext,be=this.pages,kt=this.x,pt=this.y,Ut=this.matrix,yl(F,this.width),uu(F,this.height),Ae=this.outputDestination};var Qs=function(K,ce,Le,Fe,Ke){Vt.push(new nn),nr=F=0,be=[],kt=K,pt=ce,Ut=Ke,Wo([Le,Fe])},za=function(K){if(bt[K])Vt.pop().restore();else{var ce=new nn,Le="Xo"+(Object.keys(Ze).length+1).toString(10);ce.id=Le,bt[K]=Le,Ze[Le]=ce,Xt.publish("addFormObject",ce),Vt.pop().restore()}};for(var ml in f.beginFormObject=function(K,ce,Le,Fe,Ke){return Qs(K,ce,Le,Fe,Ke),this},f.endFormObject=function(K){return za(K),this},f.doFormObject=function(K,ce){var Le=Ze[bt[K]];return ye("q"),ye(ce.toString()+" cm"),ye("/"+Le.id+" Do"),ye("Q"),this},f.getFormObject=function(K){var ce=Ze[bt[K]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},f.save=function(K,ce){return K=K||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(_f(xs($o()),K),typeof _f.unload=="function"&&yr.setTimeout&&setTimeout(_f.unload,911),this):new Promise(function(Le,Fe){try{var Ke=_f(xs($o()),K);typeof _f.unload=="function"&&yr.setTimeout&&setTimeout(_f.unload,911),Le(Ke)}catch(ht){Fe(ht.message)}})},vr.API)vr.API.hasOwnProperty(ml)&&(ml==="events"&&vr.API.events.length?function(K,ce){var Le,Fe,Ke;for(Ke=ce.length-1;Ke!==-1;Ke--)Le=ce[Ke][0],Fe=ce[Ke][1],K.subscribe.apply(K,[Le].concat(typeof Fe=="function"?[Fe]:Fe))}(Xt,vr.API.events):f[ml]=vr.API[ml]);var Xo=f.getPageWidth=function(K){return(Rt[K=K||F].mediaBox.topRightX-Rt[K].mediaBox.bottomLeftX)/ze},yl=f.setPageWidth=function(K,ce){Rt[K].mediaBox.topRightX=ce*ze+Rt[K].mediaBox.bottomLeftX},Ko=f.getPageHeight=function(K){return(Rt[K=K||F].mediaBox.topRightY-Rt[K].mediaBox.bottomLeftY)/ze},uu=f.setPageHeight=function(K,ce){Rt[K].mediaBox.topRightY=ce*ze+Rt[K].mediaBox.bottomLeftY};return f.internal={pdfEscape:ha,getStyle:zu,getFont:su,getFontSize:ve,getCharSpace:qa,getTextColor:ea,getLineHeight:gl,getLineHeightFactor:li,getLineWidth:Ao,write:nt,getHorizontalCoordinate:Ii,getVerticalCoordinate:ji,getCoordinateString:vl,getVerticalCoordinateString:xa,collections:{},newObject:St,newAdditionalObject:qt,newObjectDeferred:Et,newObjectDeferredBegin:et,getFilters:Qr,putStream:Sn,events:Xt,scaleFactor:ze,pageSize:{getWidth:function(){return Xo(F)},setWidth:function(K){yl(F,K)},getHeight:function(){return Ko(F)},setHeight:function(K){uu(F,K)}},encryptionOptions:h,encryption:mn,getEncryptor:Yo,output:Es,getNumberOfPages:af,pages:be,out:ye,f2:R,f3:A,getPageInfo:Fa,getPageInfoByObjId:Dt,getCurrentPageInfo:Ys,getPDFVersion:S,Point:Xn,Rectangle:mi,Matrix:wt,hasHotfix:Ps},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return Xo(F)},set:function(K){yl(F,K)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return Ko(F)},set:function(K){uu(F,K)},enumerable:!0,configurable:!0}),oi.call(f,he),lt="F1",nu(a,t),Xt.publish("initialized"),f}lh.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},lh.prototype.toHexString=function(e){return e.split("").map(function(r){return("0"+(255&r.charCodeAt(0)).toString(16)).slice(-2)}).join("")},lh.prototype.hexToBytes=function(e){for(var r=[],t=0;t<e.length;t+=2)r.push(String.fromCharCode(parseInt(e.substr(t,2),16)));return r.join("")},lh.prototype.processOwnerPassword=function(e,r){return j2(I2(r).substr(0,5),e)},lh.prototype.encryptor=function(e,r){var t=I2(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&r,r>>8&255)).substr(0,10);return function(n){return j2(t,n)}},D1.prototype.equals=function(e){var r,t="id,objectNumber,equals";if(!e||kn(e)!==kn(this))return!1;var n=0;for(r in this)if(!(t.indexOf(r)>=0)){if(this.hasOwnProperty(r)&&!e.hasOwnProperty(r)||this[r]!==e[r])return!1;n++}for(r in e)e.hasOwnProperty(r)&&t.indexOf(r)<0&&n--;return n===0},vr.API={events:[]},vr.version="3.0.1";var ki=vr.API,Bm=1,Df=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ih=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Cr=function(e){return e.toFixed(2)},zc=function(e){return e.toFixed(5)};ki.__acroform__={};var ws=function(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e},nw=function(e){return e*Bm},Au=function(e){var r=new k_,t=ar.internal.getHeight(e)||0,n=ar.internal.getWidth(e)||0;return r.BBox=[0,0,Number(Cr(n)),Number(Cr(t))],r},Wk=ki.__acroform__.setBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<r},$k=ki.__acroform__.clearBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<r)},Yk=ki.__acroform__.getBit=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(e&1<<r)==0?0:1},Ki=ki.__acroform__.getBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Yk(e,r-1)},Zi=ki.__acroform__.setBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Wk(e,r-1)},Qi=ki.__acroform__.clearBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return $k(e,r-1)},Xk=ki.__acroform__.calculateCoordinates=function(e,r){var t=r.internal.getHorizontalCoordinate,n=r.internal.getVerticalCoordinate,a=e[0],i=e[1],o=e[2],s=e[3],u={};return u.lowerLeft_X=t(a)||0,u.lowerLeft_Y=n(i+s)||0,u.upperRight_X=t(a+o)||0,u.upperRight_Y=n(i)||0,[Number(Cr(u.lowerLeft_X)),Number(Cr(u.lowerLeft_Y)),Number(Cr(u.upperRight_X)),Number(Cr(u.upperRight_Y))]},Kk=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var r=[],t=e._V||e.DV,n=F2(e,t),a=e.scope.internal.getFont(e.fontName,e.fontStyle).id;r.push("/Tx BMC"),r.push("q"),r.push("BT"),r.push(e.scope.__private__.encodeColorString(e.color)),r.push("/"+a+" "+Cr(n.fontSize)+" Tf"),r.push("1 0 0 1 0 0 Tm"),r.push(n.text),r.push("ET"),r.push("Q"),r.push("EMC");var i=Au(e);return i.scope=e.scope,i.stream=r.join(`
|
|
484
|
+
`),i}},F2=function(e,r){var t=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},a=(r=(r=r.substr(0,1)=="("?r.substr(1):r).substr(r.length-1)==")"?r.substr(0,r.length-1):r).split(" ");a=e.multiline?a.map(function(A){return A.split(`
|
|
485
|
+
`)}):a.map(function(A){return[A]});var i=t,o=ar.internal.getHeight(e)||0;o=o<0?-o:o;var s=ar.internal.getWidth(e)||0;s=s<0?-s:s;var u=function(A,O,M){if(A+1<a.length){var q=O+" "+a[A+1][0];return h1(q,e,M).width<=s-4}return!1};i++;e:for(;i>0;){r="",i--;var c,h,v=h1("3",e,i).height,g=e.multiline?o-i:(o-v)/2,f=g+=2,E=0,S=0,w=0;if(i<=0){r=`(...) Tj
|
|
486
|
+
`,r+="% Width of Text: "+h1(r,e,i=12).width+", FieldWidth:"+s+`
|
|
487
|
+
`;break}for(var _="",y=0,p=0;p<a.length;p++)if(a.hasOwnProperty(p)){var m=!1;if(a[p].length!==1&&w!==a[p].length-1){if((v+2)*(y+2)+2>o)continue e;_+=a[p][w],m=!0,S=p,p--}else{_=(_+=a[p][w]+" ").substr(_.length-1)==" "?_.substr(0,_.length-1):_;var P=parseInt(p),T=u(P,_,i),k=p>=a.length-1;if(T&&!k){_+=" ",w=0;continue}if(T||k){if(k)S=P;else if(e.multiline&&(v+2)*(y+2)+2>o)continue e}else{if(!e.multiline||(v+2)*(y+2)+2>o)continue e;S=P}}for(var L="",I=E;I<=S;I++){var R=a[I];if(e.multiline){if(I===S){L+=R[w]+" ",w=(w+1)%R.length;continue}if(I===E){L+=R[R.length-1]+" ";continue}}L+=R[0]+" "}switch(L=L.substr(L.length-1)==" "?L.substr(0,L.length-1):L,h=h1(L,e,i).width,e.textAlign){case"right":c=s-h-2;break;case"center":c=(s-h)/2;break;case"left":default:c=2}r+=Cr(c)+" "+Cr(f)+` Td
|
|
488
|
+
`,r+="("+Df(L)+`) Tj
|
|
489
|
+
`,r+=-Cr(c)+` 0 Td
|
|
490
|
+
`,f=-(i+2),h=0,E=m?S:S+1,y++,_=""}break}return n.text=r,n.fontSize=i,n},h1=function(e,r,t){var n=r.scope.internal.getFont(r.fontName,r.fontStyle),a=r.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:r.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:a}},Zk={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Qk=function(e,r){var t={type:"reference",object:e};r.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===t.type&&n.object===t.object})===void 0&&r.internal.getPageInfo(e.page).pageContext.annotations.push(t)},Jk=function(e,r){for(var t in e)if(e.hasOwnProperty(t)){var n=t,a=e[t];r.internal.newObjectDeferredBegin(a.objId,!0),kn(a)==="object"&&typeof a.putStream=="function"&&a.putStream(),delete e[n]}},eL=function(e,r){if(r.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Jl.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(Zk)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Bm=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new L_,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];i.objId=void 0,i.hasAnnotation&&Qk(i,t)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(t){(function(n,a){var i=!n;for(var o in n||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var s=n[o],u=[],c=s.Rect;if(s.Rect&&(s.Rect=Xk(s.Rect,a)),a.internal.newObjectDeferredBegin(s.objId,!0),s.DA=ar.createDefaultAppearanceStream(s),kn(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=c,s.hasAppearanceStream&&!s.appearanceStreamContent){var h=Kk(s);u.push({key:"AP",value:"<</N "+h+">>"}),a.internal.acroformPlugin.xForms.push(h)}if(s.appearanceStreamContent){var v="";for(var g in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(g)){var f=s.appearanceStreamContent[g];if(v+="/"+g+" ",v+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var o in f)if(f.hasOwnProperty(o)){var E=f[o];typeof E=="function"&&(E=E.call(a,s)),v+="/"+o+" "+E+" ",a.internal.acroformPlugin.xForms.indexOf(E)>=0||a.internal.acroformPlugin.xForms.push(E)}}else typeof(E=f)=="function"&&(E=E.call(a,s)),v+="/"+o+" "+E,a.internal.acroformPlugin.xForms.indexOf(E)>=0||a.internal.acroformPlugin.xForms.push(E);v+=">>"}u.push({key:"AP",value:`<<
|
|
491
|
+
`+v+">>"})}a.internal.putStream({additionalKeyValues:u,objectId:s.objId}),a.internal.out("endobj")}i&&Jk(a.internal.acroformPlugin.xForms,a)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},C_=ki.__acroform__.arrayToPdfArray=function(e,r,t){var n=function(o){return o};if(Array.isArray(e)){for(var a="[",i=0;i<e.length;i++)switch(i!==0&&(a+=" "),kn(e[i])){case"boolean":case"number":case"object":a+=e[i].toString();break;case"string":e[i].substr(0,1)!=="/"?(r!==void 0&&t&&(n=t.internal.getEncryptor(r)),a+="("+Df(n(e[i].toString()))+")"):a+=e[i].toString()}return a+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},c2=function(e,r,t){var n=function(a){return a};return r!==void 0&&t&&(n=t.internal.getEncryptor(r)),(e=e||"").toString(),e="("+Df(n(e))+")"},Lu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Lu.prototype.toString=function(){return this.objId+" 0 R"},Lu.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Lu.prototype.getKeyValueListForStream=function(){var e=[],r=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var t in r)if(Object.getOwnPropertyDescriptor(this,r[t]).configurable===!1){var n=r[t],a=this[n];a&&(Array.isArray(a)?e.push({key:n,value:C_(a,this.objId,this.scope)}):a instanceof Lu?(a.scope=this.scope,e.push({key:n,value:a.objId+" 0 R"})):typeof a!="function"&&e.push({key:n,value:a}))}return e};var k_=function(){Lu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,r=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};ws(k_,Lu);var L_=function(){Lu.call(this);var e,r=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return r.length>0?r:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return r}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(n){return n};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Df(t(e))+")"}},set:function(t){e=t}})};ws(L_,Lu);var Jl=function e(){Lu.call(this);var r=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return r},set:function(_){if(isNaN(_))throw new Error('Invalid value "'+_+'" for attribute F supplied.');r=_}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ki(r,3)},set:function(_){_?this.F=Zi(r,3):this.F=Qi(r,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(_){if(isNaN(_))throw new Error('Invalid value "'+_+'" for attribute Ff supplied.');t=_}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(_){n=_!==void 0?_:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(_){n[0]=_}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(_){n[1]=_}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(_){n[2]=_}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(_){n[3]=_}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(_){switch(_){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=_;break;default:throw new Error('Invalid value "'+_+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof B1)return;i="FieldObject"+e.FieldNum++}var _=function(y){return y};return this.scope&&(_=this.scope.internal.getEncryptor(this.objId)),"("+Df(_(i))+")"},set:function(_){i=_.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(_){i=_}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(_){o=_}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(_){s=_}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(_){u=_}});var c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return c===void 0?50/Bm:c},set:function(_){c=_}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(_){h=_}});var v="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!v||this instanceof B1||this instanceof Of))return c2(v,this.objId,this.scope)},set:function(_){_=_.toString(),v=_}});var g=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(g)return this instanceof Ta?g:c2(g,this.objId,this.scope)},set:function(_){_=_.toString(),g=this instanceof Ta?_:_.substr(0,1)==="("?ih(_.substr(1,_.length-2)):ih(_)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ih(g.substr(1,g.length-1)):g},set:function(_){_=_.toString(),g=this instanceof Ta?"/"+_:_}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(_){this.V=_}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Ta?f:c2(f,this.objId,this.scope)},set:function(_){_=_.toString(),f=this instanceof Ta?_:_.substr(0,1)==="("?ih(_.substr(1,_.length-2)):ih(_)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ih(f.substr(1,f.length-1)):f},set:function(_){_=_.toString(),f=this instanceof Ta?"/"+_:_}}),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 E,S=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return S},set:function(_){_=!!_,S=_}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(E)return E},set:function(_){E=_}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,1)},set:function(_){_?this.Ff=Zi(this.Ff,1):this.Ff=Qi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,2)},set:function(_){_?this.Ff=Zi(this.Ff,2):this.Ff=Qi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,3)},set:function(_){_?this.Ff=Zi(this.Ff,3):this.Ff=Qi(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(w!==null)return w},set:function(_){if([0,1,2].indexOf(_)===-1)throw new Error('Invalid value "'+_+'" for attribute Q supplied.');w=_}}),Object.defineProperty(this,"textAlign",{get:function(){var _;switch(w){case 0:default:_="left";break;case 1:_="center";break;case 2:_="right"}return _},configurable:!0,enumerable:!0,set:function(_){switch(_){case"right":case 2:w=2;break;case"center":case 1:w=1;break;case"left":case 0:default:w=0}}})};ws(Jl,Lu);var gh=function(){Jl.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var r=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return C_(r,this.objId,this.scope)},set:function(t){var n,a;a=[],typeof(n=t)=="string"&&(a=function(i,o,s){s||(s=1);for(var u,c=[];u=o.exec(i);)c.push(u[s]);return c}(n,/\((.*?)\)/g)),r=a}}),this.getOptions=function(){return r},this.setOptions=function(t){r=t,this.sort&&r.sort()},this.addOption=function(t){t=(t=t||"").toString(),r.push(t),this.sort&&r.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();r.indexOf(t)!==-1&&(r.splice(r.indexOf(t),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,18)},set:function(t){t?this.Ff=Zi(this.Ff,18):this.Ff=Qi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=Zi(this.Ff,19):this.Ff=Qi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,20)},set:function(t){t?(this.Ff=Zi(this.Ff,20),r.sort()):this.Ff=Qi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,22)},set:function(t){t?this.Ff=Zi(this.Ff,22):this.Ff=Qi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(t){t?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,27)},set:function(t){t?this.Ff=Zi(this.Ff,27):this.Ff=Qi(this.Ff,27)}}),this.hasAppearanceStream=!1};ws(gh,Jl);var vh=function(){gh.call(this),this.fontName="helvetica",this.combo=!1};ws(vh,gh);var mh=function(){vh.call(this),this.combo=!0};ws(mh,vh);var _1=function(){mh.call(this),this.edit=!0};ws(_1,mh);var Ta=function(){Jl.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,15)},set:function(t){t?this.Ff=Zi(this.Ff,15):this.Ff=Qi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,16)},set:function(t){t?this.Ff=Zi(this.Ff,16):this.Ff=Qi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,17)},set:function(t){t?this.Ff=Zi(this.Ff,17):this.Ff=Qi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(t){t?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(i){return i};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(r).length!==0){var n,a=[];for(n in a.push("<<"),r)a.push("/"+n+" ("+Df(t(r[n]))+")");return a.push(">>"),a.join(`
|
|
492
|
+
`)}},set:function(t){kn(t)==="object"&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){typeof t=="string"&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};ws(Ta,Jl);var S1=function(){Ta.call(this),this.pushButton=!0};ws(S1,Ta);var yh=function(){Ta.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r!==void 0?r:[]}})};ws(yh,Ta);var B1=function(){var e,r;Jl.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(a){e=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(a){r=a}});var t,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(s){return s};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),n)o.push("/"+i+" ("+Df(a(n[i]))+")");return o.push(">>"),o.join(`
|
|
493
|
+
`)},set:function(a){kn(a)==="object"&&(n=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(a){typeof a=="string"&&(n.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(a){t="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=ar.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ws(B1,Jl),yh.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var r in this.Kids)if(this.Kids.hasOwnProperty(r)){var t=this.Kids[r];t.appearanceStreamContent=e.createAppearanceStream(t.optionName),t.caption=e.getCA()}},yh.prototype.createOption=function(e){var r=new B1;return r.Parent=this,r.optionName=e,this.Kids.push(r),tL.call(this.scope,r),r};var x1=function(){Ta.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=ar.CheckBox.createAppearanceStream()};ws(x1,Ta);var Of=function(){Jl.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,13)},set:function(r){r?this.Ff=Zi(this.Ff,13):this.Ff=Qi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,21)},set:function(r){r?this.Ff=Zi(this.Ff,21):this.Ff=Qi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(r){r?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,24)},set:function(r){r?this.Ff=Zi(this.Ff,24):this.Ff=Qi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,25)},set:function(r){r?this.Ff=Zi(this.Ff,25):this.Ff=Qi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(r){r?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){Number.isInteger(r)&&(e=r)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ws(Of,Jl);var E1=function(){Of.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,14)},set:function(e){e?this.Ff=Zi(this.Ff,14):this.Ff=Qi(this.Ff,14)}}),this.password=!0};ws(E1,Of);var ar={CheckBox:{createAppearanceStream:function(){return{N:{On:ar.CheckBox.YesNormal},D:{On:ar.CheckBox.YesPushDown,Off:ar.CheckBox.OffPushDown}}},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,a=e.scope.__private__.encodeColorString(e.color),i=F2(e,e.caption);return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+n+" "+Cr(i.fontSize)+" Tf "+a),t.push("BT"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC"),r.stream=t.join(`
|
|
494
|
+
`),r},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),a=[],i=ar.internal.getHeight(e),o=ar.internal.getWidth(e),s=F2(e,e.caption);return a.push("1 g"),a.push("0 0 "+Cr(o)+" "+Cr(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+Cr(o-1)+" "+Cr(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+t+" "+Cr(s.fontSize)+" Tf "+n),a.push(s.text),a.push("ET"),a.push("Q"),r.stream=a.join(`
|
|
495
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
496
|
+
`),r}},RadioButton:{Circle:{createAppearanceStream:function(e){var r={D:{Off:ar.RadioButton.Circle.OffPushDown},N:{}};return r.N[e]=ar.RadioButton.Circle.YesNormal,r.D[e]=ar.RadioButton.Circle.YesPushDown,r},getCA:function(){return"l"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=ar.internal.Bezier_C,i=Number((n*a).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),t.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),t.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),t.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
497
|
+
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*ar.internal.Bezier_C).toFixed(5)),o=Number((n*ar.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),t.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),t.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),t.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
498
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*ar.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
499
|
+
`),r}},Cross:{createAppearanceStream:function(e){var r={D:{Off:ar.RadioButton.Cross.OffPushDown},N:{}};return r.N[e]=ar.RadioButton.Cross.YesNormal,r.D[e]=ar.RadioButton.Cross.YesPushDown,r},getCA:function(){return"8"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.calculateCross(e);return t.push("q"),t.push("1 1 "+Cr(ar.internal.getWidth(e)-2)+" "+Cr(ar.internal.getHeight(e)-2)+" re"),t.push("W"),t.push("n"),t.push(Cr(n.x1.x)+" "+Cr(n.x1.y)+" m"),t.push(Cr(n.x2.x)+" "+Cr(n.x2.y)+" l"),t.push(Cr(n.x4.x)+" "+Cr(n.x4.y)+" m"),t.push(Cr(n.x3.x)+" "+Cr(n.x3.y)+" l"),t.push("s"),t.push("Q"),r.stream=t.join(`
|
|
500
|
+
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=ar.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Cr(ar.internal.getWidth(e)-2)+" "+Cr(ar.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Cr(t.x1.x)+" "+Cr(t.x1.y)+" m"),n.push(Cr(t.x2.x)+" "+Cr(t.x2.y)+" l"),n.push(Cr(t.x4.x)+" "+Cr(t.x4.y)+" m"),n.push(Cr(t.x3.x)+" "+Cr(t.x3.y)+" l"),n.push("s"),n.push("Q"),r.stream=n.join(`
|
|
501
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
502
|
+
`),r}}},createDefaultAppearanceStream:function(e){var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,t=e.scope.__private__.encodeColorString(e.color);return"/"+r+" "+e.fontSize+" Tf "+t}};ar.internal={Bezier_C:.551915024494,calculateCross:function(e){var r=ar.internal.getWidth(e),t=ar.internal.getHeight(e),n=Math.min(r,t);return{x1:{x:(r-n)/2,y:(t-n)/2+n},x2:{x:(r-n)/2+n,y:(t-n)/2},x3:{x:(r-n)/2,y:(t-n)/2},x4:{x:(r-n)/2+n,y:(t-n)/2+n}}}},ar.internal.getWidth=function(e){var r=0;return kn(e)==="object"&&(r=nw(e.Rect[2])),r},ar.internal.getHeight=function(e){var r=0;return kn(e)==="object"&&(r=nw(e.Rect[3])),r};var tL=ki.addField=function(e){if(eL(this,e),!(e instanceof Jl))throw new Error("Invalid argument passed to jsPDF.addField.");var r;return(r=e).scope.internal.acroformPlugin.printedOut&&(r.scope.internal.acroformPlugin.printedOut=!1,r.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),r.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(r),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};ki.AcroFormChoiceField=gh,ki.AcroFormListBox=vh,ki.AcroFormComboBox=mh,ki.AcroFormEditBox=_1,ki.AcroFormButton=Ta,ki.AcroFormPushButton=S1,ki.AcroFormRadioButton=yh,ki.AcroFormCheckBox=x1,ki.AcroFormTextField=Of,ki.AcroFormPasswordField=E1,ki.AcroFormAppearance=ar,ki.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:ar},vr.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:ar};vr.AcroForm;function N_(e){return e.reduce(function(r,t,n){return r[t]=n,r},{})}(function(e){e.__addimage__={};var r="UNKNOWN",t={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(A,O){var M,q,D,te,H,B=r;if((O=O||r)==="RGBA"||A.data!==void 0&&A.data instanceof Uint8ClampedArray&&"height"in A&&"width"in A)return"RGBA";if(T(A))for(H in t)for(D=t[H],M=0;M<D.length;M+=1){for(te=!0,q=0;q<D[M].length;q+=1)if(D[M][q]!==void 0&&D[M][q]!==A[q]){te=!1;break}if(te===!0){B=H;break}}else for(H in t)for(D=t[H],M=0;M<D.length;M+=1){for(te=!0,q=0;q<D[M].length;q+=1)if(D[M][q]!==void 0&&D[M][q]!==A.charCodeAt(q)){te=!1;break}if(te===!0){B=H;break}}return B===r&&O!==r&&(B=O),B},a=function A(O){for(var M=this.internal.write,q=this.internal.putStream,D=(0,this.internal.getFilters)();D.indexOf("FlateEncode")!==-1;)D.splice(D.indexOf("FlateEncode"),1);O.objectId=this.internal.newObject();var te=[];if(te.push({key:"Type",value:"/XObject"}),te.push({key:"Subtype",value:"/Image"}),te.push({key:"Width",value:O.width}),te.push({key:"Height",value:O.height}),O.colorSpace===w.INDEXED?te.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(O.palette.length/3-1)+" "+("sMask"in O&&O.sMask!==void 0?O.objectId+2:O.objectId+1)+" 0 R]"}):(te.push({key:"ColorSpace",value:"/"+O.colorSpace}),O.colorSpace===w.DEVICE_CMYK&&te.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),te.push({key:"BitsPerComponent",value:O.bitsPerComponent}),"decodeParameters"in O&&O.decodeParameters!==void 0&&te.push({key:"DecodeParms",value:"<<"+O.decodeParameters+">>"}),"transparency"in O&&Array.isArray(O.transparency)){for(var H="",B=0,$=O.transparency.length;B<$;B++)H+=O.transparency[B]+" "+O.transparency[B]+" ";te.push({key:"Mask",value:"["+H+"]"})}O.sMask!==void 0&&te.push({key:"SMask",value:O.objectId+1+" 0 R"});var V=O.filter!==void 0?["/"+O.filter]:void 0;if(q({data:O.data,additionalKeyValues:te,alreadyAppliedFilters:V,objectId:O.objectId}),M("endobj"),"sMask"in O&&O.sMask!==void 0){var j="/Predictor "+O.predictor+" /Colors 1 /BitsPerComponent "+O.bitsPerComponent+" /Columns "+O.width,z={width:O.width,height:O.height,colorSpace:"DeviceGray",bitsPerComponent:O.bitsPerComponent,decodeParameters:j,data:O.sMask};"filter"in O&&(z.filter=O.filter),A.call(this,z)}if(O.colorSpace===w.INDEXED){var F=this.internal.newObject();q({data:L(new Uint8Array(O.palette)),objectId:F}),M("endobj")}},i=function(){var A=this.internal.collections.addImage_images;for(var O in A)a.call(this,A[O])},o=function(){var A,O=this.internal.collections.addImage_images,M=this.internal.write;for(var q in O)M("/I"+(A=O[q]).index,A.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var A=this.internal.collections.addImage_images;return s.call(this),A},c=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(A){return typeof e["process"+A.toUpperCase()]=="function"},v=function(A){return kn(A)==="object"&&A.nodeType===1},g=function(A,O){if(A.nodeName==="IMG"&&A.hasAttribute("src")){var M=""+A.getAttribute("src");if(M.indexOf("data:image/")===0)return cp(unescape(M).split("base64,").pop());var q=e.loadFile(M,!0);if(q!==void 0)return q}if(A.nodeName==="CANVAS"){if(A.width===0||A.height===0)throw new Error("Given canvas must have data. Canvas width: "+A.width+", height: "+A.height);var D;switch(O){case"PNG":D="image/png";break;case"WEBP":D="image/webp";break;case"JPEG":case"JPG":default:D="image/jpeg"}return cp(A.toDataURL(D,1).split("base64,").pop())}},f=function(A){var O=this.internal.collections.addImage_images;if(O){for(var M in O)if(A===O[M].alias)return O[M]}},E=function(A,O,M){return A||O||(A=-96,O=-96),A<0&&(A=-1*M.width*72/A/this.internal.scaleFactor),O<0&&(O=-1*M.height*72/O/this.internal.scaleFactor),A===0&&(A=O*M.width/M.height),O===0&&(O=A*M.height/M.width),[A,O]},S=function(A,O,M,q,D,te){var H=E.call(this,M,q,D),B=this.internal.getCoordinateString,$=this.internal.getVerticalCoordinateString,V=u.call(this);if(M=H[0],q=H[1],V[D.index]=D,te){te*=Math.PI/180;var j=Math.cos(te),z=Math.sin(te),F=function(J){return J.toFixed(4)},Y=[F(j),F(z),F(-1*z),F(j),0,0,"cm"]}this.internal.write("q"),te?(this.internal.write([1,"0","0",1,B(A),$(O+q),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([B(M),"0","0",B(q),"0","0","cm"].join(" "))):this.internal.write([B(M),"0","0",B(q),B(A),$(O+q),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+D.index+" Do"),this.internal.write("Q")},w=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var _=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(A){var O,M,q=0;if(typeof A=="string")for(M=A.length,O=0;O<M;O++)q=(q<<5)-q+A.charCodeAt(O),q|=0;else if(T(A))for(M=A.byteLength/2,O=0;O<M;O++)q=(q<<5)-q+A[O],q|=0;return q},p=e.__addimage__.validateStringAsBase64=function(A){(A=A||"").toString().trim();var O=!0;return A.length===0&&(O=!1),A.length%4!=0&&(O=!1),/^[A-Za-z0-9+/]+$/.test(A.substr(0,A.length-2))===!1&&(O=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(A.substr(-2))===!1&&(O=!1),O},m=e.__addimage__.extractImageFromDataUrl=function(A){if(A==null||!(A=A.trim()).startsWith("data:"))return null;var O=A.indexOf(",");return O<0?null:A.substring(0,O).trim().endsWith("base64")?A.substring(O+1):null},P=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(A){return P()&&A instanceof ArrayBuffer};var T=e.__addimage__.isArrayBufferView=function(A){return P()&&typeof Uint32Array<"u"&&(A instanceof Int8Array||A instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&A instanceof Uint8ClampedArray||A instanceof Int16Array||A instanceof Uint16Array||A instanceof Int32Array||A instanceof Uint32Array||A instanceof Float32Array||A instanceof Float64Array)},k=e.__addimage__.binaryStringToUint8Array=function(A){for(var O=A.length,M=new Uint8Array(O),q=0;q<O;q++)M[q]=A.charCodeAt(q);return M},L=e.__addimage__.arrayBufferToBinaryString=function(A){for(var O="",M=T(A)?A:new Uint8Array(A),q=0;q<M.length;q+=8192)O+=String.fromCharCode.apply(null,M.subarray(q,q+8192));return O};e.addImage=function(){var A,O,M,q,D,te,H,B,$;if(typeof arguments[1]=="number"?(O=r,M=arguments[1],q=arguments[2],D=arguments[3],te=arguments[4],H=arguments[5],B=arguments[6],$=arguments[7]):(O=arguments[1],M=arguments[2],q=arguments[3],D=arguments[4],te=arguments[5],H=arguments[6],B=arguments[7],$=arguments[8]),kn(A=arguments[0])==="object"&&!v(A)&&"imageData"in A){var V=A;A=V.imageData,O=V.format||O||r,M=V.x||M||0,q=V.y||q||0,D=V.w||V.width||D,te=V.h||V.height||te,H=V.alias||H,B=V.compression||B,$=V.rotation||V.angle||$}var j=this.internal.getFilters();if(B===void 0&&j.indexOf("FlateEncode")!==-1&&(B="SLOW"),isNaN(M)||isNaN(q))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var z=I.call(this,A,O,H,B);return S.call(this,M,q,D,te,z,$),this};var I=function(A,O,M,q){var D,te,H;if(typeof A=="string"&&n(A)===r){A=unescape(A);var B=R(A,!1);(B!==""||(B=e.loadFile(A,!0))!==void 0)&&(A=B)}if(v(A)&&(A=g(A,O)),O=n(A,O),!h(O))throw new Error("addImage does not support files of type '"+O+"', please ensure that a plugin for '"+O+"' support is added.");if(((H=M)==null||H.length===0)&&(M=function($){return typeof $=="string"||T($)?y($):T($.data)?y($.data):null}(A)),(D=f.call(this,M))||(P()&&(A instanceof Uint8Array||O==="RGBA"||(te=A,A=k(A))),D=this["process"+O.toUpperCase()](A,c.call(this),M,function($){return $&&typeof $=="string"&&($=$.toUpperCase()),$ in e.image_compression?$:_.NONE}(q),te)),!D)throw new Error("An unknown error occurred whilst processing the image.");return D},R=e.__addimage__.convertBase64ToBinaryString=function(A,O){O=typeof O!="boolean"||O;var M,q="";if(typeof A=="string"){var D;M=(D=m(A))!==null&&D!==void 0?D:A;try{q=cp(M)}catch(te){if(O)throw p(M)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+te.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return q};e.getImageProperties=function(A){var O,M,q="";if(v(A)&&(A=g(A)),typeof A=="string"&&n(A)===r&&((q=R(A,!1))===""&&(q=e.loadFile(A)||""),A=q),M=n(A),!h(M))throw new Error("addImage does not support files of type '"+M+"', please ensure that a plugin for '"+M+"' support is added.");if(!P()||A instanceof Uint8Array||(A=k(A)),!(O=this["process"+M.toUpperCase()](A)))throw new Error("An unknown error occurred whilst processing the image");return O.fileType=M,O}})(vr.API),function(e){var r=function(t){if(t!==void 0&&t!="")return!0};vr.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(t){for(var n,a,i,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(t.objId),c=t.pageContext.annotations,h=!1,v=0;v<c.length&&!h;v++)switch((n=c[v]).type){case"link":(r(n.options.url)||r(n.options.pageNumber))&&(h=!0);break;case"reference":case"text":case"freetext":h=!0}if(h!=0){this.internal.write("/Annots [");for(var g=0;g<c.length;g++){n=c[g];var f=this.internal.pdfEscape,E=this.internal.getEncryptor(t.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var S=this.internal.newAdditionalObject(),w=this.internal.newAdditionalObject(),_=this.internal.getEncryptor(S.objId),y=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(_(n.contents))+")",i+=" /Popup "+w.objId+" 0 R",i+=" /P "+u.objId+" 0 R",i+=" /T ("+f(_(y))+") >>",S.content=i;var p=S.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+p,n.open&&(i+=" /Open true"),i+=" >>",w.content=i,this.internal.write(S.objId,"0 R",w.objId,"0 R");break;case"freetext":a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var m=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+f(E(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+m+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var P=this.annotations._nameMap[n.options.name];n.options.pageNumber=P.page,n.options.top=P.y}else n.options.top||(n.options.top=0);if(a="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",i="",n.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+f(E(n.options.url))+") >>";else if(n.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,i+=" /FitV "+n.options.left+"]";break;case"XYZ":default:var T=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+T+" "+n.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(t){var n=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":n.pageContext.annotations.push(t)}},e.link=function(t,n,a,i,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(t),y:c(n),w:u(t+a),h:c(n+i)},options:o,type:"link"})},e.textWithLink=function(t,n,a,i){var o,s,u=this.getTextWidth(t),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){s=i.maxWidth;var h=this.splitTextToSize(t,s).length;o=Math.ceil(c*h)}else s=u,o=c;return this.text(t,n,a,i),a+=.2*c,i.align==="center"&&(n-=u/2),i.align==="right"&&(n-=u),this.link(n,a-c,s,o,i),u},e.getTextWidth=function(t){var n=this.internal.getFontSize();return this.getStringUnitWidth(t)*n/this.internal.scaleFactor}}(vr.API),function(e){var r={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},t={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];e.__arabicParser__={};var i=e.__arabicParser__.isInArabicSubstitutionA=function(S){return r[S.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(S){return typeof S=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(S)},s=e.__arabicParser__.isArabicEndLetter=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(S){return o(S)&&a.indexOf(S.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=1};var c=e.__arabicParser__.arabicLetterHasFinalForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=3};var h=e.__arabicParser__.arabicLetterHasMedialForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length==4},v=e.__arabicParser__.resolveLigatures=function(S){var w=0,_=t,y="",p=0;for(w=0;w<S.length;w+=1)_[S.charCodeAt(w)]!==void 0?(p++,typeof(_=_[S.charCodeAt(w)])=="number"&&(y+=String.fromCharCode(_),_=t,p=0),w===S.length-1&&(_=t,y+=S.charAt(w-(p-1)),w-=p-1,p=0)):(_=t,y+=S.charAt(w-p),w-=p,p=0);return y};e.__arabicParser__.isArabicDiacritic=function(S){return S!==void 0&&n[S.charCodeAt(0)]!==void 0};var g=e.__arabicParser__.getCorrectForm=function(S,w,_){return o(S)?i(S)===!1?-1:!c(S)||!o(w)&&!o(_)||!o(_)&&s(w)||s(S)&&!o(w)||s(S)&&u(w)||s(S)&&s(w)?0:h(S)&&o(w)&&!s(w)&&o(_)&&c(_)?3:s(S)||!o(_)?1:2:-1},f=function(S){var w=0,_=0,y=0,p="",m="",P="",T=(S=S||"").split("\\s+"),k=[];for(w=0;w<T.length;w+=1){for(k.push(""),_=0;_<T[w].length;_+=1)p=T[w][_],m=T[w][_-1],P=T[w][_+1],o(p)?(y=g(p,m,P),k[w]+=y!==-1?String.fromCharCode(r[p.charCodeAt(0)][y]):p):k[w]+=p;k[w]=v(k[w])}return k.join(" ")},E=e.__arabicParser__.processArabic=e.processArabic=function(){var S,w=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,_=[];if(Array.isArray(w)){var y=0;for(_=[],y=0;y<w.length;y+=1)Array.isArray(w[y])?_.push([f(w[y][0]),w[y][1],w[y][2]]):_.push([f(w[y])]);S=_}else S=f(w);return typeof arguments[0]=="string"?S:(arguments[0].text=S,arguments[0])};e.events.push(["preProcessText",E])}(vr.API),vr.API.autoPrint=function(e){var r;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+r+" 0 R")})}return this},function(e){var r=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(s){t=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(s){a=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(s){i=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};r.prototype.getContext=function(t,n){var a;if((t=t||"2d")!=="2d")return null;for(a in n)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=n[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},r.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new r,this.canvas.pdf=this}])}(vr.API),function(e){var r={left:0,top:0,bottom:0,right:0},t=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},r),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(S){u=S}});var c=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return c},set:function(S){c=S}});var h=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return h},set:function(S){h=S}});var v=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return v},set:function(S){v=S}});var g=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return g},set:function(S){g=S}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(S){f=S}});var E=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return E},set:function(S){E=S}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},e.getTextDimensions=function(u,c){n.call(this);var h=(c=c||{}).fontSize||this.getFontSize(),v=c.font||this.getFont(),g=c.scaleFactor||this.internal.scaleFactor,f=0,E=0,S=0,w=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 _=c.maxWidth;_>0?typeof u=="string"?u=this.splitTextToSize(u,_):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(p,m){return p.concat(w.splitTextToSize(m,_))},[])):u=Array.isArray(u)?u:[u];for(var y=0;y<u.length;y++)f<(S=this.getStringUnitWidth(u[y],{font:v})*h)&&(f=S);return f!==0&&(E=u.length),{w:f/=g,h:Math.max((E*h*this.getLineHeightFactor()-h*(this.getLineHeightFactor()-1))/g,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||r;return this.internal.__cell__.lastCell=new i(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=e.cell=function(){var u;u=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var c=this.internal.__cell__.lastCell,h=this.internal.__cell__.padding,v=this.internal.__cell__.margins||r,g=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return c.lineNumber!==void 0&&(c.lineNumber===u.lineNumber?(u.x=(c.x||0)+(c.width||0),u.y=c.y||0):c.y+c.height+u.height+v.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=v.top,f&&g&&(this.printHeaderRow(u.lineNumber,!0),u.y+=g[0].height)):u.y=c.y+c.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,t===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-h,u.y+h,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+h,{align:"center",baseline:"top",maxWidth:u.width-h-h}):this.text(u.text,u.x+h,u.y+h,{align:"left",baseline:"top",maxWidth:u.width-h-h})),this.internal.__cell__.lastCell=u,this};e.table=function(u,c,h,v,g){if(n.call(this),!h)throw new Error("No data for PDF table.");var f,E,S,w,_=[],y=[],p=[],m={},P={},T=[],k=[],L=(g=g||{}).autoSize||!1,I=g.printHeaders!==!1,R=g.css&&g.css["font-size"]!==void 0?16*g.css["font-size"]:g.fontSize||12,A=g.margins||Object.assign({width:this.getPageWidth()},r),O=typeof g.padding=="number"?g.padding:3,M=g.headerBackgroundColor||"#c8c8c8",q=g.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=I,this.internal.__cell__.margins=A,this.internal.__cell__.table_font_size=R,this.internal.__cell__.padding=O,this.internal.__cell__.headerBackgroundColor=M,this.internal.__cell__.headerTextColor=q,this.setFontSize(R),v==null)y=_=Object.keys(h[0]),p=_.map(function(){return"left"});else if(Array.isArray(v)&&kn(v[0])==="object")for(_=v.map(function(V){return V.name}),y=v.map(function(V){return V.prompt||V.name||""}),p=v.map(function(V){return V.align||"left"}),f=0;f<v.length;f+=1)P[v[f].name]=v[f].width*(19.049976/25.4);else Array.isArray(v)&&typeof v[0]=="string"&&(y=_=v,p=_.map(function(){return"left"}));if(L||Array.isArray(v)&&typeof v[0]=="string")for(f=0;f<_.length;f+=1){for(m[w=_[f]]=h.map(function(V){return V[w]}),this.setFont(void 0,"bold"),T.push(this.getTextDimensions(y[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),E=m[w],this.setFont(void 0,"normal"),S=0;S<E.length;S+=1)T.push(this.getTextDimensions(E[S],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);P[w]=Math.max.apply(null,T)+O+O,T=[]}if(I){var D={};for(f=0;f<_.length;f+=1)D[_[f]]={},D[_[f]].text=y[f],D[_[f]].align=p[f];var te=s.call(this,D,P);k=_.map(function(V){return new i(u,c,P[V],te,D[V].text,void 0,D[V].align)}),this.setTableHeaderRow(k),this.printHeaderRow(1,!1)}var H=v.reduce(function(V,j){return V[j.name]=j.align,V},{});for(f=0;f<h.length;f+=1){"rowStart"in g&&g.rowStart instanceof Function&&g.rowStart({row:f,data:h[f]},this);var B=s.call(this,h[f],P);for(S=0;S<_.length;S+=1){var $=h[f][_[S]];"cellStart"in g&&g.cellStart instanceof Function&&g.cellStart({row:f,col:S,data:$},this),o.call(this,new i(u,c,P[_[S]],B,$,f+2,H[_[S]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=c,this};var s=function(u,c){var h=this.internal.__cell__.padding,v=this.internal.__cell__.table_font_size,g=this.internal.scaleFactor;return Object.keys(u).map(function(f){var E=u[f];return this.splitTextToSize(E.hasOwnProperty("text")?E.text:E,c[f]-h-h)},this).map(function(f){return this.getLineHeightFactor()*f.length*v/g+h+h},this).reduce(function(f,E){return Math.max(f,E)},0)};e.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},e.printHeaderRow=function(u,c){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var h;if(t=!0,typeof this.internal.__cell__.headerFunction=="function"){var v=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(v[0],v[1],v[2],v[3],void 0,-1)}this.setFont(void 0,"bold");for(var g=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){h=this.internal.__cell__.tableHeaderRow[f].clone(),c&&(h.y=this.internal.__cell__.margins.top||0,g.push(h)),h.lineNumber=u;var E=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,h),this.setTextColor(E)}g.length>0&&this.setTableHeaderRow(g),this.setFont(void 0,"normal"),t=!1}}(vr.API);var T_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},R_=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],D2=N_(R_),M_=[100,200,300,400,500,600,700,800,900],rL=N_(M_);function B2(e){var r=e.family.replace(/"|'/g,"").toLowerCase(),t=function(i){return T_[i=i||"normal"]?i:"normal"}(e.style),n=function(i){if(!i)return 400;if(typeof i=="number")return i>=100&&i<=900&&i%100==0?i:400;if(/^\d00$/.test(i))return parseInt(i);switch(i){case"bold":return 700;case"normal":default:return 400}}(e.weight),a=function(i){return typeof D2[i=i||"normal"]=="number"?i:"normal"}(e.stretch);return{family:r,style:t,weight:n,stretch:a,src:e.src||[],ref:e.ref||{name:r,style:[a,t,n].join(" ")}}}function iw(e,r,t,n){var a;for(a=t;a>=0&&a<r.length;a+=n)if(e[r[a]])return e[r[a]];for(a=t;a>=0&&a<r.length;a-=n)if(e[r[a]])return e[r[a]]}var nL={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},aw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function ow(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function iL(e,r,t){for(var n=(t=t||{}).defaultFontFamily||"times",a=Object.assign({},nL,t.genericFontFamilies||{}),i=null,o=null,s=0;s<r.length;++s)if(a[(i=B2(r[s])).family]&&(i.family=a[i.family]),e.hasOwnProperty(i.family)){o=e[i.family];break}if(!(o=o||e[n]))throw new Error("Could not find a font-family for the rule '"+ow(i)+"' and default family '"+n+"'.");if(o=function(u,c){if(c[u])return c[u];var h=D2[u],v=h<=D2.normal?-1:1,g=iw(c,R_,h,v);if(!g)throw new Error("Could not find a matching font-stretch value for "+u);return g}(i.stretch,o),o=function(u,c){if(c[u])return c[u];for(var h=T_[u],v=0;v<h.length;++v)if(c[h[v]])return c[h[v]];throw new Error("Could not find a matching font-style for "+u)}(i.style,o),!(o=function(u,c){if(c[u])return c[u];if(u===400&&c[500])return c[500];if(u===500&&c[400])return c[400];var h=rL[u],v=iw(c,M_,h,u<400?-1:1);if(!v)throw new Error("Could not find a matching font-weight for value "+u);return v}(i.weight,o)))throw new Error("Failed to resolve a font for the rule '"+ow(i)+"'.");return o}function sw(e){return e.trimLeft()}function aL(e,r){for(var t=0;t<e.length;){if(e.charAt(t)===r)return[e.substring(0,t),e.substring(t+1)];t+=1}return null}function oL(e){var r=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return r===null?null:[r[0],e.substring(r[0].length)]}var d1,lw,uw,f2=["times"];(function(e){var r,t,n,a,i,o,s,u,c,h=function(z){return z=z||{},this.isStrokeTransparent=z.isStrokeTransparent||!1,this.strokeOpacity=z.strokeOpacity||1,this.strokeStyle=z.strokeStyle||"#000000",this.fillStyle=z.fillStyle||"#000000",this.isFillTransparent=z.isFillTransparent||!1,this.fillOpacity=z.fillOpacity||1,this.font=z.font||"10px sans-serif",this.textBaseline=z.textBaseline||"alphabetic",this.textAlign=z.textAlign||"left",this.lineWidth=z.lineWidth||1,this.lineJoin=z.lineJoin||"miter",this.lineCap=z.lineCap||"butt",this.path=z.path||[],this.transform=z.transform!==void 0?z.transform.clone():new u,this.globalCompositeOperation=z.globalCompositeOperation||"normal",this.globalAlpha=z.globalAlpha||1,this.clip_path=z.clip_path||[],this.currentPoint=z.currentPoint||new o,this.miterLimit=z.miterLimit||10,this.lastPoint=z.lastPoint||new o,this.lineDashOffset=z.lineDashOffset||0,this.lineDash=z.lineDash||[],this.margin=z.margin||[0,0,0,0],this.prevPageLastElemOffset=z.prevPageLastElemOffset||0,this.ignoreClearRect=typeof z.ignoreClearRect!="boolean"||z.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new v(this),r=this.internal.f2,t=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,c=new h}]);var v=function(z){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var F=z;Object.defineProperty(this,"pdf",{get:function(){return F}});var Y=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Y},set:function(Pe){Y=!!Pe}});var J=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return J},set:function(Pe){J=!!Pe}});var X=0;Object.defineProperty(this,"posX",{get:function(){return X},set:function(Pe){isNaN(Pe)||(X=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 c.margin},set:function(Pe){var ye;typeof Pe=="number"?ye=[Pe,Pe,Pe,Pe]:((ye=new Array(4))[0]=Pe[0],ye[1]=Pe.length>=2?Pe[1]:ye[0],ye[2]=Pe.length>=3?Pe[2]:ye[0],ye[3]=Pe.length>=4?Pe[3]:ye[1]),c.margin=ye}});var ae=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ae},set:function(Pe){ae=Pe}});var se=0;Object.defineProperty(this,"lastBreak",{get:function(){return se},set:function(Pe){se=Pe}});var fe=[];Object.defineProperty(this,"pageBreaks",{get:function(){return fe},set:function(Pe){fe=Pe}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(Pe){Pe instanceof h&&(c=Pe)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(Pe){c.path=Pe}});var be=[];Object.defineProperty(this,"ctxStack",{get:function(){return be},set:function(Pe){be=Pe}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Pe){var ye;ye=g(Pe),this.ctx.fillStyle=ye.style,this.ctx.isFillTransparent=ye.a===0,this.ctx.fillOpacity=ye.a,this.pdf.setFillColor(ye.r,ye.g,ye.b,{a:ye.a}),this.pdf.setTextColor(ye.r,ye.g,ye.b,{a:ye.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Pe){var ye=g(Pe);this.ctx.strokeStyle=ye.style,this.ctx.isStrokeTransparent=ye.a===0,this.ctx.strokeOpacity=ye.a,ye.a===0?this.pdf.setDrawColor(255,255,255):(ye.a,this.pdf.setDrawColor(ye.r,ye.g,ye.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(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 _e=null;function Ae(Pe,ye){if(_e===null){var nt=function(Ce){var he=[];return Object.keys(Ce).forEach(function(ke){Ce[ke].forEach(function(Te){var ve=null;switch(Te){case"bold":ve={family:ke,weight:"bold"};break;case"italic":ve={family:ke,style:"italic"};break;case"bolditalic":ve={family:ke,weight:"bold",style:"italic"};break;case"":case"normal":ve={family:ke}}ve!==null&&(ve.ref={name:ke,style:Te},he.push(ve))})}),he}(Pe.getFontList());_e=function(Ce){for(var he={},ke=0;ke<Ce.length;++ke){var Te=B2(Ce[ke]),ve=Te.family,Se=Te.stretch,je=Te.style,Ue=Te.weight;he[ve]=he[ve]||{},he[ve][Se]=he[ve][Se]||{},he[ve][Se][je]=he[ve][Se][je]||{},he[ve][Se][je][Ue]=Te}return he}(nt.concat(ye))}return _e}var Re=null;Object.defineProperty(this,"fontFaces",{get:function(){return Re},set:function(Pe){_e=null,Re=Pe}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Pe){var ye;if(this.ctx.font=Pe,(ye=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Pe))!==null){var nt=ye[1];ye[2];var Ce=ye[3],he=ye[4];ye[5];var ke=ye[6],Te=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(he)[2];he=Math.floor(Te==="px"?parseFloat(he)*this.pdf.internal.scaleFactor:Te==="em"?parseFloat(he)*this.pdf.getFontSize():parseFloat(he)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(he);var ve=function(Je){var lt,ze,kt=[],pt=Je.trim();if(pt==="")return f2;if(pt in aw)return[aw[pt]];for(;pt!=="";){switch(ze=null,lt=(pt=sw(pt)).charAt(0)){case'"':case"'":ze=aL(pt.substring(1),lt);break;default:ze=oL(pt)}if(ze===null||(kt.push(ze[0]),(pt=sw(ze[1]))!==""&&pt.charAt(0)!==","))return f2;pt=pt.replace(/^,/,"")}return kt}(ke);if(this.fontFaces){var Se=iL(Ae(this.pdf,this.fontFaces),ve.map(function(Je){return{family:Je,stretch:"normal",weight:Ce,style:nt}}));this.pdf.setFont(Se.ref.name,Se.ref.style)}else{var je="";(Ce==="bold"||parseInt(Ce,10)>=700||nt==="bold")&&(je="bold"),nt==="italic"&&(je+="italic"),je.length===0&&(je="normal");for(var Ue="",ct={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},mt=0;mt<ve.length;mt++){if(this.pdf.internal.getFont(ve[mt],je,{noFallback:!0,disableWarning:!0})!==void 0){Ue=ve[mt];break}if(je==="bolditalic"&&this.pdf.internal.getFont(ve[mt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ue=ve[mt],je="bold";else if(this.pdf.internal.getFont(ve[mt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ue=ve[mt],je="normal";break}}if(Ue===""){for(var yt=0;yt<ve.length;yt++)if(ct[ve[yt]]){Ue=ct[ve[yt]];break}}Ue=Ue===""?"Times":Ue,this.pdf.setFont(Ue,je)}}}}),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,j.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Pe){this.ctx.lineDash=Pe,j.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Pe){this.ctx.ignoreClearRect=!!Pe}})};v.prototype.setLineDash=function(z){this.lineDash=z},v.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},v.prototype.fill=function(){m.call(this,"fill",!1)},v.prototype.stroke=function(){m.call(this,"stroke",!1)},v.prototype.beginPath=function(){this.path=[{type:"begin"}]},v.prototype.moveTo=function(z,F){if(isNaN(z)||isNaN(F))throw Yn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Y=this.ctx.transform.applyToPoint(new o(z,F));this.path.push({type:"mt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(z,F)},v.prototype.closePath=function(){var z=new o(0,0),F=0;for(F=this.path.length-1;F!==-1;F--)if(this.path[F].type==="begin"&&kn(this.path[F+1])==="object"&&typeof this.path[F+1].x=="number"){z=new o(this.path[F+1].x,this.path[F+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(z.x,z.y)},v.prototype.lineTo=function(z,F){if(isNaN(z)||isNaN(F))throw Yn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Y=this.ctx.transform.applyToPoint(new o(z,F));this.path.push({type:"lt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(Y.x,Y.y)},v.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),m.call(this,null,!0)},v.prototype.quadraticCurveTo=function(z,F,Y,J){if(isNaN(Y)||isNaN(J)||isNaN(z)||isNaN(F))throw Yn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var X=this.ctx.transform.applyToPoint(new o(Y,J)),Q=this.ctx.transform.applyToPoint(new o(z,F));this.path.push({type:"qct",x1:Q.x,y1:Q.y,x:X.x,y:X.y}),this.ctx.lastPoint=new o(X.x,X.y)},v.prototype.bezierCurveTo=function(z,F,Y,J,X,Q){if(isNaN(X)||isNaN(Q)||isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J))throw Yn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ae=this.ctx.transform.applyToPoint(new o(X,Q)),se=this.ctx.transform.applyToPoint(new o(z,F)),fe=this.ctx.transform.applyToPoint(new o(Y,J));this.path.push({type:"bct",x1:se.x,y1:se.y,x2:fe.x,y2:fe.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},v.prototype.arc=function(z,F,Y,J,X,Q){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J)||isNaN(X))throw Yn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Q=!!Q,!this.ctx.transform.isIdentity){var ae=this.ctx.transform.applyToPoint(new o(z,F));z=ae.x,F=ae.y;var se=this.ctx.transform.applyToPoint(new o(0,Y)),fe=this.ctx.transform.applyToPoint(new o(0,0));Y=Math.sqrt(Math.pow(se.x-fe.x,2)+Math.pow(se.y-fe.y,2))}Math.abs(X-J)>=2*Math.PI&&(J=0,X=2*Math.PI),this.path.push({type:"arc",x:z,y:F,radius:Y,startAngle:J,endAngle:X,counterclockwise:Q})},v.prototype.arcTo=function(z,F,Y,J,X){throw new Error("arcTo not implemented.")},v.prototype.rect=function(z,F,Y,J){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J))throw Yn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(z,F),this.lineTo(z+Y,F),this.lineTo(z+Y,F+J),this.lineTo(z,F+J),this.lineTo(z,F),this.lineTo(z+Y,F),this.lineTo(z,F)},v.prototype.fillRect=function(z,F,Y,J){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J))throw Yn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var X={};this.lineCap!=="butt"&&(X.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(X.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(z,F,Y,J),this.fill(),X.hasOwnProperty("lineCap")&&(this.lineCap=X.lineCap),X.hasOwnProperty("lineJoin")&&(this.lineJoin=X.lineJoin)}},v.prototype.strokeRect=function(z,F,Y,J){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J))throw Yn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");E.call(this)||(this.beginPath(),this.rect(z,F,Y,J),this.stroke())},v.prototype.clearRect=function(z,F,Y,J){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J))throw Yn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(z,F,Y,J))},v.prototype.save=function(z){z=typeof z!="boolean"||z;for(var F=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("q");if(this.pdf.setPage(F),z){this.ctx.fontSize=this.pdf.internal.getFontSize();var J=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=J}},v.prototype.restore=function(z){z=typeof z!="boolean"||z;for(var F=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("Q");this.pdf.setPage(F),z&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},v.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(z){var F,Y,J,X;if(z.isCanvasGradient===!0&&(z=z.getColor()),!z)return{r:0,g:0,b:0,a:0,style:z};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(z))F=0,Y=0,J=0,X=0;else{var Q=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(z);if(Q!==null)F=parseInt(Q[1]),Y=parseInt(Q[2]),J=parseInt(Q[3]),X=1;else if((Q=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(z))!==null)F=parseInt(Q[1]),Y=parseInt(Q[2]),J=parseInt(Q[3]),X=parseFloat(Q[4]);else{if(X=1,typeof z=="string"&&z.charAt(0)!=="#"){var ae=new P_(z);z=ae.ok?ae.toHex():"#000000"}z.length===4?(F=z.substring(1,2),F+=F,Y=z.substring(2,3),Y+=Y,J=z.substring(3,4),J+=J):(F=z.substring(1,3),Y=z.substring(3,5),J=z.substring(5,7)),F=parseInt(F,16),Y=parseInt(Y,16),J=parseInt(J,16)}}return{r:F,g:Y,b:J,a:X,style:z}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},E=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};v.prototype.fillText=function(z,F,Y,J){if(isNaN(F)||isNaN(Y)||typeof z!="string")throw Yn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(J=isNaN(J)?void 0:J,!f.call(this)){var X=B(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;O.call(this,{text:z,x:F,y:Y,scale:Q,angle:X,align:this.textAlign,maxWidth:J})}},v.prototype.strokeText=function(z,F,Y,J){if(isNaN(F)||isNaN(Y)||typeof z!="string")throw Yn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!E.call(this)){J=isNaN(J)?void 0:J;var X=B(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;O.call(this,{text:z,x:F,y:Y,scale:Q,renderingMode:"stroke",angle:X,align:this.textAlign,maxWidth:J})}},v.prototype.measureText=function(z){if(typeof z!="string")throw Yn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var F=this.pdf,Y=this.pdf.internal.scaleFactor,J=F.internal.getFontSize(),X=F.getStringUnitWidth(z)*J/F.internal.scaleFactor,Q=function(ae){var se=(ae=ae||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return se}}),this};return new Q({width:X*=Math.round(96*Y/72*1e4)/1e4})},v.prototype.scale=function(z,F){if(isNaN(z)||isNaN(F))throw Yn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new u(z,0,0,F,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},v.prototype.rotate=function(z){if(isNaN(z))throw Yn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var F=new u(Math.cos(z),Math.sin(z),-Math.sin(z),Math.cos(z),0,0);this.ctx.transform=this.ctx.transform.multiply(F)},v.prototype.translate=function(z,F){if(isNaN(z)||isNaN(F))throw Yn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new u(1,0,0,1,z,F);this.ctx.transform=this.ctx.transform.multiply(Y)},v.prototype.transform=function(z,F,Y,J,X,Q){if(isNaN(z)||isNaN(F)||isNaN(Y)||isNaN(J)||isNaN(X)||isNaN(Q))throw Yn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ae=new u(z,F,Y,J,X,Q);this.ctx.transform=this.ctx.transform.multiply(ae)},v.prototype.setTransform=function(z,F,Y,J,X,Q){z=isNaN(z)?1:z,F=isNaN(F)?0:F,Y=isNaN(Y)?0:Y,J=isNaN(J)?1:J,X=isNaN(X)?0:X,Q=isNaN(Q)?0:Q,this.ctx.transform=new u(z,F,Y,J,X,Q)};var S=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};v.prototype.drawImage=function(z,F,Y,J,X,Q,ae,se,fe){var be=this.pdf.getImageProperties(z),_e=1,Ae=1,Re=1,Pe=1;J!==void 0&&se!==void 0&&(Re=se/J,Pe=fe/X,_e=be.width/J*se/J,Ae=be.height/X*fe/X),Q===void 0&&(Q=F,ae=Y,F=0,Y=0),J!==void 0&&se===void 0&&(se=J,fe=X),J===void 0&&se===void 0&&(se=be.width,fe=be.height);for(var ye,nt=this.ctx.transform.decompose(),Ce=B(nt.rotate.shx),he=new u,ke=(he=(he=(he=he.multiply(nt.translate)).multiply(nt.skew)).multiply(nt.scale)).applyToRectangle(new s(Q-F*Re,ae-Y*Pe,J*_e,X*Ae)),Te=w.call(this,ke),ve=[],Se=0;Se<Te.length;Se+=1)ve.indexOf(Te[Se])===-1&&ve.push(Te[Se]);if(p(ve),this.autoPaging)for(var je=ve[0],Ue=ve[ve.length-1],ct=je;ct<Ue+1;ct++){this.pdf.setPage(ct);var mt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],yt=ct===1?this.posY+this.margin[0]:this.margin[0],Je=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],lt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ze=ct===1?0:Je+(ct-2)*lt;if(this.ctx.clip_path.length!==0){var kt=this.path;ye=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(ye,this.posX+this.margin[3],-ze+yt+this.ctx.prevPageLastElemOffset),P.call(this,"fill",!0),this.path=kt}var pt=JSON.parse(JSON.stringify(ke));pt=y([pt],this.posX+this.margin[3],-ze+yt+this.ctx.prevPageLastElemOffset)[0];var Ut=(ct>je||ct<Ue)&&S.call(this);Ut&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],mt,lt,null).clip().discardPath()),this.pdf.addImage(z,"JPEG",pt.x,pt.y,pt.w,pt.h,null,null,Ce),Ut&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(z,"JPEG",ke.x,ke.y,ke.w,ke.h,null,null,Ce)};var w=function(z,F,Y){var J=[];F=F||this.pdf.internal.pageSize.width,Y=Y||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var X=this.posY+this.ctx.prevPageLastElemOffset;switch(z.type){default:case"mt":case"lt":J.push(Math.floor((z.y+X)/Y)+1);break;case"arc":J.push(Math.floor((z.y+X-z.radius)/Y)+1),J.push(Math.floor((z.y+X+z.radius)/Y)+1);break;case"qct":var Q=$(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x,z.y);J.push(Math.floor((Q.y+X)/Y)+1),J.push(Math.floor((Q.y+Q.h+X)/Y)+1);break;case"bct":var ae=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x2,z.y2,z.x,z.y);J.push(Math.floor((ae.y+X)/Y)+1),J.push(Math.floor((ae.y+ae.h+X)/Y)+1);break;case"rect":J.push(Math.floor((z.y+X)/Y)+1),J.push(Math.floor((z.y+z.h+X)/Y)+1)}for(var se=0;se<J.length;se+=1)for(;this.pdf.internal.getNumberOfPages()<J[se];)_.call(this);return J},_=function(){var z=this.fillStyle,F=this.strokeStyle,Y=this.font,J=this.lineCap,X=this.lineWidth,Q=this.lineJoin;this.pdf.addPage(),this.fillStyle=z,this.strokeStyle=F,this.font=Y,this.lineCap=J,this.lineWidth=X,this.lineJoin=Q},y=function(z,F,Y){for(var J=0;J<z.length;J++)switch(z[J].type){case"bct":z[J].x2+=F,z[J].y2+=Y;case"qct":z[J].x1+=F,z[J].y1+=Y;case"mt":case"lt":case"arc":default:z[J].x+=F,z[J].y+=Y}return z},p=function(z){return z.sort(function(F,Y){return F-Y})},m=function(z,F){for(var Y,J,X=this.fillStyle,Q=this.strokeStyle,ae=this.lineCap,se=this.lineWidth,fe=Math.abs(se*this.ctx.transform.scaleX),be=this.lineJoin,_e=JSON.parse(JSON.stringify(this.path)),Ae=JSON.parse(JSON.stringify(this.path)),Re=[],Pe=0;Pe<Ae.length;Pe++)if(Ae[Pe].x!==void 0)for(var ye=w.call(this,Ae[Pe]),nt=0;nt<ye.length;nt+=1)Re.indexOf(ye[nt])===-1&&Re.push(ye[nt]);for(var Ce=0;Ce<Re.length;Ce++)for(;this.pdf.internal.getNumberOfPages()<Re[Ce];)_.call(this);if(p(Re),this.autoPaging)for(var he=Re[0],ke=Re[Re.length-1],Te=he;Te<ke+1;Te++){this.pdf.setPage(Te),this.fillStyle=X,this.strokeStyle=Q,this.lineCap=ae,this.lineWidth=fe,this.lineJoin=be;var ve=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Se=Te===1?this.posY+this.margin[0]:this.margin[0],je=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ct=Te===1?0:je+(Te-2)*Ue;if(this.ctx.clip_path.length!==0){var mt=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(Y,this.posX+this.margin[3],-ct+Se+this.ctx.prevPageLastElemOffset),P.call(this,z,!0),this.path=mt}if(J=JSON.parse(JSON.stringify(_e)),this.path=y(J,this.posX+this.margin[3],-ct+Se+this.ctx.prevPageLastElemOffset),F===!1||Te===0){var yt=(Te>he||Te<ke)&&S.call(this);yt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ve,Ue,null).clip().discardPath()),P.call(this,z,F),yt&&this.pdf.restoreGraphicsState()}this.lineWidth=se}else this.lineWidth=fe,P.call(this,z,F),this.lineWidth=se;this.path=_e},P=function(z,F){if((z!=="stroke"||F||!E.call(this))&&(z==="stroke"||F||!f.call(this))){for(var Y,J,X=[],Q=this.path,ae=0;ae<Q.length;ae++){var se=Q[ae];switch(se.type){case"begin":X.push({begin:!0});break;case"close":X.push({close:!0});break;case"mt":X.push({start:se,deltas:[],abs:[]});break;case"lt":var fe=X.length;if(Q[ae-1]&&!isNaN(Q[ae-1].x)&&(Y=[se.x-Q[ae-1].x,se.y-Q[ae-1].y],fe>0)){for(;fe>=0;fe--)if(X[fe-1].close!==!0&&X[fe-1].begin!==!0){X[fe-1].deltas.push(Y),X[fe-1].abs.push(se);break}}break;case"bct":Y=[se.x1-Q[ae-1].x,se.y1-Q[ae-1].y,se.x2-Q[ae-1].x,se.y2-Q[ae-1].y,se.x-Q[ae-1].x,se.y-Q[ae-1].y],X[X.length-1].deltas.push(Y);break;case"qct":var be=Q[ae-1].x+2/3*(se.x1-Q[ae-1].x),_e=Q[ae-1].y+2/3*(se.y1-Q[ae-1].y),Ae=se.x+2/3*(se.x1-se.x),Re=se.y+2/3*(se.y1-se.y),Pe=se.x,ye=se.y;Y=[be-Q[ae-1].x,_e-Q[ae-1].y,Ae-Q[ae-1].x,Re-Q[ae-1].y,Pe-Q[ae-1].x,ye-Q[ae-1].y],X[X.length-1].deltas.push(Y);break;case"arc":X.push({deltas:[],abs:[],arc:!0}),Array.isArray(X[X.length-1].abs)&&X[X.length-1].abs.push(se)}}J=F?null:z==="stroke"?"stroke":"fill";for(var nt=!1,Ce=0;Ce<X.length;Ce++)if(X[Ce].arc)for(var he=X[Ce].abs,ke=0;ke<he.length;ke++){var Te=he[ke];Te.type==="arc"?L.call(this,Te.x,Te.y,Te.radius,Te.startAngle,Te.endAngle,Te.counterclockwise,void 0,F,!nt):M.call(this,Te.x,Te.y),nt=!0}else if(X[Ce].close===!0)this.pdf.internal.out("h"),nt=!1;else if(X[Ce].begin!==!0){var ve=X[Ce].start.x,Se=X[Ce].start.y;q.call(this,X[Ce].deltas,ve,Se),nt=!0}J&&I.call(this,J),F&&R.call(this)}},T=function(z){var F=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Y=F*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return z-Y;case"top":return z+F-Y;case"hanging":return z+F-2*Y;case"middle":return z+F/2-Y;case"ideographic":return z;case"alphabetic":default:return z}},k=function(z){return z+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};v.prototype.createLinearGradient=function(){var z=function(){};return z.colorStops=[],z.addColorStop=function(F,Y){this.colorStops.push([F,Y])},z.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},z.isCanvasGradient=!0,z},v.prototype.createPattern=function(){return this.createLinearGradient()},v.prototype.createRadialGradient=function(){return this.createLinearGradient()};var L=function(z,F,Y,J,X,Q,ae,se,fe){for(var be=te.call(this,Y,J,X,Q),_e=0;_e<be.length;_e++){var Ae=be[_e];_e===0&&(fe?A.call(this,Ae.x1+z,Ae.y1+F):M.call(this,Ae.x1+z,Ae.y1+F)),D.call(this,z,F,Ae.x2,Ae.y2,Ae.x3,Ae.y3,Ae.x4,Ae.y4)}se?R.call(this):I.call(this,ae)},I=function(z){switch(z){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},R=function(){this.pdf.clip(),this.pdf.discardPath()},A=function(z,F){this.pdf.internal.out(t(z)+" "+n(F)+" m")},O=function(z){var F;switch(z.align){case"right":case"end":F="right";break;case"center":F="center";break;case"left":case"start":default:F="left"}var Y=this.pdf.getTextDimensions(z.text),J=T.call(this,z.y),X=k.call(this,J)-Y.h,Q=this.ctx.transform.applyToPoint(new o(z.x,J)),ae=this.ctx.transform.decompose(),se=new u;se=(se=(se=se.multiply(ae.translate)).multiply(ae.skew)).multiply(ae.scale);for(var fe,be,_e,Ae=this.ctx.transform.applyToRectangle(new s(z.x,J,Y.w,Y.h)),Re=se.applyToRectangle(new s(z.x,X,Y.w,Y.h)),Pe=w.call(this,Re),ye=[],nt=0;nt<Pe.length;nt+=1)ye.indexOf(Pe[nt])===-1&&ye.push(Pe[nt]);if(p(ye),this.autoPaging)for(var Ce=ye[0],he=ye[ye.length-1],ke=Ce;ke<he+1;ke++){this.pdf.setPage(ke);var Te=ke===1?this.posY+this.margin[0]:this.margin[0],ve=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Se=this.pdf.internal.pageSize.height-this.margin[2],je=Se-this.margin[0],Ue=this.pdf.internal.pageSize.width-this.margin[1],ct=Ue-this.margin[3],mt=ke===1?0:ve+(ke-2)*je;if(this.ctx.clip_path.length!==0){var yt=this.path;fe=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(fe,this.posX+this.margin[3],-1*mt+Te),P.call(this,"fill",!0),this.path=yt}var Je=y([JSON.parse(JSON.stringify(Re))],this.posX+this.margin[3],-mt+Te+this.ctx.prevPageLastElemOffset)[0];z.scale>=.01&&(be=this.pdf.internal.getFontSize(),this.pdf.setFontSize(be*z.scale),_e=this.lineWidth,this.lineWidth=_e*z.scale);var lt=this.autoPaging!=="text";if(lt||Je.y+Je.h<=Se){if(lt||Je.y>=Te&&Je.x<=Ue){var ze=lt?z.text:this.pdf.splitTextToSize(z.text,z.maxWidth||Ue-Je.x)[0],kt=y([JSON.parse(JSON.stringify(Ae))],this.posX+this.margin[3],-mt+Te+this.ctx.prevPageLastElemOffset)[0],pt=lt&&(ke>Ce||ke<he)&&S.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ct,je,null).clip().discardPath()),this.pdf.text(ze,kt.x,kt.y,{angle:z.angle,align:F,renderingMode:z.renderingMode}),pt&&this.pdf.restoreGraphicsState()}}else Je.y<Se&&(this.ctx.prevPageLastElemOffset+=Se-Je.y);z.scale>=.01&&(this.pdf.setFontSize(be),this.lineWidth=_e)}else z.scale>=.01&&(be=this.pdf.internal.getFontSize(),this.pdf.setFontSize(be*z.scale),_e=this.lineWidth,this.lineWidth=_e*z.scale),this.pdf.text(z.text,Q.x+this.posX,Q.y+this.posY,{angle:z.angle,align:F,renderingMode:z.renderingMode,maxWidth:z.maxWidth}),z.scale>=.01&&(this.pdf.setFontSize(be),this.lineWidth=_e)},M=function(z,F,Y,J){Y=Y||0,J=J||0,this.pdf.internal.out(t(z+Y)+" "+n(F+J)+" l")},q=function(z,F,Y){return this.pdf.lines(z,F,Y,null,null)},D=function(z,F,Y,J,X,Q,ae,se){this.pdf.internal.out([r(a(Y+z)),r(i(J+F)),r(a(X+z)),r(i(Q+F)),r(a(ae+z)),r(i(se+F)),"c"].join(" "))},te=function(z,F,Y,J){for(var X=2*Math.PI,Q=Math.PI/2;F>Y;)F-=X;var ae=Math.abs(Y-F);ae<X&&J&&(ae=X-ae);for(var se=[],fe=J?-1:1,be=F;ae>1e-5;){var _e=be+fe*Math.min(ae,Q);se.push(H.call(this,z,be,_e)),ae-=Math.abs(_e-be),be=_e}return se},H=function(z,F,Y){var J=(Y-F)/2,X=z*Math.cos(J),Q=z*Math.sin(J),ae=X,se=-Q,fe=ae*ae+se*se,be=fe+ae*X+se*Q,_e=4/3*(Math.sqrt(2*fe*be)-be)/(ae*Q-se*X),Ae=ae-_e*se,Re=se+_e*ae,Pe=Ae,ye=-Re,nt=J+F,Ce=Math.cos(nt),he=Math.sin(nt);return{x1:z*Math.cos(F),y1:z*Math.sin(F),x2:Ae*Ce-Re*he,y2:Ae*he+Re*Ce,x3:Pe*Ce-ye*he,y3:Pe*he+ye*Ce,x4:z*Math.cos(Y),y4:z*Math.sin(Y)}},B=function(z){return 180*z/Math.PI},$=function(z,F,Y,J,X,Q){var ae=z+.5*(Y-z),se=F+.5*(J-F),fe=X+.5*(Y-X),be=Q+.5*(J-Q),_e=Math.min(z,X,ae,fe),Ae=Math.max(z,X,ae,fe),Re=Math.min(F,Q,se,be),Pe=Math.max(F,Q,se,be);return new s(_e,Re,Ae-_e,Pe-Re)},V=function(z,F,Y,J,X,Q,ae,se){var fe,be,_e,Ae,Re,Pe,ye,nt,Ce,he,ke,Te,ve,Se,je=Y-z,Ue=J-F,ct=X-Y,mt=Q-J,yt=ae-X,Je=se-Q;for(be=0;be<41;be++)Ce=(ye=(_e=z+(fe=be/40)*je)+fe*((Re=Y+fe*ct)-_e))+fe*(Re+fe*(X+fe*yt-Re)-ye),he=(nt=(Ae=F+fe*Ue)+fe*((Pe=J+fe*mt)-Ae))+fe*(Pe+fe*(Q+fe*Je-Pe)-nt),be==0?(ke=Ce,Te=he,ve=Ce,Se=he):(ke=Math.min(ke,Ce),Te=Math.min(Te,he),ve=Math.max(ve,Ce),Se=Math.max(Se,he));return new s(Math.round(ke),Math.round(Te),Math.round(ve-ke),Math.round(Se-Te))},j=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var z,F,Y=(z=this.ctx.lineDash,F=this.ctx.lineDashOffset,JSON.stringify({lineDash:z,lineDashOffset:F}));this.prevLineDash!==Y&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Y)}}})(vr.API),function(e){var r=function(i){var o,s,u,c,h,v,g,f,E,S;for(s=[],u=0,c=(i+=o="\0\0\0\0".slice(i.length%4||4)).length;c>u;u+=4)(h=(i.charCodeAt(u)<<24)+(i.charCodeAt(u+1)<<16)+(i.charCodeAt(u+2)<<8)+i.charCodeAt(u+3))!==0?(v=(h=((h=((h=((h=(h-(S=h%85))/85)-(E=h%85))/85)-(f=h%85))/85)-(g=h%85))/85)%85,s.push(v+33,g+33,f+33,E+33,S+33)):s.push(122);return function(w,_){for(var y=_;y>0;y--)w.pop()}(s,o.length),String.fromCharCode.apply(String,s)+"~>"},t=function(i){var o,s,u,c,h,v=String,g="length",f=255,E="charCodeAt",S="slice",w="replace";for(i[S](-2),i=i[S](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),u=[],c=0,h=(i+=o="uuuuu"[S](i[g]%5||5))[g];h>c;c+=5)s=52200625*(i[E](c)-33)+614125*(i[E](c+1)-33)+7225*(i[E](c+2)-33)+85*(i[E](c+3)-33)+(i[E](c+4)-33),u.push(f&s>>24,f&s>>16,f&s>>8,f&s);return function(_,y){for(var p=y;p>0;p--)_.pop()}(u,o[g]),v.fromCharCode.apply(v,u)},n=function(i){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((i=i.replace(/\s/g,"")).indexOf(">")!==-1&&(i=i.substr(0,i.indexOf(">"))),i.length%2&&(i+="0"),o.test(i)===!1)return"";for(var s="",u=0;u<i.length;u+=2)s+=String.fromCharCode("0x"+(i[u]+i[u+1]));return s},a=function(i){for(var o=new Uint8Array(i.length),s=i.length;s--;)o[s]=i.charCodeAt(s);return i=(o=R2(o)).reduce(function(u,c){return u+String.fromCharCode(c)},"")};e.processDataByFilters=function(i,o){var s=0,u=i||"",c=[];for(typeof(o=o||[])=="string"&&(o=[o]),s=0;s<o.length;s+=1)switch(o[s]){case"ASCII85Decode":case"/ASCII85Decode":u=t(u),c.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=r(u),c.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=n(u),c.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=u.split("").map(function(h){return("0"+h.charCodeAt().toString(16)).slice(-2)}).join("")+">",c.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=a(u),c.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[s]+'" is not implemented')}return{data:u,reverseChain:c.reverse().join(" ")}}}(vr.API),function(e){e.loadFile=function(r,t,n){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(u,c,h){var v=new XMLHttpRequest,g=0,f=function(E){var S=E.length,w=[],_=String.fromCharCode;for(g=0;g<S;g+=1)w.push(_(255&E.charCodeAt(g)));return w.join("")};if(v.open("GET",u,!c),v.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(v.onload=function(){v.status===200?h(f(this.responseText)):h(void 0)}),v.send(null),c&&v.status===200)return f(v.responseText)}(a,i,o)}catch{}return s}(r,t,n)},e.loadImageFile=e.loadFile}(vr.API),function(e){function r(){return(yr.html2canvas?Promise.resolve(yr.html2canvas):C2(()=>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 t(){return(yr.DOMPurify?Promise.resolve(yr.DOMPurify):C2(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var n=function(o){var s=kn(o);return s==="undefined"?"undefined":s==="string"||o instanceof String?"string":s==="number"||o instanceof Number?"number":s==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":s==="object"?"object":"unknown"},a=function(o,s){var u=document.createElement(o);for(var c in s.className&&(u.className=s.className),s.innerHTML&&s.dompurify&&(u.innerHTML=s.dompurify.sanitize(s.innerHTML)),s.style)u.style[c]=s.style[c];return u},i=function o(s){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),c=o.convert(Promise.resolve(),u);return c=(c=c.setProgress(1,o,1,[o])).set(s)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(o,s){return o.__proto__=s||i.prototype,o},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(o,s){return this.then(function(){switch(s=s||function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o)){case"string":return this.then(t).then(function(u){return this.set({src:a("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},i.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},s=function u(c,h){for(var v=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),g=c.firstChild;g;g=g.nextSibling)h!==!0&&g.nodeType===1&&g.nodeName==="SCRIPT"||v.appendChild(u(g,h));return c.nodeType===1&&(c.nodeName==="CANVAS"?(v.width=c.width,v.height=c.height,v.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(v.value=c.value),v.addEventListener("load",function(){v.scrollTop=c.scrollTop,v.scrollLeft=c.scrollLeft},!0)),v}(this.prop.src,this.opt.html2canvas.javascriptEnabled);s.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(s),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},i.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,s(this.prop.container,u)}).then(function(s){(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var u=this.opt.jsPDF,c=this.opt.fontFaces,h=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,v=Object.assign({async:!0,allowTaint:!0,scale:h,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete v.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=c,c)for(var g=0;g<c.length;++g){var f=c[g],E=f.src.find(function(S){return S.format==="truetype"});E&&u.addFont(E.url,f.ref.name,f.ref.style)}return v.windowHeight=v.windowHeight||0,v.windowHeight=v.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):v.windowHeight,u.context2d.save(!0),s(this.prop.container,v)}).then(function(s){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},i.prototype.output=function(o,s,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,s):this.outputPdf(o,s)},i.prototype.outputPdf=function(o,s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,s)})},i.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},i.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},i.prototype.set=function(o){if(n(o)!=="object")return this;var s=Object.keys(o||{}).map(function(u){if(u in i.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(s)})},i.prototype.get=function(o,s){return this.then(function(){var u=o in i.template.prop?this.prop[o]:this.opt[o];return s?s(u):u})},i.prototype.setMargin=function(o){return this.then(function(){switch(n(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},i.prototype.setPageSize=function(o){function s(u,c){return Math.floor(u*c/72*96)}return this.then(function(){(o=o||vr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:s(o.inner.width,o.k),height:s(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},i.prototype.setProgress=function(o,s,u,c){return o!=null&&(this.progress.val=o),s!=null&&(this.progress.state=s),u!=null&&(this.progress.n=u),c!=null&&(this.progress.stack=c),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(o,s,u,c){return this.setProgress(o?this.progress.val+o:null,s||null,u?this.progress.n+u:null,c?this.progress.stack.concat(c):null)},i.prototype.then=function(o,s){var u=this;return this.thenCore(o,s,function(c,h){return u.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(v){return u.updateProgress(null,c),v}).then(c,h).then(function(v){return u.updateProgress(1),v})})},i.prototype.thenCore=function(o,s,u){u=u||Promise.prototype.then,o&&(o=o.bind(this)),s&&(s=s.bind(this));var c=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:i.convert(Object.assign({},this),Promise.prototype),h=u.call(c,o,s);return i.convert(h,this.__proto__)},i.prototype.thenExternal=function(o,s){return Promise.prototype.then.call(this,o,s)},i.prototype.thenList=function(o){var s=this;return o.forEach(function(u){s=s.thenCore(u)}),s},i.prototype.catch=function(o){o&&(o=o.bind(this));var s=Promise.prototype.catch.call(this,o);return i.convert(s,this)},i.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},i.prototype.error=function(o){return this.then(function(){throw new Error(o)})},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,vr.getPageSize=function(o,s,u){if(kn(o)==="object"){var c=o;o=c.orientation,s=c.unit||s,u=c.format||u}s=s||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,v=(""+u).toLowerCase(),g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(s){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+s}var f,E=0,S=0;if(g.hasOwnProperty(v))E=g[v][1]/h,S=g[v][0]/h;else try{E=u[1],S=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",S>E&&(f=S,S=E,E=f);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",E>S&&(f=S,S=E,E=f)}return{width:S,height:E,unit:s,k:h,orientation:o}},e.html=function(o,s){(s=s||{}).callback=s.callback||function(){},s.html2canvas=s.html2canvas||{},s.html2canvas.canvas=s.html2canvas.canvas||this.canvas,s.jsPDF=s.jsPDF||this,s.fontFaces=s.fontFaces?s.fontFaces.map(B2):null;var u=new i(s);return s.worker?u:u.from(o).doCallback()}}(vr.API),vr.API.addJS=function(e){return uw=e,this.internal.events.subscribe("postPutResources",function(){d1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(d1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),lw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+uw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){d1!==void 0&&lw!==void 0&&this.internal.out("/Names <</JavaScript "+d1+" 0 R>>")}),this},function(e){var r;e.events.push(["postPutResources",function(){var t=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=t.outline.render().split(/\r\n/),i=0;i<a.length;i++){var o=a[i],s=n.exec(o);if(s!=null){var u=s[1];t.internal.newObjectDeferredBegin(u,!1)}t.internal.write(o)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,h=[];for(i=0;i<c;i++){var v=t.internal.newObject();h.push(v);var g=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var f=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<h.length;i++)t.internal.write("(page_"+(i+1)+")"+h[i]+" 0 R");t.internal.write(" ] >>","endobj"),r=t.internal.newObject(),t.internal.write("<< /Dests "+f+" 0 R"),t.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+r+" 0 R"))}]),e.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(n,a,i){var o={title:a,options:i,children:[]};return n==null&&(n=this.root),n.children.push(o),o},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(n){n.id=t.internal.newObjectDeferred();for(var a=0;a<n.children.length;a++)this.genIds_r(n.children[a])},t.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},t.outline.renderItems=function(n){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<n.children.length;i++){var o=n.children[i];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),i>0&&this.line("/Prev "+this.makeRef(n.children[i-1])),i<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[i+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var u=t.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var c=0;c<n.children.length;c++)this.renderItems(n.children[c])},t.outline.line=function(n){this.ctx.val+=n+`\r
|
|
503
|
+
`},t.outline.makeRef=function(n){return n.id+" 0 R"},t.outline.makeString=function(n){return"("+t.internal.pdfEscape(n)+")"},t.outline.objStart=function(n){this.ctx.val+=`\r
|
|
504
|
+
`+n.id+` 0 obj\r
|
|
505
|
+
<<\r
|
|
506
|
+
`},t.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
507
|
+
endobj\r
|
|
508
|
+
`},t.outline.count_r=function(n,a){for(var i=0;i<a.children.length;i++)n.count++,this.count_r(n,a.children[i]);return n.count}}])}(vr.API),function(e){var r=[192,193,194,195,196,197,198,199];e.processJPEG=function(t,n,a,i,o,s){var u,c=this.decode.DCT_DECODE,h=null;if(typeof t=="string"||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=o||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(u=function(v){for(var g,f=256*v.charCodeAt(4)+v.charCodeAt(5),E=v.length,S={width:0,height:0,numcomponents:1},w=4;w<E;w+=2){if(w+=f,r.indexOf(v.charCodeAt(w+1))!==-1){g=256*v.charCodeAt(w+5)+v.charCodeAt(w+6),S={width:256*v.charCodeAt(w+7)+v.charCodeAt(w+8),height:g,numcomponents:v.charCodeAt(w+9)};break}f=256*v.charCodeAt(w+2)+v.charCodeAt(w+3)}return S}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}h={data:t,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:c,index:n,alias:a}}return h}}(vr.API);var ah,p1,cw,fw,hw,sL=function(){var e,r,t;function n(i){var o,s,u,c,h,v,g,f,E,S,w,_,y,p;for(this.data=i,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},v=null;;){switch(o=this.readUInt32(),E=(function(){var m,P;for(P=[],m=0;m<4;++m)P.push(String.fromCharCode(this.data[this.pos++]));return P}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(o);break;case"fcTL":v&&this.animation.frames.push(v),this.pos+=4,v={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,v.delay=1e3*h/c,v.disposeOp=this.data[this.pos++],v.blendOp=this.data[this.pos++],v.data=[];break;case"IDAT":case"fdAT":for(E==="fdAT"&&(this.pos+=4,o-=4),i=v?.data||this.imgData,_=0;0<=o?_<o:_>o;0<=o?++_:--_)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(u=this.palette.length/3,this.transparency.indexed=this.read(o),this.transparency.indexed.length>u)throw new Error("More transparent colors than palette size");if((S=u-this.transparency.indexed.length)>0)for(y=0;0<=S?y<S:y>S;0<=S?++y:--y)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(o)[0];break;case 2:this.transparency.rgb=this.read(o)}break;case"tEXt":g=(w=this.read(o)).indexOf(0),f=String.fromCharCode.apply(String,w.slice(0,g)),this.text[f]=String.fromCharCode.apply(String,w.slice(g+1));break;case"IEND":return v&&this.animation.frames.push(v),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(p=this.colorType)===4||p===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=o}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}n.prototype.read=function(i){var o,s;for(s=[],o=0;0<=i?o<i:o>i;0<=i?++o:--o)s.push(this.data[this.pos++]);return s},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(i){var o=this.pixelBitlength/8,s=new Uint8Array(this.width*this.height*o),u=0,c=this;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);function h(v,g,f,E){var S,w,_,y,p,m,P,T,k,L,I,R,A,O,M,q,D,te,H,B,$,V=Math.ceil((c.width-v)/f),j=Math.ceil((c.height-g)/E),z=c.width==V&&c.height==j;for(O=o*V,R=z?s:new Uint8Array(O*j),m=i.length,A=0,w=0;A<j&&u<m;){switch(i[u++]){case 0:for(y=D=0;D<O;y=D+=1)R[w++]=i[u++];break;case 1:for(y=te=0;te<O;y=te+=1)S=i[u++],p=y<o?0:R[w-o],R[w++]=(S+p)%256;break;case 2:for(y=H=0;H<O;y=H+=1)S=i[u++],_=(y-y%o)/o,M=A&&R[(A-1)*O+_*o+y%o],R[w++]=(M+S)%256;break;case 3:for(y=B=0;B<O;y=B+=1)S=i[u++],_=(y-y%o)/o,p=y<o?0:R[w-o],M=A&&R[(A-1)*O+_*o+y%o],R[w++]=(S+Math.floor((p+M)/2))%256;break;case 4:for(y=$=0;$<O;y=$+=1)S=i[u++],_=(y-y%o)/o,p=y<o?0:R[w-o],A===0?M=q=0:(M=R[(A-1)*O+_*o+y%o],q=_&&R[(A-1)*O+(_-1)*o+y%o]),P=p+M-q,T=Math.abs(P-p),L=Math.abs(P-M),I=Math.abs(P-q),k=T<=L&&T<=I?p:L<=I?M:q,R[w++]=(S+k)%256;break;default:throw new Error("Invalid filter algorithm: "+i[u-1])}if(!z){var F=((g+A*E)*c.width+v)*o,Y=A*O;for(y=0;y<V;y+=1){for(var J=0;J<o;J+=1)s[F++]=R[Y++];F+=(f-1)*o}}A++}}return i=Bk(i),c.interlaceMethod==1?(h(0,0,8,8),h(4,0,8,8),h(0,4,4,8),h(2,0,4,4),h(0,2,2,4),h(1,0,2,2),h(0,1,1,2)):h(0,0,1,1),s},n.prototype.decodePalette=function(){var i,o,s,u,c,h,v,g,f;for(s=this.palette,h=this.transparency.indexed||[],c=new Uint8Array((h.length||0)+s.length),u=0,i=0,o=v=0,g=s.length;v<g;o=v+=3)c[u++]=s[o],c[u++]=s[o+1],c[u++]=s[o+2],c[u++]=(f=h[i++])!=null?f:255;return c},n.prototype.copyToImageData=function(i,o){var s,u,c,h,v,g,f,E,S,w,_;if(u=this.colors,S=null,s=this.hasAlphaChannel,this.palette.length&&(S=(_=this._decodedPalette)!=null?_:this._decodedPalette=this.decodePalette(),u=4,s=!0),E=(c=i.data||i).length,v=S||o,h=g=0,u===1)for(;h<E;)f=S?4*o[h/4]:g,w=v[f++],c[h++]=w,c[h++]=w,c[h++]=w,c[h++]=s?v[f++]:255,g=f;else for(;h<E;)f=S?4*o[h/4]:g,c[h++]=v[f++],c[h++]=v[f++],c[h++]=v[f++],c[h++]=s?v[f++]:255,g=f},n.prototype.decode=function(){var i;return i=new Uint8Array(this.width*this.height*4),this.copyToImageData(i,this.decodePixels()),i};var a=function(){if(Object.prototype.toString.call(yr)==="[object Window]"){try{r=yr.document.createElement("canvas"),t=r.getContext("2d")}catch{return!1}return!0}return!1};return a(),e=function(i){var o;if(a()===!0)return t.width=i.width,t.height=i.height,t.clearRect(0,0,i.width,i.height),t.putImageData(i,0,0),(o=new Image).src=r.toDataURL(),o;throw new Error("This method requires a Browser with Canvas-capability.")},n.prototype.decodeFrames=function(i){var o,s,u,c,h,v,g,f;if(this.animation){for(f=[],s=h=0,v=(g=this.animation.frames).length;h<v;s=++h)o=g[s],u=i.createImageData(o.width,o.height),c=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(u,c),o.imageData=u,f.push(o.image=e(u));return f}},n.prototype.renderFrame=function(i,o){var s,u,c;return s=(u=this.animation.frames)[o],c=u[o-1],o===0&&i.clearRect(0,0,this.width,this.height),c?.disposeOp===1?i.clearRect(c.xOffset,c.yOffset,c.width,c.height):c?.disposeOp===2&&i.putImageData(c.imageData,c.xOffset,c.yOffset),s.blendOp===0&&i.clearRect(s.xOffset,s.yOffset,s.width,s.height),i.drawImage(s.image,s.xOffset,s.yOffset)},n.prototype.animate=function(i){var o,s,u,c,h,v,g=this;return s=0,v=this.animation,c=v.numFrames,u=v.frames,h=v.numPlays,(o=function(){var f,E;if(f=s++%c,E=u[f],g.renderFrame(i,f),c>1&&s/c<h)return g.animation._timeout=setTimeout(o,E.delay)})()},n.prototype.stopAnimation=function(){var i;return clearTimeout((i=this.animation)!=null?i._timeout:void 0)},n.prototype.render=function(i){var o,s;return i._png&&i._png.stopAnimation(),i._png=this,i.width=this.width,i.height=this.height,o=i.getContext("2d"),this.animation?(this.decodeFrames(o),this.animate(o)):(s=o.createImageData(this.width,this.height),this.copyToImageData(s,this.decodePixels()),o.putImageData(s,0,0))},n}();/**
|
|
509
|
+
* @license
|
|
510
|
+
*
|
|
511
|
+
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
|
512
|
+
*
|
|
513
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
514
|
+
* a copy of this software and associated documentation files (the
|
|
515
|
+
* "Software"), to deal in the Software without restriction, including
|
|
516
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
517
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
518
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
519
|
+
* the following conditions:
|
|
520
|
+
*
|
|
521
|
+
* The above copyright notice and this permission notice shall be
|
|
522
|
+
* included in all copies or substantial portions of the Software.
|
|
523
|
+
*
|
|
524
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
525
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
526
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
527
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
528
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
529
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
530
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
531
|
+
* ====================================================================
|
|
532
|
+
*//**
|
|
533
|
+
* @license
|
|
534
|
+
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
535
|
+
*
|
|
536
|
+
* https://github.com/deanm/omggif
|
|
537
|
+
*
|
|
538
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
539
|
+
* of this software and associated documentation files (the "Software"), to
|
|
540
|
+
* deal in the Software without restriction, including without limitation the
|
|
541
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
542
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
543
|
+
* furnished to do so, subject to the following conditions:
|
|
544
|
+
*
|
|
545
|
+
* The above copyright notice and this permission notice shall be included in
|
|
546
|
+
* all copies or substantial portions of the Software.
|
|
547
|
+
*
|
|
548
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
549
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
550
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
551
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
552
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
553
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
554
|
+
* IN THE SOFTWARE.
|
|
555
|
+
*
|
|
556
|
+
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
|
|
557
|
+
* including animation and compression. It does not rely on any specific
|
|
558
|
+
* underlying system, so should run in the browser, Node, or Plask.
|
|
559
|
+
*/function lL(e){var r=0;if(e[r++]!==71||e[r++]!==73||e[r++]!==70||e[r++]!==56||(e[r++]+1&253)!=56||e[r++]!==97)throw new Error("Invalid GIF 87a/89a header.");var t=e[r++]|e[r++]<<8,n=e[r++]|e[r++]<<8,a=e[r++],i=a>>7,o=1<<(7&a)+1;e[r++],e[r++];var s=null,u=null;i&&(s=r,u=o,r+=3*o);var c=!0,h=[],v=0,g=null,f=0,E=null;for(this.width=t,this.height=n;c&&r<e.length;)switch(e[r++]){case 33:switch(e[r++]){case 255:if(e[r]!==11||e[r+1]==78&&e[r+2]==69&&e[r+3]==84&&e[r+4]==83&&e[r+5]==67&&e[r+6]==65&&e[r+7]==80&&e[r+8]==69&&e[r+9]==50&&e[r+10]==46&&e[r+11]==48&&e[r+12]==3&&e[r+13]==1&&e[r+16]==0)r+=14,E=e[r++]|e[r++]<<8,r++;else for(r+=12;;){if(!((A=e[r++])>=0))throw Error("Invalid block size");if(A===0)break;r+=A}break;case 249:if(e[r++]!==4||e[r+4]!==0)throw new Error("Invalid graphics extension block.");var S=e[r++];v=e[r++]|e[r++]<<8,g=e[r++],(1&S)==0&&(g=null),f=S>>2&7,r++;break;case 254:for(;;){if(!((A=e[r++])>=0))throw Error("Invalid block size");if(A===0)break;r+=A}break;default:throw new Error("Unknown graphic control label: 0x"+e[r-1].toString(16))}break;case 44:var w=e[r++]|e[r++]<<8,_=e[r++]|e[r++]<<8,y=e[r++]|e[r++]<<8,p=e[r++]|e[r++]<<8,m=e[r++],P=m>>6&1,T=1<<(7&m)+1,k=s,L=u,I=!1;m>>7&&(I=!0,k=r,L=T,r+=3*T);var R=r;for(r++;;){var A;if(!((A=e[r++])>=0))throw Error("Invalid block size");if(A===0)break;r+=A}h.push({x:w,y:_,width:y,height:p,has_local_palette:I,palette_offset:k,palette_size:L,data_offset:R,data_length:r-R,transparent_index:g,interlaced:!!P,delay:v,disposal:f});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[r-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return E},this.frameInfo=function(O){if(O<0||O>=h.length)throw new Error("Frame index out of range.");return h[O]},this.decodeAndBlitFrameBGRA=function(O,M){var q=this.frameInfo(O),D=q.width*q.height,te=new Uint8Array(D);dw(e,q.data_offset,te,D);var H=q.palette_offset,B=q.transparent_index;B===null&&(B=256);var $=q.width,V=t-$,j=$,z=4*(q.y*t+q.x),F=4*((q.y+q.height)*t+q.x),Y=z,J=4*V;q.interlaced===!0&&(J+=4*t*7);for(var X=8,Q=0,ae=te.length;Q<ae;++Q){var se=te[Q];if(j===0&&(j=$,(Y+=J)>=F&&(J=4*V+4*t*(X-1),Y=z+($+V)*(X<<1),X>>=1)),se===B)Y+=4;else{var fe=e[H+3*se],be=e[H+3*se+1],_e=e[H+3*se+2];M[Y++]=_e,M[Y++]=be,M[Y++]=fe,M[Y++]=255}--j}},this.decodeAndBlitFrameRGBA=function(O,M){var q=this.frameInfo(O),D=q.width*q.height,te=new Uint8Array(D);dw(e,q.data_offset,te,D);var H=q.palette_offset,B=q.transparent_index;B===null&&(B=256);var $=q.width,V=t-$,j=$,z=4*(q.y*t+q.x),F=4*((q.y+q.height)*t+q.x),Y=z,J=4*V;q.interlaced===!0&&(J+=4*t*7);for(var X=8,Q=0,ae=te.length;Q<ae;++Q){var se=te[Q];if(j===0&&(j=$,(Y+=J)>=F&&(J=4*V+4*t*(X-1),Y=z+($+V)*(X<<1),X>>=1)),se===B)Y+=4;else{var fe=e[H+3*se],be=e[H+3*se+1],_e=e[H+3*se+2];M[Y++]=fe,M[Y++]=be,M[Y++]=_e,M[Y++]=255}--j}}}function dw(e,r,t,n){for(var a=e[r++],i=1<<a,o=i+1,s=o+1,u=a+1,c=(1<<u)-1,h=0,v=0,g=0,f=e[r++],E=new Int32Array(4096),S=null;;){for(;h<16&&f!==0;)v|=e[r++]<<h,h+=8,f===1?f=e[r++]:--f;if(h<u)break;var w=v&c;if(v>>=u,h-=u,w!==i){if(w===o)break;for(var _=w<s?w:S,y=0,p=_;p>i;)p=E[p]>>8,++y;var m=p;if(g+y+(_!==w?1:0)>n)return void Yn.log("Warning, gif stream longer than expected.");t[g++]=m;var P=g+=y;for(_!==w&&(t[g++]=m),p=_;y--;)p=E[p],t[--P]=255&p,p>>=8;S!==null&&s<4096&&(E[s++]=S<<8|m,s>=c+1&&u<12&&(++u,c=c<<1|1)),S=w}else s=o+1,c=(1<<(u=a+1))-1,S=null}return g!==n&&Yn.log("Warning, gif stream shorter than expected."),t}/**
|
|
560
|
+
* @license
|
|
561
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
|
562
|
+
All rights reserved.
|
|
563
|
+
|
|
564
|
+
Redistribution and use in source and binary forms, with or without
|
|
565
|
+
modification, are permitted provided that the following conditions are
|
|
566
|
+
met:
|
|
567
|
+
|
|
568
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
569
|
+
this list of conditions and the following disclaimer.
|
|
570
|
+
|
|
571
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
572
|
+
notice, this list of conditions and the following disclaimer in the
|
|
573
|
+
documentation and/or other materials provided with the distribution.
|
|
574
|
+
|
|
575
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
576
|
+
contributors may be used to endorse or promote products derived from
|
|
577
|
+
this software without specific prior written permission.
|
|
578
|
+
|
|
579
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
580
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
581
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
582
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
583
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
584
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
585
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
586
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
587
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
588
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
589
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
590
|
+
*/function h2(e){var r,t,n,a,i,o=Math.floor,s=new Array(64),u=new Array(64),c=new Array(64),h=new Array(64),v=new Array(65535),g=new Array(65535),f=new Array(64),E=new Array(64),S=[],w=0,_=7,y=new Array(64),p=new Array(64),m=new Array(64),P=new Array(256),T=new Array(2048),k=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],I=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],A=[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],O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],D=[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 te(z,F){for(var Y=0,J=0,X=new Array,Q=1;Q<=16;Q++){for(var ae=1;ae<=z[Q];ae++)X[F[J]]=[],X[F[J]][0]=Y,X[F[J]][1]=Q,J++,Y++;Y*=2}return X}function H(z){for(var F=z[0],Y=z[1]-1;Y>=0;)F&1<<Y&&(w|=1<<_),Y--,--_<0&&(w==255?(B(255),B(0)):B(w),_=7,w=0)}function B(z){S.push(z)}function $(z){B(z>>8&255),B(255&z)}function V(z,F,Y,J,X){for(var Q,ae=X[0],se=X[240],fe=function(he,ke){var Te,ve,Se,je,Ue,ct,mt,yt,Je,lt,ze=0;for(Je=0;Je<8;++Je){Te=he[ze],ve=he[ze+1],Se=he[ze+2],je=he[ze+3],Ue=he[ze+4],ct=he[ze+5],mt=he[ze+6];var kt=Te+(yt=he[ze+7]),pt=Te-yt,Ut=ve+mt,Ht=ve-mt,Me=Se+ct,Oe=Se-ct,it=je+Ue,Lt=je-Ue,At=kt+it,xt=kt-it,Jt=Ut+Me,nr=Ut-Me;he[ze]=At+Jt,he[ze+4]=At-Jt;var Rt=.707106781*(nr+xt);he[ze+2]=xt+Rt,he[ze+6]=xt-Rt;var Xt=.382683433*((At=Lt+Oe)-(nr=Ht+pt)),Rr=.5411961*At+Xt,Ze=1.306562965*nr+Xt,bt=.707106781*(Jt=Oe+Ht),Vt=pt+bt,wt=pt-bt;he[ze+5]=wt+Rr,he[ze+3]=wt-Rr,he[ze+1]=Vt+Ze,he[ze+7]=Vt-Ze,ze+=8}for(ze=0,Je=0;Je<8;++Je){Te=he[ze],ve=he[ze+8],Se=he[ze+16],je=he[ze+24],Ue=he[ze+32],ct=he[ze+40],mt=he[ze+48];var Kt=Te+(yt=he[ze+56]),Yt=Te-yt,ut=ve+mt,St=ve-mt,Et=Se+ct,et=Se-ct,qt=je+Ue,gt=je-Ue,Ft=Kt+qt,br=Kt-qt,hr=ut+Et,Qr=ut-Et;he[ze]=Ft+hr,he[ze+32]=Ft-hr;var Sn=.707106781*(Qr+br);he[ze+16]=br+Sn,he[ze+48]=br-Sn;var Ni=.382683433*((Ft=gt+et)-(Qr=St+Yt)),Si=.5411961*Ft+Ni,fa=1.306562965*Qr+Ni,_s=.707106781*(hr=et+St),Go=Yt+_s,tu=Yt-_s;he[ze+40]=tu+Si,he[ze+24]=tu-Si,he[ze+8]=Go+fa,he[ze+56]=Go-fa,ze++}for(Je=0;Je<64;++Je)lt=he[Je]*ke[Je],f[Je]=lt>0?lt+.5|0:lt-.5|0;return f}(z,F),be=0;be<64;++be)E[k[be]]=fe[be];var _e=E[0]-Y;Y=E[0],_e==0?H(J[0]):(H(J[g[Q=32767+_e]]),H(v[Q]));for(var Ae=63;Ae>0&&E[Ae]==0;)Ae--;if(Ae==0)return H(ae),Y;for(var Re,Pe=1;Pe<=Ae;){for(var ye=Pe;E[Pe]==0&&Pe<=Ae;)++Pe;var nt=Pe-ye;if(nt>=16){Re=nt>>4;for(var Ce=1;Ce<=Re;++Ce)H(se);nt&=15}Q=32767+E[Pe],H(X[(nt<<4)+g[Q]]),H(v[Q]),Pe++}return Ae!=63&&H(ae),Y}function j(z){z=Math.min(Math.max(z,1),100),i!=z&&(function(F){for(var Y=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],J=0;J<64;J++){var X=o((Y[J]*F+50)/100);X=Math.min(Math.max(X,1),255),s[k[J]]=X}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],ae=0;ae<64;ae++){var se=o((Q[ae]*F+50)/100);se=Math.min(Math.max(se,1),255),u[k[ae]]=se}for(var fe=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],be=0,_e=0;_e<8;_e++)for(var Ae=0;Ae<8;Ae++)c[be]=1/(s[k[be]]*fe[_e]*fe[Ae]*8),h[be]=1/(u[k[be]]*fe[_e]*fe[Ae]*8),be++}(z<50?Math.floor(5e3/z):Math.floor(200-2*z)),i=z)}this.encode=function(z,F){F&&j(F),S=new Array,w=0,_=7,$(65496),$(65504),$(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),$(1),$(1),B(0),B(0),function(){$(65499),$(132),B(0);for(var ve=0;ve<64;ve++)B(s[ve]);B(1);for(var Se=0;Se<64;Se++)B(u[Se])}(),function(ve,Se){$(65472),$(17),B(8),$(Se),$(ve),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(z.width,z.height),function(){$(65476),$(418),B(0);for(var ve=0;ve<16;ve++)B(L[ve+1]);for(var Se=0;Se<=11;Se++)B(I[Se]);B(16);for(var je=0;je<16;je++)B(R[je+1]);for(var Ue=0;Ue<=161;Ue++)B(A[Ue]);B(1);for(var ct=0;ct<16;ct++)B(O[ct+1]);for(var mt=0;mt<=11;mt++)B(M[mt]);B(17);for(var yt=0;yt<16;yt++)B(q[yt+1]);for(var Je=0;Je<=161;Je++)B(D[Je])}(),$(65498),$(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var Y=0,J=0,X=0;w=0,_=7,this.encode.displayName="_encode_";for(var Q,ae,se,fe,be,_e,Ae,Re,Pe,ye=z.data,nt=z.width,Ce=z.height,he=4*nt,ke=0;ke<Ce;){for(Q=0;Q<he;){for(be=he*ke+Q,Ae=-1,Re=0,Pe=0;Pe<64;Pe++)_e=be+(Re=Pe>>3)*he+(Ae=4*(7&Pe)),ke+Re>=Ce&&(_e-=he*(ke+1+Re-Ce)),Q+Ae>=he&&(_e-=Q+Ae-he+4),ae=ye[_e++],se=ye[_e++],fe=ye[_e++],y[Pe]=(T[ae]+T[se+256>>0]+T[fe+512>>0]>>16)-128,p[Pe]=(T[ae+768>>0]+T[se+1024>>0]+T[fe+1280>>0]>>16)-128,m[Pe]=(T[ae+1280>>0]+T[se+1536>>0]+T[fe+1792>>0]>>16)-128;Y=V(y,c,Y,r,n),J=V(p,h,J,t,a),X=V(m,h,X,t,a),Q+=32}ke+=8}if(_>=0){var Te=[];Te[1]=_+1,Te[0]=(1<<_+1)-1,H(Te)}return $(65497),new Uint8Array(S)},e=e||50,function(){for(var z=String.fromCharCode,F=0;F<256;F++)P[F]=z(F)}(),r=te(L,I),t=te(O,M),n=te(R,A),a=te(q,D),function(){for(var z=1,F=2,Y=1;Y<=15;Y++){for(var J=z;J<F;J++)g[32767+J]=Y,v[32767+J]=[],v[32767+J][1]=Y,v[32767+J][0]=J;for(var X=-(F-1);X<=-z;X++)g[32767+X]=Y,v[32767+X]=[],v[32767+X][1]=Y,v[32767+X][0]=F-1+X;z<<=1,F<<=1}}(),function(){for(var z=0;z<256;z++)T[z]=19595*z,T[z+256>>0]=38470*z,T[z+512>>0]=7471*z+32768,T[z+768>>0]=-11059*z,T[z+1024>>0]=-21709*z,T[z+1280>>0]=32768*z+8421375,T[z+1536>>0]=-27439*z,T[z+1792>>0]=-5329*z}(),j(e)}/**
|
|
591
|
+
* @license
|
|
592
|
+
* Copyright (c) 2017 Aras Abbasi
|
|
593
|
+
*
|
|
594
|
+
* Licensed under the MIT License.
|
|
595
|
+
* http://opensource.org/licenses/mit-license
|
|
596
|
+
*/function Hl(e,r){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!r,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function pw(e){function r(L){if(!L)throw Error("assert :P")}function t(L,I,R){for(var A=0;4>A;A++)if(L[I+A]!=R.charCodeAt(A))return!0;return!1}function n(L,I,R,A,O){for(var M=0;M<O;M++)L[I+M]=R[A+M]}function a(L,I,R,A){for(var O=0;O<A;O++)L[I+O]=R}function i(L){return new Int32Array(L)}function o(L,I){for(var R=[],A=0;A<L;A++)R.push(new I);return R}function s(L,I){var R=[];return function A(O,M,q){for(var D=q[M],te=0;te<D&&(O.push(q.length>M+1?[]:new I),!(q.length<M+1));te++)A(O[te],M+1,q)}(R,0,L),R}var u=function(){var L=this;function I(N,W){for(var re=1<<W-1>>>0;N&re;)re>>>=1;return re?(N&re-1)+re:N}function R(N,W,re,oe,ue){r(!(oe%re));do N[W+(oe-=re)]=ue;while(0<oe)}function A(N,W,re,oe,ue){if(r(2328>=ue),512>=ue)var de=i(512);else if((de=i(ue))==null)return 0;return function(ge,me,we,Ee,De,Xe){var We,Ge,_t=me,ot=1<<we,Ie=i(16),qe=i(16);for(r(De!=0),r(Ee!=null),r(ge!=null),r(0<we),Ge=0;Ge<De;++Ge){if(15<Ee[Ge])return 0;++Ie[Ee[Ge]]}if(Ie[0]==De)return 0;for(qe[1]=0,We=1;15>We;++We){if(Ie[We]>1<<We)return 0;qe[We+1]=qe[We]+Ie[We]}for(Ge=0;Ge<De;++Ge)We=Ee[Ge],0<Ee[Ge]&&(Xe[qe[We]++]=Ge);if(qe[15]==1)return(Ee=new O).g=0,Ee.value=Xe[0],R(ge,_t,1,ot,Ee),ot;var He,ft=-1,vt=ot-1,Gt=0,Bt=1,lr=1,jt=1<<we;for(Ge=0,We=1,De=2;We<=we;++We,De<<=1){if(Bt+=lr<<=1,0>(lr-=Ie[We]))return 0;for(;0<Ie[We];--Ie[We])(Ee=new O).g=We,Ee.value=Xe[Ge++],R(ge,_t+Gt,De,jt,Ee),Gt=I(Gt,We)}for(We=we+1,De=2;15>=We;++We,De<<=1){if(Bt+=lr<<=1,0>(lr-=Ie[We]))return 0;for(;0<Ie[We];--Ie[We]){if(Ee=new O,(Gt&vt)!=ft){for(_t+=jt,He=1<<(ft=We)-we;15>ft&&!(0>=(He-=Ie[ft]));)++ft,He<<=1;ot+=jt=1<<(He=ft-we),ge[me+(ft=Gt&vt)].g=He+we,ge[me+ft].value=_t-me-ft}Ee.g=We-we,Ee.value=Xe[Ge++],R(ge,_t+(Gt>>we),De,jt,Ee),Gt=I(Gt,We)}}return Bt!=2*qe[15]-1?0:ot}(N,W,re,oe,ue,de)}function O(){this.value=this.g=0}function M(){this.value=this.g=0}function q(){this.G=o(5,O),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(an,M)}function D(N,W,re,oe){r(N!=null),r(W!=null),r(2147483648>oe),N.Ca=254,N.I=0,N.b=-8,N.Ka=0,N.oa=W,N.pa=re,N.Jd=W,N.Yc=re+oe,N.Zc=4<=oe?re+oe-4+1:re,Q(N)}function te(N,W){for(var re=0;0<W--;)re|=se(N,128)<<W;return re}function H(N,W){var re=te(N,W);return ae(N)?-re:re}function B(N,W,re,oe){var ue,de=0;for(r(N!=null),r(W!=null),r(4294967288>oe),N.Sb=oe,N.Ra=0,N.u=0,N.h=0,4<oe&&(oe=4),ue=0;ue<oe;++ue)de+=W[re+ue]<<8*ue;N.Ra=de,N.bb=oe,N.oa=W,N.pa=re}function $(N){for(;8<=N.u&&N.bb<N.Sb;)N.Ra>>>=8,N.Ra+=N.oa[N.pa+N.bb]<<Oa-8>>>0,++N.bb,N.u-=8;Y(N)&&(N.h=1,N.u=0)}function V(N,W){if(r(0<=W),!N.h&&W<=wl){var re=F(N)&el[W];return N.u+=W,$(N),re}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 F(N){return N.Ra>>>(N.u&Oa-1)>>>0}function Y(N){return r(N.bb<=N.Sb),N.h||N.bb==N.Sb&&N.u>Oa}function J(N,W){N.u=W,N.h=Y(N)}function X(N){N.u>=Va&&(r(N.u>=Va),$(N))}function Q(N){r(N!=null&&N.oa!=null),N.pa<N.Zc?(N.I=(N.oa[N.pa++]|N.I<<8)>>>0,N.b+=8):(r(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 ae(N){return te(N,1)}function se(N,W){var re=N.Ca;0>N.b&&Q(N);var oe=N.b,ue=re*W>>>8,de=(N.I>>>oe>ue)+0;for(de?(re-=ue,N.I-=ue+1<<oe>>>0):re=ue+1,oe=re,ue=0;256<=oe;)ue+=8,oe>>=8;return oe=7^ue+xi[oe],N.b-=oe,N.Ca=(re<<oe)-1,de}function fe(N,W,re){N[W+0]=re>>24&255,N[W+1]=re>>16&255,N[W+2]=re>>8&255,N[W+3]=re>>0&255}function be(N,W){return N[W+0]<<0|N[W+1]<<8}function _e(N,W){return be(N,W)|N[W+2]<<16}function Ae(N,W){return be(N,W)|be(N,W+2)<<16}function Re(N,W){var re=1<<W;return r(N!=null),r(0<W),N.X=i(re),N.X==null?0:(N.Mb=32-W,N.Xa=W,1)}function Pe(N,W){r(N!=null),r(W!=null),r(N.Xa==W.Xa),n(W.X,0,N.X,0,1<<W.Xa)}function ye(){this.X=[],this.Xa=this.Mb=0}function nt(N,W,re,oe){r(re!=null),r(oe!=null);var ue=re[0],de=oe[0];return ue==0&&(ue=(N*de+W/2)/W),de==0&&(de=(W*ue+N/2)/N),0>=ue||0>=de?0:(re[0]=ue,oe[0]=de,1)}function Ce(N,W){return N+(1<<W)-1>>>W}function he(N,W){return((4278255360&N)+(4278255360&W)>>>0&4278255360)+((16711935&N)+(16711935&W)>>>0&16711935)>>>0}function ke(N,W){L[W]=function(re,oe,ue,de,ge,me,we){var Ee;for(Ee=0;Ee<ge;++Ee){var De=L[N](me[we+Ee-1],ue,de+Ee);me[we+Ee]=he(re[oe+Ee],De)}}}function Te(){this.ud=this.hd=this.jd=0}function ve(N,W){return((4278124286&(N^W))>>>1)+(N&W)>>>0}function Se(N){return 0<=N&&256>N?N:0>N?0:255<N?255:void 0}function je(N,W){return Se(N+(N-W+.5>>1))}function Ue(N,W,re){return Math.abs(W-re)-Math.abs(N-re)}function ct(N,W,re,oe,ue,de,ge){for(oe=de[ge-1],re=0;re<ue;++re)de[ge+re]=oe=he(N[W+re],oe)}function mt(N,W,re,oe,ue){var de;for(de=0;de<re;++de){var ge=N[W+de],me=ge>>8&255,we=16711935&(we=(we=16711935&ge)+((me<<16)+me));oe[ue+de]=(4278255360&ge)+we>>>0}}function yt(N,W){W.jd=N>>0&255,W.hd=N>>8&255,W.ud=N>>16&255}function Je(N,W,re,oe,ue,de){var ge;for(ge=0;ge<oe;++ge){var me=W[re+ge],we=me>>>8,Ee=me,De=255&(De=(De=me>>>16)+((N.jd<<24>>24)*(we<<24>>24)>>>5));Ee=255&(Ee=(Ee=Ee+((N.hd<<24>>24)*(we<<24>>24)>>>5))+((N.ud<<24>>24)*(De<<24>>24)>>>5)),ue[de+ge]=(4278255360&me)+(De<<16)+Ee}}function lt(N,W,re,oe,ue){L[W]=function(de,ge,me,we,Ee,De,Xe,We,Ge){for(we=Xe;we<We;++we)for(Xe=0;Xe<Ge;++Xe)Ee[De++]=ue(me[oe(de[ge++])])},L[N]=function(de,ge,me,we,Ee,De,Xe){var We=8>>de.b,Ge=de.Ea,_t=de.K[0],ot=de.w;if(8>We)for(de=(1<<de.b)-1,ot=(1<<We)-1;ge<me;++ge){var Ie,qe=0;for(Ie=0;Ie<Ge;++Ie)Ie&de||(qe=oe(we[Ee++])),De[Xe++]=ue(_t[qe&ot]),qe>>=We}else L["VP8LMapColor"+re](we,Ee,_t,ot,De,Xe,ge,me,Ge)}}function ze(N,W,re,oe,ue){for(re=W+re;W<re;){var de=N[W++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255}}function kt(N,W,re,oe,ue){for(re=W+re;W<re;){var de=N[W++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255,oe[ue++]=de>>24&255}}function pt(N,W,re,oe,ue){for(re=W+re;W<re;){var de=(ge=N[W++])>>16&240|ge>>12&15,ge=ge>>0&240|ge>>28&15;oe[ue++]=de,oe[ue++]=ge}}function Ut(N,W,re,oe,ue){for(re=W+re;W<re;){var de=(ge=N[W++])>>16&248|ge>>13&7,ge=ge>>5&224|ge>>3&31;oe[ue++]=de,oe[ue++]=ge}}function Ht(N,W,re,oe,ue){for(re=W+re;W<re;){var de=N[W++];oe[ue++]=de>>0&255,oe[ue++]=de>>8&255,oe[ue++]=de>>16&255}}function Me(N,W,re,oe,ue,de){if(de==0)for(re=W+re;W<re;)fe(oe,((de=N[W++])[0]>>24|de[1]>>8&65280|de[2]<<8&16711680|de[3]<<24)>>>0),ue+=32;else n(oe,ue,N,W,re)}function Oe(N,W){L[W][0]=L[N+"0"],L[W][1]=L[N+"1"],L[W][2]=L[N+"2"],L[W][3]=L[N+"3"],L[W][4]=L[N+"4"],L[W][5]=L[N+"5"],L[W][6]=L[N+"6"],L[W][7]=L[N+"7"],L[W][8]=L[N+"8"],L[W][9]=L[N+"9"],L[W][10]=L[N+"10"],L[W][11]=L[N+"11"],L[W][12]=L[N+"12"],L[W][13]=L[N+"13"],L[W][14]=L[N+"0"],L[W][15]=L[N+"0"]}function it(N){return N==Pl||N==ks||N==hu||N==du}function Lt(){this.eb=[],this.size=this.A=this.fb=0}function At(){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 xt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Lt,this.f.kb=new At,this.sd=null}function Jt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function nr(){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 Rt(N){return alert("todo:WebPSamplerProcessPlane"),N.T}function Xt(N,W){var re=N.T,oe=W.ba.f.RGBA,ue=oe.eb,de=oe.fb+N.ka*oe.A,ge=pa[W.ba.S],me=N.y,we=N.O,Ee=N.f,De=N.N,Xe=N.ea,We=N.W,Ge=W.cc,_t=W.dc,ot=W.Mc,Ie=W.Nc,qe=N.ka,He=N.ka+N.T,ft=N.U,vt=ft+1>>1;for(qe==0?ge(me,we,null,null,Ee,De,Xe,We,Ee,De,Xe,We,ue,de,null,null,ft):(ge(W.ec,W.fc,me,we,Ge,_t,ot,Ie,Ee,De,Xe,We,ue,de-oe.A,ue,de,ft),++re);qe+2<He;qe+=2)Ge=Ee,_t=De,ot=Xe,Ie=We,De+=N.Rc,We+=N.Rc,de+=2*oe.A,ge(me,(we+=2*N.fa)-N.fa,me,we,Ge,_t,ot,Ie,Ee,De,Xe,We,ue,de-oe.A,ue,de,ft);return we+=N.fa,N.j+He<N.o?(n(W.ec,W.fc,me,we,ft),n(W.cc,W.dc,Ee,De,vt),n(W.Mc,W.Nc,Xe,We,vt),re--):1&He||ge(me,we,null,null,Ee,De,Xe,We,Ee,De,Xe,We,ue,de+oe.A,null,null,ft),re}function Rr(N,W,re){var oe=N.F,ue=[N.J];if(oe!=null){var de=N.U,ge=W.ba.S,me=ge==fu||ge==hu;W=W.ba.f.RGBA;var we=[0],Ee=N.ka;we[0]=N.T,N.Kb&&(Ee==0?--we[0]:(--Ee,ue[0]-=N.width),N.j+N.ka+N.T==N.o&&(we[0]=N.o-N.j-Ee));var De=W.eb;Ee=W.fb+Ee*W.A,N=Kr(oe,ue[0],N.width,de,we,De,Ee+(me?0:3),W.A),r(re==we),N&&it(ge)&&Ei(De,Ee,me,de,we,W.A)}return 0}function Ze(N){var W=N.ma,re=W.ba.S,oe=11>re,ue=re==Fo||re==El||re==fu||re==hn||re==12||it(re);if(W.memory=null,W.Ib=null,W.Jb=null,W.Nd=null,!Js(W.Oa,N,ue?11:12))return 0;if(ue&&it(re)&&Pt(),N.da)alert("todo:use_scaling");else{if(oe){if(W.Ib=Rt,N.Kb){if(re=N.U+1>>1,W.memory=i(N.U+2*re),W.memory==null)return 0;W.ec=W.memory,W.fc=0,W.cc=W.ec,W.dc=W.fc+N.U,W.Mc=W.cc,W.Nc=W.dc+re,W.Ib=Xt,Pt()}}else alert("todo:EmitYUV");ue&&(W.Jb=Rr,oe&&Ke())}if(oe&&!Pi){for(N=0;256>N;++N)ia[N]=89858*(N-128)+go>>rs,aa[N]=-22014*(N-128)+go,Al[N]=-45773*(N-128),al[N]=113618*(N-128)+go>>rs;for(N=en;N<sn;++N)W=76283*(N-16)+go>>rs,mu[N-en]=Ea(W,255),cf[N-en]=Ea(W+8>>4,15);Pi=1}return 1}function bt(N){var W=N.ma,re=N.U,oe=N.T;return r(!(1&N.ka)),0>=re||0>=oe?0:(re=W.Ib(N,W),W.Jb!=null&&W.Jb(N,W,re),W.Dc+=re,1)}function Vt(N){N.ma.memory=null}function wt(N,W,re,oe){return V(N,8)!=47?0:(W[0]=V(N,14)+1,re[0]=V(N,14)+1,oe[0]=V(N,1),V(N,3)!=0?0:!N.h)}function Kt(N,W){if(4>N)return N+1;var re=N-2>>1;return(2+(1&N)<<re)+V(W,re)+1}function Yt(N,W){return 120<W?W-120:1<=(re=((re=qf[W-1])>>4)*N+(8-(15&re)))?re:1;var re}function ut(N,W,re){var oe=F(re),ue=N[W+=255&oe].g-8;return 0<ue&&(J(re,re.u+8),oe=F(re),W+=N[W].value,W+=oe&(1<<ue)-1),J(re,re.u+N[W].g),N[W].value}function St(N,W,re){return re.g+=N.g,re.value+=N.value<<W>>>0,r(8>=re.g),N.g}function Et(N,W,re){var oe=N.xc;return r((W=oe==0?0:N.vc[N.md*(re>>oe)+(W>>oe)])<N.Wb),N.Ya[W]}function et(N,W,re,oe){var ue=N.ab,de=N.c*W,ge=N.C;W=ge+W;var me=re,we=oe;for(oe=N.Ta,re=N.Ua;0<ue--;){var Ee=N.gc[ue],De=ge,Xe=W,We=me,Ge=we,_t=(we=oe,me=re,Ee.Ea);switch(r(De<Xe),r(Xe<=Ee.nc),Ee.hc){case 2:Hu(We,Ge,(Xe-De)*_t,we,me);break;case 0:var ot=De,Ie=Xe,qe=we,He=me,ft=(jt=Ee).Ea;ot==0&&(tl(We,Ge,null,null,1,qe,He),ct(We,Ge+1,0,0,ft-1,qe,He+1),Ge+=ft,He+=ft,++ot);for(var vt=1<<jt.b,Gt=vt-1,Bt=Ce(ft,jt.b),lr=jt.K,jt=jt.w+(ot>>jt.b)*Bt;ot<Ie;){var Br=lr,Ur=jt,Ir=1;for(co(We,Ge,qe,He-ft,1,qe,He);Ir<ft;){var xr=(Ir&~Gt)+vt;xr>ft&&(xr=ft),(0,bi[Br[Ur++]>>8&15])(We,Ge+ +Ir,qe,He+Ir-ft,xr-Ir,qe,He+Ir),Ir=xr}Ge+=ft,He+=ft,++ot&Gt||(jt+=Bt)}Xe!=Ee.nc&&n(we,me-_t,we,me+(Xe-De-1)*_t,_t);break;case 1:for(_t=We,Ie=Ge,ft=(We=Ee.Ea)-(He=We&~(qe=(Ge=1<<Ee.b)-1)),ot=Ce(We,Ee.b),vt=Ee.K,Ee=Ee.w+(De>>Ee.b)*ot;De<Xe;){for(Gt=vt,Bt=Ee,lr=new Te,jt=Ie+He,Br=Ie+We;Ie<jt;)yt(Gt[Bt++],lr),Jo(lr,_t,Ie,Ge,we,me),Ie+=Ge,me+=Ge;Ie<Br&&(yt(Gt[Bt++],lr),Jo(lr,_t,Ie,ft,we,me),Ie+=ft,me+=ft),++De&qe||(Ee+=ot)}break;case 3:if(We==we&&Ge==me&&0<Ee.b){for(Ie=we,We=_t=me+(Xe-De)*_t-(He=(Xe-De)*Ce(Ee.Ea,Ee.b)),Ge=we,qe=me,ot=[],He=(ft=He)-1;0<=He;--He)ot[He]=Ge[qe+He];for(He=ft-1;0<=He;--He)Ie[We+He]=ot[He];yi(Ee,De,Xe,we,_t,we,me)}else yi(Ee,De,Xe,We,Ge,we,me)}me=oe,we=re}we!=re&&n(oe,re,me,we,de)}function qt(N,W){var re=N.V,oe=N.Ba+N.c*N.C,ue=W-N.C;if(r(W<=N.l.o),r(16>=ue),0<ue){var de=N.l,ge=N.Ta,me=N.Ua,we=de.width;if(et(N,ue,re,oe),ue=me=[me],r((re=N.C)<(oe=W)),r(de.v<de.va),oe>de.o&&(oe=de.o),re<de.j){var Ee=de.j-re;re=de.j,ue[0]+=Ee*we}if(re>=oe?re=0:(ue[0]+=4*de.v,de.ka=re-de.j,de.U=de.va-de.v,de.T=oe-re,re=1),re){if(me=me[0],11>(re=N.ca).S){var De=re.f.RGBA,Xe=(oe=re.S,ue=de.U,de=de.T,Ee=De.eb,De.A),We=de;for(De=De.fb+N.Ma*De.A;0<We--;){var Ge=ge,_t=me,ot=ue,Ie=Ee,qe=De;switch(oe){case xl:ci(Ge,_t,ot,Ie,qe);break;case Fo:qi(Ge,_t,ot,Ie,qe);break;case Pl:qi(Ge,_t,ot,Ie,qe),Ei(Ie,qe,0,ot,1,0);break;case sf:fo(Ge,_t,ot,Ie,qe);break;case El:Me(Ge,_t,ot,Ie,qe,1);break;case ks:Me(Ge,_t,ot,Ie,qe,1),Ei(Ie,qe,0,ot,1,0);break;case fu:Me(Ge,_t,ot,Ie,qe,0);break;case hu:Me(Ge,_t,ot,Ie,qe,0),Ei(Ie,qe,1,ot,1,0);break;case hn:es(Ge,_t,ot,Ie,qe);break;case du:es(Ge,_t,ot,Ie,qe),on(Ie,qe,ot,1,0);break;case Vu:Xr(Ge,_t,ot,Ie,qe);break;default:r(0)}me+=we,De+=Xe}N.Ma+=de}else alert("todo:EmitRescaledRowsYUVA");r(N.Ma<=re.height)}}N.C=W,r(N.C<=N.i)}function gt(N){var W;if(0<N.ua)return 0;for(W=0;W<N.Wb;++W){var re=N.Ya[W].G,oe=N.Ya[W].H;if(0<re[1][oe[1]+0].g||0<re[2][oe[2]+0].g||0<re[3][oe[3]+0].g)return 0}return 1}function Ft(N,W,re,oe,ue,de){if(N.Z!=0){var ge=N.qd,me=N.rd;for(r(Vi[N.Z]!=null);W<re;++W)Vi[N.Z](ge,me,oe,ue,oe,ue,de),ge=oe,me=ue,ue+=de;N.qd=ge,N.rd=me}}function br(N,W){var re=N.l.ma,oe=re.Z==0||re.Z==1?N.l.j:N.C;if(oe=N.C<oe?oe:N.C,r(W<=N.l.o),W>oe){var ue=N.l.width,de=re.ca,ge=re.tb+ue*oe,me=N.V,we=N.Ba+N.c*oe,Ee=N.gc;r(N.ab==1),r(Ee[0].hc==3),Cs(Ee[0],oe,W,me,we,de,ge),Ft(re,oe,W,de,ge,ue)}N.C=N.Ma=W}function hr(N,W,re,oe,ue,de,ge){var me=N.$/oe,we=N.$%oe,Ee=N.m,De=N.s,Xe=re+N.$,We=Xe;ue=re+oe*ue;var Ge=re+oe*de,_t=280+De.ua,ot=N.Pb?me:16777216,Ie=0<De.ua?De.Wa:null,qe=De.wc,He=Xe<Ge?Et(De,we,me):null;r(N.C<de),r(Ge<=ue);var ft=!1;e:for(;;){for(;ft||Xe<Ge;){var vt=0;if(me>=ot){var Gt=Xe-re;r((ot=N).Pb),ot.wd=ot.m,ot.xd=Gt,0<ot.s.ua&&Pe(ot.s.Wa,ot.s.vb),ot=me+Gu}if(we&qe||(He=Et(De,we,me)),r(He!=null),He.Qb&&(W[Xe]=He.qb,ft=!0),!ft)if(X(Ee),He.jc){vt=Ee,Gt=W;var Bt=Xe,lr=He.pd[F(vt)&an-1];r(He.jc),256>lr.g?(J(vt,vt.u+lr.g),Gt[Bt]=lr.value,vt=0):(J(vt,vt.u+lr.g-256),r(256<=lr.value),vt=lr.value),vt==0&&(ft=!0)}else vt=ut(He.G[0],He.H[0],Ee);if(Ee.h)break;if(ft||256>vt){if(!ft)if(He.nd)W[Xe]=(He.qb|vt<<8)>>>0;else{if(X(Ee),ft=ut(He.G[1],He.H[1],Ee),X(Ee),Gt=ut(He.G[2],He.H[2],Ee),Bt=ut(He.G[3],He.H[3],Ee),Ee.h)break;W[Xe]=(Bt<<24|ft<<16|vt<<8|Gt)>>>0}if(ft=!1,++Xe,++we>=oe&&(we=0,++me,ge!=null&&me<=de&&!(me%16)&&ge(N,me),Ie!=null))for(;We<Xe;)vt=W[We++],Ie.X[(506832829*vt&4294967295)>>>Ie.Mb]=vt}else if(280>vt){if(vt=Kt(vt-256,Ee),Gt=ut(He.G[4],He.H[4],Ee),X(Ee),Gt=Yt(oe,Gt=Kt(Gt,Ee)),Ee.h)break;if(Xe-re<Gt||ue-Xe<vt)break e;for(Bt=0;Bt<vt;++Bt)W[Xe+Bt]=W[Xe+Bt-Gt];for(Xe+=vt,we+=vt;we>=oe;)we-=oe,++me,ge!=null&&me<=de&&!(me%16)&&ge(N,me);if(r(Xe<=ue),we&qe&&(He=Et(De,we,me)),Ie!=null)for(;We<Xe;)vt=W[We++],Ie.X[(506832829*vt&4294967295)>>>Ie.Mb]=vt}else{if(!(vt<_t))break e;for(ft=vt-280,r(Ie!=null);We<Xe;)vt=W[We++],Ie.X[(506832829*vt&4294967295)>>>Ie.Mb]=vt;vt=Xe,r(!(ft>>>(Gt=Ie).Xa)),W[vt]=Gt.X[ft],ft=!0}ft||r(Ee.h==Y(Ee))}if(N.Pb&&Ee.h&&Xe<ue)r(N.m.h),N.a=5,N.m=N.wd,N.$=N.xd,0<N.s.ua&&Pe(N.s.vb,N.s.Wa);else{if(Ee.h)break e;ge?.(N,me>de?de:me),N.a=0,N.$=Xe-re}return 1}return N.a=3,0}function Qr(N){r(N!=null),N.vc=null,N.yc=null,N.Ya=null;var W=N.Wa;W!=null&&(W.X=null),N.vb=null,r(N!=null)}function Sn(){var N=new za;return N==null?null:(N.a=0,N.xb=gu,Oe("Predictor","VP8LPredictors"),Oe("Predictor","VP8LPredictors_C"),Oe("PredictorAdd","VP8LPredictorsAdd"),Oe("PredictorAdd","VP8LPredictorsAdd_C"),Hu=mt,Jo=Je,ci=ze,qi=kt,es=pt,Xr=Ut,fo=Ht,L.VP8LMapColor32b=Bi,L.VP8LMapColor8b=Co,N)}function Ni(N,W,re,oe,ue){var de=1,ge=[N],me=[W],we=oe.m,Ee=oe.s,De=null,Xe=0;e:for(;;){if(re)for(;de&&V(we,1);){var We=ge,Ge=me,_t=oe,ot=1,Ie=_t.m,qe=_t.gc[_t.ab],He=V(Ie,2);if(_t.Oc&1<<He)de=0;else{switch(_t.Oc|=1<<He,qe.hc=He,qe.Ea=We[0],qe.nc=Ge[0],qe.K=[null],++_t.ab,r(4>=_t.ab),He){case 0:case 1:qe.b=V(Ie,3)+2,ot=Ni(Ce(qe.Ea,qe.b),Ce(qe.nc,qe.b),0,_t,qe.K),qe.K=qe.K[0];break;case 3:var ft,vt=V(Ie,8)+1,Gt=16<vt?0:4<vt?1:2<vt?2:3;if(We[0]=Ce(qe.Ea,Gt),qe.b=Gt,ft=ot=Ni(vt,1,0,_t,qe.K)){var Bt,lr=vt,jt=qe,Br=1<<(8>>jt.b),Ur=i(Br);if(Ur==null)ft=0;else{var Ir=jt.K[0],xr=jt.w;for(Ur[0]=jt.K[0][0],Bt=1;Bt<1*lr;++Bt)Ur[Bt]=he(Ir[xr+Bt],Ur[Bt-1]);for(;Bt<4*Br;++Bt)Ur[Bt]=0;jt.K[0]=null,jt.K[0]=Ur,ft=1}}ot=ft;break;case 2:break;default:r(0)}de=ot}}if(ge=ge[0],me=me[0],de&&V(we,1)&&!(de=1<=(Xe=V(we,4))&&11>=Xe)){oe.a=3;break e}var Zr;if(Zr=de)t:{var tn,tr,Hr,Rn=oe,zn=ge,hi=me,Ar=Xe,Gi=re,An=Rn.m,Un=Rn.s,di=[null],Oi=1,ga=0,Ya=lf[Ar];r:for(;;){if(Gi&&V(An,1)){var wn=V(An,3)+2,Hn=Ce(zn,wn),oa=Ce(hi,wn),Do=Hn*oa;if(!Ni(Hn,oa,0,Rn,di))break r;for(di=di[0],Un.xc=wn,tn=0;tn<Do;++tn){var vo=di[tn]>>8&65535;di[tn]=vo,vo>=Oi&&(Oi=vo+1)}}if(An.h)break r;for(tr=0;5>tr;++tr){var qr=il[tr];!tr&&0<Ar&&(qr+=1<<Ar),ga<qr&&(ga=qr)}var mo=o(Oi*Ya,O),yu=Oi,Xu=o(yu,q);if(Xu==null)var Xa=null;else r(65536>=yu),Xa=Xu;var Aa=i(ga);if(Xa==null||Aa==null||mo==null){Rn.a=1;break r}var kl=mo;for(tn=Hr=0;tn<Oi;++tn){var va=Xa[tn],Bo=va.G,yn=va.H,_r=0,rn=1,Cn=0;for(tr=0;5>tr;++tr){qr=il[tr],Bo[tr]=kl,yn[tr]=Hr,!tr&&0<Ar&&(qr+=1<<Ar);i:{var Mn,ri=qr,qo=Rn,dn=Aa,bu=kl,Ts=Hr,pn=0,Ka=qo.m,Ll=V(Ka,1);if(a(dn,0,0,ri),Ll){var sa=V(Ka,1)+1,wu=V(Ka,1),_u=V(Ka,wu==0?1:8);dn[_u]=1,sa==2&&(dn[_u=V(Ka,8)]=1);var Ai=1}else{var ln=i(19),Vn=V(Ka,4)+4;if(19<Vn){qo.a=3;var Gn=0;break i}for(Mn=0;Mn<Vn;++Mn)ln[qh[Mn]]=V(Ka,3);var Za=void 0,yo=void 0,Qa=qo,xc=ln,Wn=ri,Su=dn,ol=0,Ja=Qa.m,_n=8,pi=o(128,O);n:for(;A(pi,0,7,xc,19);){if(V(Ja,1)){var la=2+2*V(Ja,3);if((Za=2+V(Ja,la))>Wn)break n}else Za=Wn;for(yo=0;yo<Wn&&Za--;){X(Ja);var Wi=pi[0+(127&F(Ja))];J(Ja,Ja.u+Wi.g);var Rs=Wi.value;if(16>Rs)Su[yo++]=Rs,Rs!=0&&(_n=Rs);else{var Ec=Rs==16,Ku=Rs-16,Wf=bc[Ku],os=V(Ja,pu[Ku])+Wf;if(yo+os>Wn)break n;for(var ff=Ec?_n:0;0<os--;)Su[yo++]=ff}}ol=1;break n}ol||(Qa.a=3),Ai=ol}(Ai=Ai&&!Ka.h)&&(pn=A(bu,Ts,8,dn,ri)),Ai&&pn!=0?Gn=pn:(qo.a=3,Gn=0)}if(Gn==0)break r;if(rn&&Bf[tr]==1&&(rn=kl[Hr].g==0),_r+=kl[Hr].g,Hr+=Gn,3>=tr){var Nl,xu=Aa[0];for(Nl=1;Nl<qr;++Nl)Aa[Nl]>xu&&(xu=Aa[Nl]);Cn+=xu}}if(va.nd=rn,va.Qb=0,rn&&(va.qb=(Bo[3][yn[3]+0].value<<24|Bo[1][yn[1]+0].value<<16|Bo[2][yn[2]+0].value)>>>0,_r==0&&256>Bo[0][yn[0]+0].value&&(va.Qb=1,va.qb+=Bo[0][yn[0]+0].value<<8)),va.jc=!va.Qb&&6>Cn,va.jc){var zo,Ca=va;for(zo=0;zo<an;++zo){var ss=zo,eo=Ca.pd[ss],ls=Ca.G[0][Ca.H[0]+ss];256<=ls.value?(eo.g=ls.g+256,eo.value=ls.value):(eo.g=0,eo.value=0,ss>>=St(ls,8,eo),ss>>=St(Ca.G[1][Ca.H[1]+ss],16,eo),ss>>=St(Ca.G[2][Ca.H[2]+ss],0,eo),St(Ca.G[3][Ca.H[3]+ss],24,eo))}}}Un.vc=di,Un.Wb=Oi,Un.Ya=Xa,Un.yc=mo,Zr=1;break t}Zr=0}if(!(de=Zr)){oe.a=3;break e}if(0<Xe){if(Ee.ua=1<<Xe,!Re(Ee.Wa,Xe)){oe.a=1,de=0;break e}}else Ee.ua=0;var Pc=oe,Oc=ge,hf=me,Zu=Pc.s,us=Zu.xc;if(Pc.c=Oc,Pc.i=hf,Zu.md=Ce(Oc,us),Zu.wc=us==0?-1:(1<<us)-1,re){oe.xb=po;break e}if((De=i(ge*me))==null){oe.a=1,de=0;break e}de=(de=hr(oe,De,0,ge,me,me,null))&&!we.h;break e}return de?(ue!=null?ue[0]=De:(r(De==null),r(re)),oe.$=0,re||Qr(Ee)):Qr(Ee),de}function Si(N,W){var re=N.c*N.i,oe=re+W+16*W;return r(N.c<=W),N.V=i(oe),N.V==null?(N.Ta=null,N.Ua=0,N.a=1,0):(N.Ta=N.V,N.Ua=N.Ba+re+W,1)}function fa(N,W){var re=N.C,oe=W-re,ue=N.V,de=N.Ba+N.c*re;for(r(W<=N.l.o);0<oe;){var ge=16<oe?16:oe,me=N.l.ma,we=N.l.width,Ee=we*ge,De=me.ca,Xe=me.tb+we*re,We=N.Ta,Ge=N.Ua;et(N,ge,ue,de),qn(We,Ge,De,Xe,Ee),Ft(me,re,re+ge,De,Xe,we),oe-=ge,ue+=ge*N.c,re+=ge}r(re==W),N.C=N.Ma=W}function _s(){this.ub=this.yd=this.td=this.Rb=0}function Go(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function tu(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function mc(){this.Yb=function(){var N=[];return function W(re,oe,ue){for(var de=ue[oe],ge=0;ge<de&&(re.push(ue.length>oe+1?[]:0),!(ue.length<oe+1));ge++)W(re[ge],oe+1,ue)}(N,0,[3,11]),N}()}function Fn(){this.jb=i(3),this.Wc=s([4,8],mc),this.Xc=s([4,17],mc)}function Bu(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function oo(){this.ld=this.La=this.dd=this.tc=0}function dl(){this.Na=this.la=0}function Vs(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function qu(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function ru(){this.uc=this.M=this.Nb=0,this.wa=Array(new oo),this.Y=0,this.ya=Array(new qu),this.aa=0,this.l=new Jr}function so(){this.y=i(16),this.f=i(8),this.ea=i(8)}function gi(){this.cb=this.a=0,this.sc="",this.m=new j,this.Od=new _s,this.Kc=new Go,this.ed=new Bu,this.Qa=new tu,this.Ic=this.$c=this.Aa=0,this.D=new ru,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,j),this.ia=0,this.pb=o(4,Vs),this.Pa=new Fn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new so),this.Hd=0,this.rb=Array(new dl),this.sb=0,this.wa=Array(new oo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new qu),this.L=this.aa=0,this.gd=s([4,2],oo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Jr(){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 Nr(){var N=new gi;return N!=null&&(N.a=0,N.sc="OK",N.cb=0,N.Xb=0,Ol||(Ol=Ia)),N}function cn(N,W,re){return N.a==0&&(N.a=W,N.sc=re,N.cb=0),0}function vi(N,W,re){return 3<=re&&N[W+0]==157&&N[W+1]==1&&N[W+2]==42}function Ti(N,W){if(N==null)return 0;if(N.a=0,N.sc="OK",W==null)return cn(N,2,"null VP8Io passed to VP8GetHeaders()");var re=W.data,oe=W.w,ue=W.ha;if(4>ue)return cn(N,7,"Truncated header.");var de=re[oe+0]|re[oe+1]<<8|re[oe+2]<<16,ge=N.Od;if(ge.Rb=!(1&de),ge.td=de>>1&7,ge.yd=de>>4&1,ge.ub=de>>5,3<ge.td)return cn(N,3,"Incorrect keyframe parameters.");if(!ge.yd)return cn(N,4,"Frame not displayable.");oe+=3,ue-=3;var me=N.Kc;if(ge.Rb){if(7>ue)return cn(N,7,"cannot parse picture header");if(!vi(re,oe,ue))return cn(N,3,"Bad code word");me.c=16383&(re[oe+4]<<8|re[oe+3]),me.Td=re[oe+4]>>6,me.i=16383&(re[oe+6]<<8|re[oe+5]),me.Ud=re[oe+6]>>6,oe+=7,ue-=7,N.za=me.c+15>>4,N.Ub=me.i+15>>4,W.width=me.c,W.height=me.i,W.Da=0,W.j=0,W.v=0,W.va=W.width,W.o=W.height,W.da=0,W.ib=W.width,W.hb=W.height,W.U=W.width,W.T=W.height,a((de=N.Pa).jb,0,255,de.jb.length),r((de=N.Qa)!=null),de.Cb=0,de.Bb=0,de.Fb=1,a(de.Zb,0,0,de.Zb.length),a(de.Lb,0,0,de.Lb)}if(ge.ub>ue)return cn(N,7,"bad partition length");D(de=N.m,re,oe,ge.ub),oe+=ge.ub,ue-=ge.ub,ge.Rb&&(me.Ld=ae(de),me.Kd=ae(de)),me=N.Qa;var we,Ee=N.Pa;if(r(de!=null),r(me!=null),me.Cb=ae(de),me.Cb){if(me.Bb=ae(de),ae(de)){for(me.Fb=ae(de),we=0;4>we;++we)me.Zb[we]=ae(de)?H(de,7):0;for(we=0;4>we;++we)me.Lb[we]=ae(de)?H(de,6):0}if(me.Bb)for(we=0;3>we;++we)Ee.jb[we]=ae(de)?te(de,8):255}else me.Bb=0;if(de.Ka)return cn(N,3,"cannot parse segment header");if((me=N.ed).zd=ae(de),me.Tb=te(de,6),me.wb=te(de,3),me.Pc=ae(de),me.Pc&&ae(de)){for(Ee=0;4>Ee;++Ee)ae(de)&&(me.vd[Ee]=H(de,6));for(Ee=0;4>Ee;++Ee)ae(de)&&(me.od[Ee]=H(de,6))}if(N.L=me.Tb==0?0:me.zd?1:2,de.Ka)return cn(N,3,"cannot parse filter header");var De=ue;if(ue=we=oe,oe=we+De,me=De,N.Xb=(1<<te(N.m,2))-1,De<3*(Ee=N.Xb))re=7;else{for(we+=3*Ee,me-=3*Ee,De=0;De<Ee;++De){var Xe=re[ue+0]|re[ue+1]<<8|re[ue+2]<<16;Xe>me&&(Xe=me),D(N.Jc[+De],re,we,Xe),we+=Xe,me-=Xe,ue+=3}D(N.Jc[+Ee],re,we,me),re=we<oe?0:5}if(re!=0)return cn(N,re,"cannot parse partitions");for(re=te(we=N.m,7),ue=ae(we)?H(we,4):0,oe=ae(we)?H(we,4):0,me=ae(we)?H(we,4):0,Ee=ae(we)?H(we,4):0,we=ae(we)?H(we,4):0,De=N.Qa,Xe=0;4>Xe;++Xe){if(De.Cb){var We=De.Zb[Xe];De.Fb||(We+=re)}else{if(0<Xe){N.pb[Xe]=N.pb[0];continue}We=re}var Ge=N.pb[Xe];Ge.Sc[0]=Ls[Ea(We+ue,127)],Ge.Sc[1]=Wu[Ea(We+0,127)],Ge.Eb[0]=2*Ls[Ea(We+oe,127)],Ge.Eb[1]=101581*Wu[Ea(We+me,127)]>>16,8>Ge.Eb[1]&&(Ge.Eb[1]=8),Ge.Qc[0]=Ls[Ea(We+Ee,117)],Ge.Qc[1]=Wu[Ea(We+we,127)],Ge.lc=We+we}if(!ge.Rb)return cn(N,4,"Not a key frame.");for(ae(de),ge=N.Pa,re=0;4>re;++re){for(ue=0;8>ue;++ue)for(oe=0;3>oe;++oe)for(me=0;11>me;++me)Ee=se(de,Uf[re][ue][oe][me])?te(de,8):$u[re][ue][oe][me],ge.Wc[re][ue].Yb[oe][me]=Ee;for(ue=0;17>ue;++ue)ge.Xc[re][ue]=ge.Wc[re][_c[ue]]}return N.kc=ae(de),N.kc&&(N.Bd=te(de,8)),N.cb=1}function Ia(N,W,re,oe,ue,de,ge){var me=W[ue].Yb[re];for(re=0;16>ue;++ue){if(!se(N,me[re+0]))return ue;for(;!se(N,me[re+1]);)if(me=W[++ue].Yb[0],re=0,ue==16)return 16;var we=W[ue+1].Yb;if(se(N,me[re+2])){var Ee=N,De=0;if(se(Ee,(We=me)[(Xe=re)+3]))if(se(Ee,We[Xe+6])){for(me=0,Xe=2*(De=se(Ee,We[Xe+8]))+(We=se(Ee,We[Xe+9+De])),De=0,We=uf[Xe];We[me];++me)De+=De+se(Ee,We[me]);De+=3+(8<<Xe)}else se(Ee,We[Xe+7])?(De=7+2*se(Ee,165),De+=se(Ee,145)):De=5+se(Ee,159);else De=se(Ee,We[Xe+4])?3+se(Ee,We[Xe+5]):2;me=we[2]}else De=1,me=we[1];we=ge+$a[ue],0>(Ee=N).b&&Q(Ee);var Xe,We=Ee.b,Ge=(Xe=Ee.Ca>>1)-(Ee.I>>We)>>31;--Ee.b,Ee.Ca+=Ge,Ee.Ca|=1,Ee.I-=(Xe+1&Ge)<<We,de[we]=((De^Ge)-Ge)*oe[(0<ue)+0]}return 16}function ja(N){var W=N.rb[N.sb-1];W.la=0,W.Na=0,a(N.zc,0,0,N.zc.length),N.ja=0}function oi(N,W){if(N==null)return 0;if(W==null)return cn(N,2,"NULL VP8Io parameter in VP8Decode().");if(!N.cb&&!Ti(N,W))return 0;if(r(N.cb),W.ac==null||W.ac(W)){W.ob&&(N.L=0);var re=is[N.L];if(N.L==2?(N.yb=0,N.zb=0):(N.yb=W.v-re>>4,N.zb=W.j-re>>4,0>N.yb&&(N.yb=0),0>N.zb&&(N.zb=0)),N.Va=W.o+15+re>>4,N.Hb=W.va+15+re>>4,N.Hb>N.za&&(N.Hb=N.za),N.Va>N.Ub&&(N.Va=N.Ub),0<N.L){var oe=N.ed;for(re=0;4>re;++re){var ue;if(N.Qa.Cb){var de=N.Qa.Lb[re];N.Qa.Fb||(de+=oe.Tb)}else de=oe.Tb;for(ue=0;1>=ue;++ue){var ge=N.gd[re][ue],me=de;if(oe.Pc&&(me+=oe.vd[0],ue&&(me+=oe.od[0])),0<(me=0>me?0:63<me?63:me)){var we=me;0<oe.wb&&(we=4<oe.wb?we>>2:we>>1)>9-oe.wb&&(we=9-oe.wb),1>we&&(we=1),ge.dd=we,ge.tc=2*me+we,ge.ld=40<=me?2:15<=me?1:0}else ge.tc=0;ge.La=ue}}}re=0}else cn(N,6,"Frame setup failed"),re=N.a;if(re=re==0){if(re){N.$c=0,0<N.Aa||(N.Ic=as);e:{re=N.Ic,oe=4*(we=N.za);var Ee=32*we,De=we+1,Xe=0<N.L?we*(0<N.Aa?2:1):0,We=(N.Aa==2?2:1)*we;if((ge=oe+832+(ue=3*(16*re+is[N.L])/2*Ee)+(de=N.Fa!=null&&0<N.Fa.length?N.Kc.c*N.Kc.i:0))!=ge)re=0;else{if(ge>N.Vb){if(N.Vb=0,N.Ec=i(ge),N.Fc=0,N.Ec==null){re=cn(N,1,"no memory during frame initialization.");break e}N.Vb=ge}ge=N.Ec,me=N.Fc,N.Ac=ge,N.Bc=me,me+=oe,N.Gd=o(Ee,so),N.Hd=0,N.rb=o(De+1,dl),N.sb=1,N.wa=Xe?o(Xe,oo):null,N.Y=0,N.D.Nb=0,N.D.wa=N.wa,N.D.Y=N.Y,0<N.Aa&&(N.D.Y+=we),r(!0),N.oc=ge,N.pc=me,me+=832,N.ya=o(We,qu),N.aa=0,N.D.ya=N.ya,N.D.aa=N.aa,N.Aa==2&&(N.D.aa+=we),N.R=16*we,N.B=8*we,we=(Ee=is[N.L])*N.R,Ee=Ee/2*N.B,N.sa=ge,N.ta=me+we,N.qa=N.sa,N.ra=N.ta+16*re*N.R+Ee,N.Ha=N.qa,N.Ia=N.ra+8*re*N.B+Ee,N.$c=0,me+=ue,N.mb=de?ge:null,N.nb=de?me:null,r(me+de<=N.Fc+N.Vb),ja(N),a(N.Ac,N.Bc,0,oe),re=1}}if(re){if(W.ka=0,W.y=N.sa,W.O=N.ta,W.f=N.qa,W.N=N.ra,W.ea=N.Ha,W.Vd=N.Ia,W.fa=N.R,W.Rc=N.B,W.F=null,W.J=0,!cu){for(re=-255;255>=re;++re)ti[255+re]=0>re?-re:re;for(re=-1020;1020>=re;++re)Io[1020+re]=-128>re?-128:127<re?127:re;for(re=-112;112>=re;++re)_l[112+re]=-16>re?-16:15<re?15:re;for(re=-255;510>=re;++re)nl[255+re]=0>re?0:255<re?255:re;cu=1}rl=Fr,ko=da,Lo=Gs,Kn=af,Mr=iu,Dr=nu,On=Fi,Zn=En,ts=qa,No=lu,To=ea,Ga=ta,Tn=As,ho=Zs,Ro=li,Mo=Ii,zi=ji,fn=vl,Hi[0]=Oo,Hi[1]=Ws,Hi[2]=Ys,Hi[3]=lo,Hi[4]=zu,Hi[5]=Dn,Hi[6]=Xs,Hi[7]=Ks,Hi[8]=ou,Hi[9]=au,Ui[0]=Ps,Ui[1]=yc,Ui[2]=$o,Ui[3]=xs,Ui[4]=mn,Ui[5]=Yo,Ui[6]=Fa,na[0]=Da,na[1]=$s,na[2]=of,na[3]=uo,na[4]=Mi,na[5]=su,na[6]=Ba,re=1}else re=0}re&&(re=function(Ge,_t){for(Ge.M=0;Ge.M<Ge.Va;++Ge.M){var ot,Ie=Ge.Jc[Ge.M&Ge.Xb],qe=Ge.m,He=Ge;for(ot=0;ot<He.za;++ot){var ft=qe,vt=He,Gt=vt.Ac,Bt=vt.Bc+4*ot,lr=vt.zc,jt=vt.ya[vt.aa+ot];if(vt.Qa.Bb?jt.$b=se(ft,vt.Pa.jb[0])?2+se(ft,vt.Pa.jb[2]):se(ft,vt.Pa.jb[1]):jt.$b=0,vt.kc&&(jt.Ad=se(ft,vt.Bd)),jt.Za=!se(ft,145)+0,jt.Za){var Br=jt.Ob,Ur=0;for(vt=0;4>vt;++vt){var Ir,xr=lr[0+vt];for(Ir=0;4>Ir;++Ir){xr=zf[Gt[Bt+Ir]][xr];for(var Zr=wc[se(ft,xr[0])];0<Zr;)Zr=wc[2*Zr+se(ft,xr[Zr])];xr=-Zr,Gt[Bt+Ir]=xr}n(Br,Ur,Gt,Bt,4),Ur+=4,lr[0+vt]=xr}}else xr=se(ft,156)?se(ft,128)?1:3:se(ft,163)?2:0,jt.Ob[0]=xr,a(Gt,Bt,xr,4),a(lr,0,xr,4);jt.Dd=se(ft,142)?se(ft,114)?se(ft,183)?1:3:2:0}if(He.m.Ka)return cn(Ge,7,"Premature end-of-partition0 encountered.");for(;Ge.ja<Ge.za;++Ge.ja){if(He=Ie,ft=(qe=Ge).rb[qe.sb-1],Gt=qe.rb[qe.sb+qe.ja],ot=qe.ya[qe.aa+qe.ja],Bt=qe.kc?ot.Ad:0)ft.la=Gt.la=0,ot.Za||(ft.Na=Gt.Na=0),ot.Hc=0,ot.Gc=0,ot.ia=0;else{var tn,tr;if(ft=Gt,Gt=He,Bt=qe.Pa.Xc,lr=qe.ya[qe.aa+qe.ja],jt=qe.pb[lr.$b],vt=lr.ad,Br=0,Ur=qe.rb[qe.sb-1],xr=Ir=0,a(vt,Br,0,384),lr.Za)var Hr=0,Rn=Bt[3];else{Zr=i(16);var zn=ft.Na+Ur.Na;if(zn=Ol(Gt,Bt[1],zn,jt.Eb,0,Zr,0),ft.Na=Ur.Na=(0<zn)+0,1<zn)rl(Zr,0,vt,Br);else{var hi=Zr[0]+3>>3;for(Zr=0;256>Zr;Zr+=16)vt[Br+Zr]=hi}Hr=1,Rn=Bt[0]}var Ar=15&ft.la,Gi=15&Ur.la;for(Zr=0;4>Zr;++Zr){var An=1&Gi;for(hi=tr=0;4>hi;++hi)Ar=Ar>>1|(An=(zn=Ol(Gt,Rn,zn=An+(1&Ar),jt.Sc,Hr,vt,Br))>Hr)<<7,tr=tr<<2|(3<zn?3:1<zn?2:vt[Br+0]!=0),Br+=16;Ar>>=4,Gi=Gi>>1|An<<7,Ir=(Ir<<8|tr)>>>0}for(Rn=Ar,Hr=Gi>>4,tn=0;4>tn;tn+=2){for(tr=0,Ar=ft.la>>4+tn,Gi=Ur.la>>4+tn,Zr=0;2>Zr;++Zr){for(An=1&Gi,hi=0;2>hi;++hi)zn=An+(1&Ar),Ar=Ar>>1|(An=0<(zn=Ol(Gt,Bt[2],zn,jt.Qc,0,vt,Br)))<<3,tr=tr<<2|(3<zn?3:1<zn?2:vt[Br+0]!=0),Br+=16;Ar>>=2,Gi=Gi>>1|An<<5}xr|=tr<<4*tn,Rn|=Ar<<4<<tn,Hr|=(240&Gi)<<tn}ft.la=Rn,Ur.la=Hr,lr.Hc=Ir,lr.Gc=xr,lr.ia=43690&xr?0:jt.ia,Bt=!(Ir|xr)}if(0<qe.L&&(qe.wa[qe.Y+qe.ja]=qe.gd[ot.$b][ot.Za],qe.wa[qe.Y+qe.ja].La|=!Bt),He.Ka)return cn(Ge,7,"Premature end-of-file encountered.")}if(ja(Ge),qe=_t,He=1,ot=(Ie=Ge).D,ft=0<Ie.L&&Ie.M>=Ie.zb&&Ie.M<=Ie.Va,Ie.Aa==0)e:{if(ot.M=Ie.M,ot.uc=ft,Di(Ie,ot),He=1,ot=(tr=Ie.D).Nb,ft=(xr=is[Ie.L])*Ie.R,Gt=xr/2*Ie.B,Zr=16*ot*Ie.R,hi=8*ot*Ie.B,Bt=Ie.sa,lr=Ie.ta-ft+Zr,jt=Ie.qa,vt=Ie.ra-Gt+hi,Br=Ie.Ha,Ur=Ie.Ia-Gt+hi,Gi=(Ar=tr.M)==0,Ir=Ar>=Ie.Va-1,Ie.Aa==2&&Di(Ie,tr),tr.uc)for(An=(zn=Ie).D.M,r(zn.D.uc),tr=zn.yb;tr<zn.Hb;++tr){Hr=tr,Rn=An;var Un=(di=(qr=zn).D).Nb;tn=qr.R;var di=di.wa[di.Y+Hr],Oi=qr.sa,ga=qr.ta+16*Un*tn+16*Hr,Ya=di.dd,wn=di.tc;if(wn!=0)if(r(3<=wn),qr.L==1)0<Hr&&Mo(Oi,ga,tn,wn+4),di.La&&fn(Oi,ga,tn,wn),0<Rn&&Ro(Oi,ga,tn,wn+4),di.La&&zi(Oi,ga,tn,wn);else{var Hn=qr.B,oa=qr.qa,Do=qr.ra+8*Un*Hn+8*Hr,vo=qr.Ha,qr=qr.Ia+8*Un*Hn+8*Hr;Un=di.ld,0<Hr&&(Zn(Oi,ga,tn,wn+4,Ya,Un),No(oa,Do,vo,qr,Hn,wn+4,Ya,Un)),di.La&&(Ga(Oi,ga,tn,wn,Ya,Un),ho(oa,Do,vo,qr,Hn,wn,Ya,Un)),0<Rn&&(On(Oi,ga,tn,wn+4,Ya,Un),ts(oa,Do,vo,qr,Hn,wn+4,Ya,Un)),di.La&&(To(Oi,ga,tn,wn,Ya,Un),Tn(oa,Do,vo,qr,Hn,wn,Ya,Un))}}if(Ie.ia&&alert("todo:DitherRow"),qe.put!=null){if(tr=16*Ar,Ar=16*(Ar+1),Gi?(qe.y=Ie.sa,qe.O=Ie.ta+Zr,qe.f=Ie.qa,qe.N=Ie.ra+hi,qe.ea=Ie.Ha,qe.W=Ie.Ia+hi):(tr-=xr,qe.y=Bt,qe.O=lr,qe.f=jt,qe.N=vt,qe.ea=Br,qe.W=Ur),Ir||(Ar-=xr),Ar>qe.o&&(Ar=qe.o),qe.F=null,qe.J=null,Ie.Fa!=null&&0<Ie.Fa.length&&tr<Ar&&(qe.J=uu(Ie,qe,tr,Ar-tr),qe.F=Ie.mb,qe.F==null&&qe.F.length==0)){He=cn(Ie,3,"Could not decode alpha data.");break e}tr<qe.j&&(xr=qe.j-tr,tr=qe.j,r(!(1&xr)),qe.O+=Ie.R*xr,qe.N+=Ie.B*(xr>>1),qe.W+=Ie.B*(xr>>1),qe.F!=null&&(qe.J+=qe.width*xr)),tr<Ar&&(qe.O+=qe.v,qe.N+=qe.v>>1,qe.W+=qe.v>>1,qe.F!=null&&(qe.J+=qe.v),qe.ka=tr-qe.j,qe.U=qe.va-qe.v,qe.T=Ar-tr,He=qe.put(qe))}ot+1!=Ie.Ic||Ir||(n(Ie.sa,Ie.ta-ft,Bt,lr+16*Ie.R,ft),n(Ie.qa,Ie.ra-Gt,jt,vt+8*Ie.B,Gt),n(Ie.Ha,Ie.Ia-Gt,Br,Ur+8*Ie.B,Gt))}if(!He)return cn(Ge,6,"Output aborted.")}return 1}(N,W)),W.bc!=null&&W.bc(W),re&=1}return re?(N.cb=0,re):0}function Ri(N,W,re,oe,ue){ue=N[W+re+32*oe]+(ue>>3),N[W+re+32*oe]=-256&ue?0>ue?0:255:ue}function pl(N,W,re,oe,ue,de){Ri(N,W,0,re,oe+ue),Ri(N,W,1,re,oe+de),Ri(N,W,2,re,oe-de),Ri(N,W,3,re,oe-ue)}function ha(N){return(20091*N>>16)+N}function Wo(N,W,re,oe){var ue,de=0,ge=i(16);for(ue=0;4>ue;++ue){var me=N[W+0]+N[W+8],we=N[W+0]-N[W+8],Ee=(35468*N[W+4]>>16)-ha(N[W+12]),De=ha(N[W+4])+(35468*N[W+12]>>16);ge[de+0]=me+De,ge[de+1]=we+Ee,ge[de+2]=we-Ee,ge[de+3]=me-De,de+=4,W++}for(ue=de=0;4>ue;++ue)me=(N=ge[de+0]+4)+ge[de+8],we=N-ge[de+8],Ee=(35468*ge[de+4]>>16)-ha(ge[de+12]),Ri(re,oe,0,0,me+(De=ha(ge[de+4])+(35468*ge[de+12]>>16))),Ri(re,oe,1,0,we+Ee),Ri(re,oe,2,0,we-Ee),Ri(re,oe,3,0,me-De),de++,oe+=32}function nu(N,W,re,oe){var ue=N[W+0]+4,de=35468*N[W+4]>>16,ge=ha(N[W+4]),me=35468*N[W+1]>>16;pl(re,oe,0,ue+ge,N=ha(N[W+1]),me),pl(re,oe,1,ue+de,N,me),pl(re,oe,2,ue-de,N,me),pl(re,oe,3,ue-ge,N,me)}function da(N,W,re,oe,ue){Wo(N,W,re,oe),ue&&Wo(N,W+16,re,oe+4)}function Gs(N,W,re,oe){ko(N,W+0,re,oe,1),ko(N,W+32,re,oe+128,1)}function af(N,W,re,oe){var ue;for(N=N[W+0]+4,ue=0;4>ue;++ue)for(W=0;4>W;++W)Ri(re,oe,W,ue,N)}function iu(N,W,re,oe){N[W+0]&&Kn(N,W+0,re,oe),N[W+16]&&Kn(N,W+16,re,oe+4),N[W+32]&&Kn(N,W+32,re,oe+128),N[W+48]&&Kn(N,W+48,re,oe+128+4)}function Fr(N,W,re,oe){var ue,de=i(16);for(ue=0;4>ue;++ue){var ge=N[W+0+ue]+N[W+12+ue],me=N[W+4+ue]+N[W+8+ue],we=N[W+4+ue]-N[W+8+ue],Ee=N[W+0+ue]-N[W+12+ue];de[0+ue]=ge+me,de[8+ue]=ge-me,de[4+ue]=Ee+we,de[12+ue]=Ee-we}for(ue=0;4>ue;++ue)ge=(N=de[0+4*ue]+3)+de[3+4*ue],me=de[1+4*ue]+de[2+4*ue],we=de[1+4*ue]-de[2+4*ue],Ee=N-de[3+4*ue],re[oe+0]=ge+me>>3,re[oe+16]=Ee+we>>3,re[oe+32]=ge-me>>3,re[oe+48]=Ee-we>>3,oe+=64}function Ss(N,W,re){var oe,ue=W-32,de=wi,ge=255-N[ue-1];for(oe=0;oe<re;++oe){var me,we=de,Ee=ge+N[W-1];for(me=0;me<re;++me)N[W+me]=we[Ee+N[ue+me]];W+=32}}function Ws(N,W){Ss(N,W,4)}function $s(N,W){Ss(N,W,8)}function yc(N,W){Ss(N,W,16)}function $o(N,W){var re;for(re=0;16>re;++re)n(N,W+32*re,N,W-32,16)}function xs(N,W){var re;for(re=16;0<re;--re)a(N,W,N[W-1],16),W+=32}function Es(N,W,re){var oe;for(oe=0;16>oe;++oe)a(W,re+32*oe,N,16)}function Ps(N,W){var re,oe=16;for(re=0;16>re;++re)oe+=N[W-1+32*re]+N[W+re-32];Es(oe>>5,N,W)}function mn(N,W){var re,oe=8;for(re=0;16>re;++re)oe+=N[W-1+32*re];Es(oe>>4,N,W)}function Yo(N,W){var re,oe=8;for(re=0;16>re;++re)oe+=N[W+re-32];Es(oe>>4,N,W)}function Fa(N,W){Es(128,N,W)}function Dt(N,W,re){return N+2*W+re+2>>2}function Ys(N,W){var re,oe=W-32;for(oe=new Uint8Array([Dt(N[oe-1],N[oe+0],N[oe+1]),Dt(N[oe+0],N[oe+1],N[oe+2]),Dt(N[oe+1],N[oe+2],N[oe+3]),Dt(N[oe+2],N[oe+3],N[oe+4])]),re=0;4>re;++re)n(N,W+32*re,oe,0,oe.length)}function lo(N,W){var re=N[W-1],oe=N[W-1+32],ue=N[W-1+64],de=N[W-1+96];fe(N,W+0,16843009*Dt(N[W-1-32],re,oe)),fe(N,W+32,16843009*Dt(re,oe,ue)),fe(N,W+64,16843009*Dt(oe,ue,de)),fe(N,W+96,16843009*Dt(ue,de,de))}function Oo(N,W){var re,oe=4;for(re=0;4>re;++re)oe+=N[W+re-32]+N[W-1+32*re];for(oe>>=3,re=0;4>re;++re)a(N,W+32*re,oe,4)}function zu(N,W){var re=N[W-1+0],oe=N[W-1+32],ue=N[W-1+64],de=N[W-1-32],ge=N[W+0-32],me=N[W+1-32],we=N[W+2-32],Ee=N[W+3-32];N[W+0+96]=Dt(oe,ue,N[W-1+96]),N[W+1+96]=N[W+0+64]=Dt(re,oe,ue),N[W+2+96]=N[W+1+64]=N[W+0+32]=Dt(de,re,oe),N[W+3+96]=N[W+2+64]=N[W+1+32]=N[W+0+0]=Dt(ge,de,re),N[W+3+64]=N[W+2+32]=N[W+1+0]=Dt(me,ge,de),N[W+3+32]=N[W+2+0]=Dt(we,me,ge),N[W+3+0]=Dt(Ee,we,me)}function Xs(N,W){var re=N[W+1-32],oe=N[W+2-32],ue=N[W+3-32],de=N[W+4-32],ge=N[W+5-32],me=N[W+6-32],we=N[W+7-32];N[W+0+0]=Dt(N[W+0-32],re,oe),N[W+1+0]=N[W+0+32]=Dt(re,oe,ue),N[W+2+0]=N[W+1+32]=N[W+0+64]=Dt(oe,ue,de),N[W+3+0]=N[W+2+32]=N[W+1+64]=N[W+0+96]=Dt(ue,de,ge),N[W+3+32]=N[W+2+64]=N[W+1+96]=Dt(de,ge,me),N[W+3+64]=N[W+2+96]=Dt(ge,me,we),N[W+3+96]=Dt(me,we,we)}function Dn(N,W){var re=N[W-1+0],oe=N[W-1+32],ue=N[W-1+64],de=N[W-1-32],ge=N[W+0-32],me=N[W+1-32],we=N[W+2-32],Ee=N[W+3-32];N[W+0+0]=N[W+1+64]=de+ge+1>>1,N[W+1+0]=N[W+2+64]=ge+me+1>>1,N[W+2+0]=N[W+3+64]=me+we+1>>1,N[W+3+0]=we+Ee+1>>1,N[W+0+96]=Dt(ue,oe,re),N[W+0+64]=Dt(oe,re,de),N[W+0+32]=N[W+1+96]=Dt(re,de,ge),N[W+1+32]=N[W+2+96]=Dt(de,ge,me),N[W+2+32]=N[W+3+96]=Dt(ge,me,we),N[W+3+32]=Dt(me,we,Ee)}function Ks(N,W){var re=N[W+0-32],oe=N[W+1-32],ue=N[W+2-32],de=N[W+3-32],ge=N[W+4-32],me=N[W+5-32],we=N[W+6-32],Ee=N[W+7-32];N[W+0+0]=re+oe+1>>1,N[W+1+0]=N[W+0+64]=oe+ue+1>>1,N[W+2+0]=N[W+1+64]=ue+de+1>>1,N[W+3+0]=N[W+2+64]=de+ge+1>>1,N[W+0+32]=Dt(re,oe,ue),N[W+1+32]=N[W+0+96]=Dt(oe,ue,de),N[W+2+32]=N[W+1+96]=Dt(ue,de,ge),N[W+3+32]=N[W+2+96]=Dt(de,ge,me),N[W+3+64]=Dt(ge,me,we),N[W+3+96]=Dt(me,we,Ee)}function au(N,W){var re=N[W-1+0],oe=N[W-1+32],ue=N[W-1+64],de=N[W-1+96];N[W+0+0]=re+oe+1>>1,N[W+2+0]=N[W+0+32]=oe+ue+1>>1,N[W+2+32]=N[W+0+64]=ue+de+1>>1,N[W+1+0]=Dt(re,oe,ue),N[W+3+0]=N[W+1+32]=Dt(oe,ue,de),N[W+3+32]=N[W+1+64]=Dt(ue,de,de),N[W+3+64]=N[W+2+64]=N[W+0+96]=N[W+1+96]=N[W+2+96]=N[W+3+96]=de}function ou(N,W){var re=N[W-1+0],oe=N[W-1+32],ue=N[W-1+64],de=N[W-1+96],ge=N[W-1-32],me=N[W+0-32],we=N[W+1-32],Ee=N[W+2-32];N[W+0+0]=N[W+2+32]=re+ge+1>>1,N[W+0+32]=N[W+2+64]=oe+re+1>>1,N[W+0+64]=N[W+2+96]=ue+oe+1>>1,N[W+0+96]=de+ue+1>>1,N[W+3+0]=Dt(me,we,Ee),N[W+2+0]=Dt(ge,me,we),N[W+1+0]=N[W+3+32]=Dt(re,ge,me),N[W+1+32]=N[W+3+64]=Dt(oe,re,ge),N[W+1+64]=N[W+3+96]=Dt(ue,oe,re),N[W+1+96]=Dt(de,ue,oe)}function of(N,W){var re;for(re=0;8>re;++re)n(N,W+32*re,N,W-32,8)}function uo(N,W){var re;for(re=0;8>re;++re)a(N,W,N[W-1],8),W+=32}function si(N,W,re){var oe;for(oe=0;8>oe;++oe)a(W,re+32*oe,N,8)}function Da(N,W){var re,oe=8;for(re=0;8>re;++re)oe+=N[W+re-32]+N[W-1+32*re];si(oe>>4,N,W)}function su(N,W){var re,oe=4;for(re=0;8>re;++re)oe+=N[W+re-32];si(oe>>3,N,W)}function Mi(N,W){var re,oe=4;for(re=0;8>re;++re)oe+=N[W-1+32*re];si(oe>>3,N,W)}function Ba(N,W){si(128,N,W)}function Ao(N,W,re){var oe=N[W-re],ue=N[W+0],de=3*(ue-oe)+jo[1020+N[W-2*re]-N[W+re]],ge=Sl[112+(de+4>>3)];N[W-re]=wi[255+oe+Sl[112+(de+3>>3)]],N[W+0]=wi[255+ue-ge]}function Os(N,W,re,oe){var ue=N[W+0],de=N[W+re];return Wa[255+N[W-2*re]-N[W-re]]>oe||Wa[255+de-ue]>oe}function gl(N,W,re,oe){return 4*Wa[255+N[W-re]-N[W+0]]+Wa[255+N[W-2*re]-N[W+re]]<=oe}function Uu(N,W,re,oe,ue){var de=N[W-3*re],ge=N[W-2*re],me=N[W-re],we=N[W+0],Ee=N[W+re],De=N[W+2*re],Xe=N[W+3*re];return 4*Wa[255+me-we]+Wa[255+ge-Ee]>oe?0:Wa[255+N[W-4*re]-de]<=ue&&Wa[255+de-ge]<=ue&&Wa[255+ge-me]<=ue&&Wa[255+Xe-De]<=ue&&Wa[255+De-Ee]<=ue&&Wa[255+Ee-we]<=ue}function li(N,W,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(N,W+oe,re,ue)&&Ao(N,W+oe,re)}function Ii(N,W,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(N,W+oe*re,1,ue)&&Ao(N,W+oe*re,1)}function ji(N,W,re,oe){var ue;for(ue=3;0<ue;--ue)li(N,W+=4*re,re,oe)}function vl(N,W,re,oe){var ue;for(ue=3;0<ue;--ue)Ii(N,W+=4,re,oe)}function xa(N,W,re,oe,ue,de,ge,me){for(de=2*de+1;0<ue--;){if(Uu(N,W,re,de,ge))if(Os(N,W,re,me))Ao(N,W,re);else{var we=N,Ee=W,De=re,Xe=we[Ee-2*De],We=we[Ee-De],Ge=we[Ee+0],_t=we[Ee+De],ot=we[Ee+2*De],Ie=27*(He=jo[1020+3*(Ge-We)+jo[1020+Xe-_t]])+63>>7,qe=18*He+63>>7,He=9*He+63>>7;we[Ee-3*De]=wi[255+we[Ee-3*De]+He],we[Ee-2*De]=wi[255+Xe+qe],we[Ee-De]=wi[255+We+Ie],we[Ee+0]=wi[255+Ge-Ie],we[Ee+De]=wi[255+_t-qe],we[Ee+2*De]=wi[255+ot-He]}W+=oe}}function xn(N,W,re,oe,ue,de,ge,me){for(de=2*de+1;0<ue--;){if(Uu(N,W,re,de,ge))if(Os(N,W,re,me))Ao(N,W,re);else{var we=N,Ee=W,De=re,Xe=we[Ee-De],We=we[Ee+0],Ge=we[Ee+De],_t=Sl[112+((ot=3*(We-Xe))+4>>3)],ot=Sl[112+(ot+3>>3)],Ie=_t+1>>1;we[Ee-2*De]=wi[255+we[Ee-2*De]+Ie],we[Ee-De]=wi[255+Xe+ot],we[Ee+0]=wi[255+We-_t],we[Ee+De]=wi[255+Ge-Ie]}W+=oe}}function Fi(N,W,re,oe,ue,de){xa(N,W,re,1,16,oe,ue,de)}function En(N,W,re,oe,ue,de){xa(N,W,1,re,16,oe,ue,de)}function ea(N,W,re,oe,ue,de){var ge;for(ge=3;0<ge;--ge)xn(N,W+=4*re,re,1,16,oe,ue,de)}function ta(N,W,re,oe,ue,de){var ge;for(ge=3;0<ge;--ge)xn(N,W+=4,1,re,16,oe,ue,de)}function qa(N,W,re,oe,ue,de,ge,me){xa(N,W,ue,1,8,de,ge,me),xa(re,oe,ue,1,8,de,ge,me)}function lu(N,W,re,oe,ue,de,ge,me){xa(N,W,1,ue,8,de,ge,me),xa(re,oe,1,ue,8,de,ge,me)}function As(N,W,re,oe,ue,de,ge,me){xn(N,W+4*ue,ue,1,8,de,ge,me),xn(re,oe+4*ue,ue,1,8,de,ge,me)}function Zs(N,W,re,oe,ue,de,ge,me){xn(N,W+4,1,ue,8,de,ge,me),xn(re,oe+4,1,ue,8,de,ge,me)}function Xn(){this.ba=new xt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new nr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function mi(){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 nn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Qs(){this.ua=0,this.Wa=new ye,this.vb=new ye,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new q,this.yc=new O}function za(){this.xb=this.a=0,this.l=new Jr,this.ca=new xt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new z,this.Pb=0,this.wd=new z,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Qs,this.ab=0,this.gc=o(4,nn),this.Oc=0}function ml(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Jr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Xo(N,W,re,oe,ue,de,ge){for(N=N==null?0:N[W+0],W=0;W<ge;++W)ue[de+W]=N+re[oe+W]&255,N=ue[de+W]}function yl(N,W,re,oe,ue,de,ge){var me;if(N==null)Xo(null,null,re,oe,ue,de,ge);else for(me=0;me<ge;++me)ue[de+me]=N[W+me]+re[oe+me]&255}function Ko(N,W,re,oe,ue,de,ge){if(N==null)Xo(null,null,re,oe,ue,de,ge);else{var me,we=N[W+0],Ee=we,De=we;for(me=0;me<ge;++me)Ee=De+(we=N[W+me])-Ee,De=re[oe+me]+(-256&Ee?0>Ee?0:255:Ee)&255,Ee=we,ue[de+me]=De}}function uu(N,W,re,oe){var ue=W.width,de=W.o;if(r(N!=null&&W!=null),0>re||0>=oe||re+oe>de)return null;if(!N.Cc){if(N.ga==null){var ge;if(N.ga=new ml,(ge=N.ga==null)||(ge=W.width*W.o,r(N.Gb.length==0),N.Gb=i(ge),N.Uc=0,N.Gb==null?ge=0:(N.mb=N.Gb,N.nb=N.Uc,N.rc=null,ge=1),ge=!ge),!ge){ge=N.ga;var me=N.Fa,we=N.P,Ee=N.qc,De=N.mb,Xe=N.nb,We=we+1,Ge=Ee-1,_t=ge.l;if(r(me!=null&&De!=null&&W!=null),Vi[0]=null,Vi[1]=Xo,Vi[2]=yl,Vi[3]=Ko,ge.ca=De,ge.tb=Xe,ge.c=W.width,ge.i=W.height,r(0<ge.c&&0<ge.i),1>=Ee)W=0;else if(ge.$a=me[we+0]>>0&3,ge.Z=me[we+0]>>2&3,ge.Lc=me[we+0]>>4&3,we=me[we+0]>>6&3,0>ge.$a||1<ge.$a||4<=ge.Z||1<ge.Lc||we)W=0;else if(_t.put=bt,_t.ac=Ze,_t.bc=Vt,_t.ma=ge,_t.width=W.width,_t.height=W.height,_t.Da=W.Da,_t.v=W.v,_t.va=W.va,_t.j=W.j,_t.o=W.o,ge.$a)e:{r(ge.$a==1),W=Sn();t:for(;;){if(W==null){W=0;break e}if(r(ge!=null),ge.mc=W,W.c=ge.c,W.i=ge.i,W.l=ge.l,W.l.ma=ge,W.l.width=ge.c,W.l.height=ge.i,W.a=0,B(W.m,me,We,Ge),!Ni(ge.c,ge.i,1,W,null)||(W.ab==1&&W.gc[0].hc==3&>(W.s)?(ge.ic=1,me=W.c*W.i,W.Ta=null,W.Ua=0,W.V=i(me),W.Ba=0,W.V==null?(W.a=1,W=0):W=1):(ge.ic=0,W=Si(W,ge.c)),!W))break t;W=1;break e}ge.mc=null,W=0}else W=Ge>=ge.c*ge.i;ge=!W}if(ge)return null;N.ga.Lc!=1?N.Ga=0:oe=de-re}r(N.ga!=null),r(re+oe<=de);e:{if(W=(me=N.ga).c,de=me.l.o,me.$a==0){if(We=N.rc,Ge=N.Vc,_t=N.Fa,we=N.P+1+re*W,Ee=N.mb,De=N.nb+re*W,r(we<=N.P+N.qc),me.Z!=0)for(r(Vi[me.Z]!=null),ge=0;ge<oe;++ge)Vi[me.Z](We,Ge,_t,we,Ee,De,W),We=Ee,Ge=De,De+=W,we+=W;else for(ge=0;ge<oe;++ge)n(Ee,De,_t,we,W),We=Ee,Ge=De,De+=W,we+=W;N.rc=We,N.Vc=Ge}else{if(r(me.mc!=null),W=re+oe,r((ge=me.mc)!=null),r(W<=ge.i),ge.C>=W)W=1;else if(me.ic||Ke(),me.ic){me=ge.V,We=ge.Ba,Ge=ge.c;var ot=ge.i,Ie=(_t=1,we=ge.$/Ge,Ee=ge.$%Ge,De=ge.m,Xe=ge.s,ge.$),qe=Ge*ot,He=Ge*W,ft=Xe.wc,vt=Ie<He?Et(Xe,Ee,we):null;r(Ie<=qe),r(W<=ot),r(gt(Xe));t:for(;;){for(;!De.h&&Ie<He;){if(Ee&ft||(vt=Et(Xe,Ee,we)),r(vt!=null),X(De),256>(ot=ut(vt.G[0],vt.H[0],De)))me[We+Ie]=ot,++Ie,++Ee>=Ge&&(Ee=0,++we<=W&&!(we%16)&&br(ge,we));else{if(!(280>ot)){_t=0;break t}ot=Kt(ot-256,De);var Gt,Bt=ut(vt.G[4],vt.H[4],De);if(X(De),!(Ie>=(Bt=Yt(Ge,Bt=Kt(Bt,De)))&&qe-Ie>=ot)){_t=0;break t}for(Gt=0;Gt<ot;++Gt)me[We+Ie+Gt]=me[We+Ie+Gt-Bt];for(Ie+=ot,Ee+=ot;Ee>=Ge;)Ee-=Ge,++we<=W&&!(we%16)&&br(ge,we);Ie<He&&Ee&ft&&(vt=Et(Xe,Ee,we))}r(De.h==Y(De))}br(ge,we>W?W:we);break t}!_t||De.h&&Ie<qe?(_t=0,ge.a=De.h?5:3):ge.$=Ie,W=_t}else W=hr(ge,ge.V,ge.Ba,ge.c,ge.i,W,fa);if(!W){oe=0;break e}}re+oe>=de&&(N.Cc=1),oe=1}if(!oe)return null;if(N.Cc&&((oe=N.ga)!=null&&(oe.mc=null),N.ga=null,0<N.Ga))return alert("todo:WebPDequantizeLevels"),null}return N.nb+re*ue}function K(N,W,re,oe,ue,de){for(;0<ue--;){var ge,me=N,we=W+(re?1:0),Ee=N,De=W+(re?0:3);for(ge=0;ge<oe;++ge){var Xe=Ee[De+4*ge];Xe!=255&&(Xe*=32897,me[we+4*ge+0]=me[we+4*ge+0]*Xe>>23,me[we+4*ge+1]=me[we+4*ge+1]*Xe>>23,me[we+4*ge+2]=me[we+4*ge+2]*Xe>>23)}W+=de}}function ce(N,W,re,oe,ue){for(;0<oe--;){var de;for(de=0;de<re;++de){var ge=N[W+2*de+0],me=15&(Ee=N[W+2*de+1]),we=4369*me,Ee=(240&Ee|Ee>>4)*we>>16;N[W+2*de+0]=(240&ge|ge>>4)*we>>16&240|(15&ge|ge<<4)*we>>16>>4&15,N[W+2*de+1]=240&Ee|me}W+=ue}}function Le(N,W,re,oe,ue,de,ge,me){var we,Ee,De=255;for(Ee=0;Ee<ue;++Ee){for(we=0;we<oe;++we){var Xe=N[W+we];de[ge+4*we]=Xe,De&=Xe}W+=re,ge+=me}return De!=255}function Fe(N,W,re,oe,ue){var de;for(de=0;de<ue;++de)re[oe+de]=N[W+de]>>8}function Ke(){Ei=K,on=ce,Kr=Le,qn=Fe}function ht(N,W,re){L[N]=function(oe,ue,de,ge,me,we,Ee,De,Xe,We,Ge,_t,ot,Ie,qe,He,ft){var vt,Gt=ft-1>>1,Bt=me[we+0]|Ee[De+0]<<16,lr=Xe[We+0]|Ge[_t+0]<<16;r(oe!=null);var jt=3*Bt+lr+131074>>2;for(W(oe[ue+0],255&jt,jt>>16,ot,Ie),de!=null&&(jt=3*lr+Bt+131074>>2,W(de[ge+0],255&jt,jt>>16,qe,He)),vt=1;vt<=Gt;++vt){var Br=me[we+vt]|Ee[De+vt]<<16,Ur=Xe[We+vt]|Ge[_t+vt]<<16,Ir=Bt+Br+lr+Ur+524296,xr=Ir+2*(Br+lr)>>3;jt=xr+Bt>>1,Bt=(Ir=Ir+2*(Bt+Ur)>>3)+Br>>1,W(oe[ue+2*vt-1],255&jt,jt>>16,ot,Ie+(2*vt-1)*re),W(oe[ue+2*vt-0],255&Bt,Bt>>16,ot,Ie+(2*vt-0)*re),de!=null&&(jt=Ir+lr>>1,Bt=xr+Ur>>1,W(de[ge+2*vt-1],255&jt,jt>>16,qe,He+(2*vt-1)*re),W(de[ge+2*vt+0],255&Bt,Bt>>16,qe,He+(2*vt+0)*re)),Bt=Br,lr=Ur}1&ft||(jt=3*Bt+lr+131074>>2,W(oe[ue+ft-1],255&jt,jt>>16,ot,Ie+(ft-1)*re),de!=null&&(jt=3*lr+Bt+131074>>2,W(de[ge+ft-1],255&jt,jt>>16,qe,He+(ft-1)*re)))}}function Pt(){pa[xl]=Hf,pa[Fo]=Ns,pa[sf]=Vf,pa[El]=vu,pa[fu]=fi,pa[hn]=_i,pa[Vu]=Sc,pa[Pl]=Ns,pa[ks]=vu,pa[hu]=fi,pa[du]=_i}function zt(N){return N&-16384?0>N?0:255:N>>ns}function sr(N,W){return zt((19077*N>>8)+(26149*W>>8)-14234)}function wr(N,W,re){return zt((19077*N>>8)-(6419*W>>8)-(13320*re>>8)+8708)}function mr(N,W){return zt((19077*N>>8)+(33050*W>>8)-17685)}function Or(N,W,re,oe,ue){oe[ue+0]=sr(N,re),oe[ue+1]=wr(N,W,re),oe[ue+2]=mr(N,W)}function Nn(N,W,re,oe,ue){oe[ue+0]=mr(N,W),oe[ue+1]=wr(N,W,re),oe[ue+2]=sr(N,re)}function Pn(N,W,re,oe,ue){var de=wr(N,W,re);W=de<<3&224|mr(N,W)>>3,oe[ue+0]=248&sr(N,re)|de>>5,oe[ue+1]=W}function Bn(N,W,re,oe,ue){var de=240&mr(N,W)|15;oe[ue+0]=240&sr(N,re)|wr(N,W,re)>>4,oe[ue+1]=de}function ei(N,W,re,oe,ue){oe[ue+0]=255,Or(N,W,re,oe,ue+1)}function ui(N,W,re,oe,ue){Nn(N,W,re,oe,ue),oe[ue+3]=255}function Ua(N,W,re,oe,ue){Or(N,W,re,oe,ue),oe[ue+3]=255}function Ea(N,W){return 0>N?0:N>W?W:N}function Pa(N,W,re){L[N]=function(oe,ue,de,ge,me,we,Ee,De,Xe){for(var We=De+(-2&Xe)*re;De!=We;)W(oe[ue+0],de[ge+0],me[we+0],Ee,De),W(oe[ue+1],de[ge+0],me[we+0],Ee,De+re),ue+=2,++ge,++we,De+=2*re;1&Xe&&W(oe[ue+0],de[ge+0],me[we+0],Ee,De)}}function Zo(N,W,re){return re==0?N==0?W==0?6:5:W==0?4:0:re}function Qo(N,W,re,oe,ue){switch(N>>>30){case 3:ko(W,re,oe,ue,0);break;case 2:Dr(W,re,oe,ue);break;case 1:Kn(W,re,oe,ue)}}function Di(N,W){var re,oe,ue=W.M,de=W.Nb,ge=N.oc,me=N.pc+40,we=N.oc,Ee=N.pc+584,De=N.oc,Xe=N.pc+600;for(re=0;16>re;++re)ge[me+32*re-1]=129;for(re=0;8>re;++re)we[Ee+32*re-1]=129,De[Xe+32*re-1]=129;for(0<ue?ge[me-1-32]=we[Ee-1-32]=De[Xe-1-32]=129:(a(ge,me-32-1,127,21),a(we,Ee-32-1,127,9),a(De,Xe-32-1,127,9)),oe=0;oe<N.za;++oe){var We=W.ya[W.aa+oe];if(0<oe){for(re=-1;16>re;++re)n(ge,me+32*re-4,ge,me+32*re+12,4);for(re=-1;8>re;++re)n(we,Ee+32*re-4,we,Ee+32*re+4,4),n(De,Xe+32*re-4,De,Xe+32*re+4,4)}var Ge=N.Gd,_t=N.Hd+oe,ot=We.ad,Ie=We.Hc;if(0<ue&&(n(ge,me-32,Ge[_t].y,0,16),n(we,Ee-32,Ge[_t].f,0,8),n(De,Xe-32,Ge[_t].ea,0,8)),We.Za){var qe=ge,He=me-32+16;for(0<ue&&(oe>=N.za-1?a(qe,He,Ge[_t].y[15],4):n(qe,He,Ge[_t+1].y,0,4)),re=0;4>re;re++)qe[He+128+re]=qe[He+256+re]=qe[He+384+re]=qe[He+0+re];for(re=0;16>re;++re,Ie<<=2)qe=ge,He=me+Yu[re],Hi[We.Ob[re]](qe,He),Qo(Ie,ot,16*+re,qe,He)}else if(qe=Zo(oe,ue,We.Ob[0]),Ui[qe](ge,me),Ie!=0)for(re=0;16>re;++re,Ie<<=2)Qo(Ie,ot,16*+re,ge,me+Yu[re]);for(re=We.Gc,qe=Zo(oe,ue,We.Dd),na[qe](we,Ee),na[qe](De,Xe),Ie=ot,qe=we,He=Ee,255&(We=re>>0)&&(170&We?Lo(Ie,256,qe,He):Mr(Ie,256,qe,He)),We=De,Ie=Xe,255&(re>>=8)&&(170&re?Lo(ot,320,We,Ie):Mr(ot,320,We,Ie)),ue<N.Ub-1&&(n(Ge[_t].y,0,ge,me+480,16),n(Ge[_t].f,0,we,Ee+224,8),n(Ge[_t].ea,0,De,Xe+224,8)),re=8*de*N.B,Ge=N.sa,_t=N.ta+16*oe+16*de*N.R,ot=N.qa,We=N.ra+8*oe+re,Ie=N.Ha,qe=N.Ia+8*oe+re,re=0;16>re;++re)n(Ge,_t+re*N.R,ge,me+32*re,16);for(re=0;8>re;++re)n(ot,We+re*N.B,we,Ee+32*re,8),n(Ie,qe+re*N.B,De,Xe+32*re,8)}}function Ha(N,W,re,oe,ue,de,ge,me,we){var Ee=[0],De=[0],Xe=0,We=we!=null?we.kd:0,Ge=we??new mi;if(N==null||12>re)return 7;Ge.data=N,Ge.w=W,Ge.ha=re,W=[W],re=[re],Ge.gb=[Ge.gb];e:{var _t=W,ot=re,Ie=Ge.gb;if(r(N!=null),r(ot!=null),r(Ie!=null),Ie[0]=0,12<=ot[0]&&!t(N,_t[0],"RIFF")){if(t(N,_t[0]+8,"WEBP")){Ie=3;break e}var qe=Ae(N,_t[0]+4);if(12>qe||4294967286<qe){Ie=3;break e}if(We&&qe>ot[0]-8){Ie=7;break e}Ie[0]=qe,_t[0]+=12,ot[0]-=12}Ie=0}if(Ie!=0)return Ie;for(qe=0<Ge.gb[0],re=re[0];;){e:{var He=N;ot=W,Ie=re;var ft=Ee,vt=De,Gt=_t=[0];if((jt=Xe=[Xe])[0]=0,8>Ie[0])Ie=7;else{if(!t(He,ot[0],"VP8X")){if(Ae(He,ot[0]+4)!=10){Ie=3;break e}if(18>Ie[0]){Ie=7;break e}var Bt=Ae(He,ot[0]+8),lr=1+_e(He,ot[0]+12);if(2147483648<=lr*(He=1+_e(He,ot[0]+15))){Ie=3;break e}Gt!=null&&(Gt[0]=Bt),ft!=null&&(ft[0]=lr),vt!=null&&(vt[0]=He),ot[0]+=18,Ie[0]-=18,jt[0]=1}Ie=0}}if(Xe=Xe[0],_t=_t[0],Ie!=0)return Ie;if(ot=!!(2&_t),!qe&&Xe)return 3;if(de!=null&&(de[0]=!!(16&_t)),ge!=null&&(ge[0]=ot),me!=null&&(me[0]=0),ge=Ee[0],_t=De[0],Xe&&ot&&we==null){Ie=0;break}if(4>re){Ie=7;break}if(qe&&Xe||!qe&&!Xe&&!t(N,W[0],"ALPH")){re=[re],Ge.na=[Ge.na],Ge.P=[Ge.P],Ge.Sa=[Ge.Sa];e:{Bt=N,Ie=W,qe=re;var jt=Ge.gb;ft=Ge.na,vt=Ge.P,Gt=Ge.Sa,lr=22,r(Bt!=null),r(qe!=null),He=Ie[0];var Br=qe[0];for(r(ft!=null),r(Gt!=null),ft[0]=null,vt[0]=null,Gt[0]=0;;){if(Ie[0]=He,qe[0]=Br,8>Br){Ie=7;break e}var Ur=Ae(Bt,He+4);if(4294967286<Ur){Ie=3;break e}var Ir=8+Ur+1&-2;if(lr+=Ir,0<jt&&lr>jt){Ie=3;break e}if(!t(Bt,He,"VP8 ")||!t(Bt,He,"VP8L")){Ie=0;break e}if(Br[0]<Ir){Ie=7;break e}t(Bt,He,"ALPH")||(ft[0]=Bt,vt[0]=He+8,Gt[0]=Ur),He+=Ir,Br-=Ir}}if(re=re[0],Ge.na=Ge.na[0],Ge.P=Ge.P[0],Ge.Sa=Ge.Sa[0],Ie!=0)break}re=[re],Ge.Ja=[Ge.Ja],Ge.xa=[Ge.xa];e:if(jt=N,Ie=W,qe=re,ft=Ge.gb[0],vt=Ge.Ja,Gt=Ge.xa,Bt=Ie[0],He=!t(jt,Bt,"VP8 "),lr=!t(jt,Bt,"VP8L"),r(jt!=null),r(qe!=null),r(vt!=null),r(Gt!=null),8>qe[0])Ie=7;else{if(He||lr){if(jt=Ae(jt,Bt+4),12<=ft&&jt>ft-12){Ie=3;break e}if(We&&jt>qe[0]-8){Ie=7;break e}vt[0]=jt,Ie[0]+=8,qe[0]-=8,Gt[0]=lr}else Gt[0]=5<=qe[0]&&jt[Bt+0]==47&&!(jt[Bt+4]>>5),vt[0]=qe[0];Ie=0}if(re=re[0],Ge.Ja=Ge.Ja[0],Ge.xa=Ge.xa[0],W=W[0],Ie!=0)break;if(4294967286<Ge.Ja)return 3;if(me==null||ot||(me[0]=Ge.xa?2:1),ge=[ge],_t=[_t],Ge.xa){if(5>re){Ie=7;break}me=ge,We=_t,ot=de,N==null||5>re?N=0:5<=re&&N[W+0]==47&&!(N[W+4]>>5)?(qe=[0],jt=[0],ft=[0],B(vt=new z,N,W,re),wt(vt,qe,jt,ft)?(me!=null&&(me[0]=qe[0]),We!=null&&(We[0]=jt[0]),ot!=null&&(ot[0]=ft[0]),N=1):N=0):N=0}else{if(10>re){Ie=7;break}me=_t,N==null||10>re||!vi(N,W+3,re-3)?N=0:(We=N[W+0]|N[W+1]<<8|N[W+2]<<16,ot=16383&(N[W+7]<<8|N[W+6]),N=16383&(N[W+9]<<8|N[W+8]),1&We||3<(We>>1&7)||!(We>>4&1)||We>>5>=Ge.Ja||!ot||!N?N=0:(ge&&(ge[0]=ot),me&&(me[0]=N),N=1))}if(!N||(ge=ge[0],_t=_t[0],Xe&&(Ee[0]!=ge||De[0]!=_t)))return 3;we!=null&&(we[0]=Ge,we.offset=W-we.w,r(4294967286>W-we.w),r(we.offset==we.ha-re));break}return Ie==0||Ie==7&&Xe&&we==null?(de!=null&&(de[0]|=Ge.na!=null&&0<Ge.na.length),oe!=null&&(oe[0]=ge),ue!=null&&(ue[0]=_t),0):Ie}function Js(N,W,re){var oe=W.width,ue=W.height,de=0,ge=0,me=oe,we=ue;if(W.Da=N!=null&&0<N.Da,W.Da&&(me=N.cd,we=N.bd,de=N.v,ge=N.j,11>re||(de&=-2,ge&=-2),0>de||0>ge||0>=me||0>=we||de+me>oe||ge+we>ue))return 0;if(W.v=de,W.j=ge,W.va=de+me,W.o=ge+we,W.U=me,W.T=we,W.da=N!=null&&0<N.da,W.da){if(!nt(me,we,re=[N.ib],de=[N.hb]))return 0;W.ib=re[0],W.hb=de[0]}return W.ob=N!=null&&N.ob,W.Kb=N==null||!N.Sd,W.da&&(W.ob=W.ib<3*oe/4&&W.hb<3*ue/4,W.Kb=0),1}function bl(N){if(N==null)return 2;if(11>N.S){var W=N.f.RGBA;W.fb+=(N.height-1)*W.A,W.A=-W.A}else W=N.f.kb,N=N.height,W.O+=(N-1)*W.fa,W.fa=-W.fa,W.N+=(N-1>>1)*W.Ab,W.Ab=-W.Ab,W.W+=(N-1>>1)*W.Db,W.Db=-W.Db,W.F!=null&&(W.J+=(N-1)*W.lb,W.lb=-W.lb);return 0}function ra(N,W,re,oe){if(oe==null||0>=N||0>=W)return 2;if(re!=null){if(re.Da){var ue=re.cd,de=re.bd,ge=-2&re.v,me=-2&re.j;if(0>ge||0>me||0>=ue||0>=de||ge+ue>N||me+de>W)return 2;N=ue,W=de}if(re.da){if(!nt(N,W,ue=[re.ib],de=[re.hb]))return 2;N=ue[0],W=de[0]}}oe.width=N,oe.height=W;e:{var we=oe.width,Ee=oe.height;if(N=oe.S,0>=we||0>=Ee||!(N>=xl&&13>N))N=2;else{if(0>=oe.Rd&&oe.sd==null){ge=de=ue=W=0;var De=(me=we*Cl[N])*Ee;if(11>N||(de=(Ee+1)/2*(W=(we+1)/2),N==12&&(ge=(ue=we)*Ee)),(Ee=i(De+2*de+ge))==null){N=1;break e}oe.sd=Ee,11>N?((we=oe.f.RGBA).eb=Ee,we.fb=0,we.A=me,we.size=De):((we=oe.f.kb).y=Ee,we.O=0,we.fa=me,we.Fd=De,we.f=Ee,we.N=0+De,we.Ab=W,we.Cd=de,we.ea=Ee,we.W=0+De+de,we.Db=W,we.Ed=de,N==12&&(we.F=Ee,we.J=0+De+2*de),we.Tc=ge,we.lb=ue)}if(W=1,ue=oe.S,de=oe.width,ge=oe.height,ue>=xl&&13>ue)if(11>ue)N=oe.f.RGBA,W&=(me=Math.abs(N.A))*(ge-1)+de<=N.size,W&=me>=de*Cl[ue],W&=N.eb!=null;else{N=oe.f.kb,me=(de+1)/2,De=(ge+1)/2,we=Math.abs(N.fa),Ee=Math.abs(N.Ab);var Xe=Math.abs(N.Db),We=Math.abs(N.lb),Ge=We*(ge-1)+de;W&=we*(ge-1)+de<=N.Fd,W&=Ee*(De-1)+me<=N.Cd,W=(W&=Xe*(De-1)+me<=N.Ed)&we>=de&Ee>=me&Xe>=me,W&=N.y!=null,W&=N.f!=null,W&=N.ea!=null,ue==12&&(W&=We>=de,W&=Ge<=N.Tc,W&=N.F!=null)}else W=0;N=W?0:2}}return N!=0||re!=null&&re.fd&&(N=bl(oe)),N}var an=64,el=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],wl=24,Oa=32,Va=8,xi=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ke("Predictor0","PredictorAdd0"),L.Predictor0=function(){return 4278190080},L.Predictor1=function(N){return N},L.Predictor2=function(N,W,re){return W[re+0]},L.Predictor3=function(N,W,re){return W[re+1]},L.Predictor4=function(N,W,re){return W[re-1]},L.Predictor5=function(N,W,re){return ve(ve(N,W[re+1]),W[re+0])},L.Predictor6=function(N,W,re){return ve(N,W[re-1])},L.Predictor7=function(N,W,re){return ve(N,W[re+0])},L.Predictor8=function(N,W,re){return ve(W[re-1],W[re+0])},L.Predictor9=function(N,W,re){return ve(W[re+0],W[re+1])},L.Predictor10=function(N,W,re){return ve(ve(N,W[re-1]),ve(W[re+0],W[re+1]))},L.Predictor11=function(N,W,re){var oe=W[re+0];return 0>=Ue(oe>>24&255,N>>24&255,(W=W[re-1])>>24&255)+Ue(oe>>16&255,N>>16&255,W>>16&255)+Ue(oe>>8&255,N>>8&255,W>>8&255)+Ue(255&oe,255&N,255&W)?oe:N},L.Predictor12=function(N,W,re){var oe=W[re+0];return(Se((N>>24&255)+(oe>>24&255)-((W=W[re-1])>>24&255))<<24|Se((N>>16&255)+(oe>>16&255)-(W>>16&255))<<16|Se((N>>8&255)+(oe>>8&255)-(W>>8&255))<<8|Se((255&N)+(255&oe)-(255&W)))>>>0},L.Predictor13=function(N,W,re){var oe=W[re-1];return(je((N=ve(N,W[re+0]))>>24&255,oe>>24&255)<<24|je(N>>16&255,oe>>16&255)<<16|je(N>>8&255,oe>>8&255)<<8|je(N>>0&255,oe>>0&255))>>>0};var tl=L.PredictorAdd0;L.PredictorAdd1=ct,ke("Predictor2","PredictorAdd2"),ke("Predictor3","PredictorAdd3"),ke("Predictor4","PredictorAdd4"),ke("Predictor5","PredictorAdd5"),ke("Predictor6","PredictorAdd6"),ke("Predictor7","PredictorAdd7"),ke("Predictor8","PredictorAdd8"),ke("Predictor9","PredictorAdd9"),ke("Predictor10","PredictorAdd10"),ke("Predictor11","PredictorAdd11"),ke("Predictor12","PredictorAdd12"),ke("Predictor13","PredictorAdd13");var co=L.PredictorAdd2;lt("ColorIndexInverseTransform","MapARGB","32b",function(N){return N>>8&255},function(N){return N}),lt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(N){return N},function(N){return N>>8&255});var Hu,yi=L.ColorIndexInverseTransform,Bi=L.MapARGB,Cs=L.VP8LColorIndexInverseTransformAlpha,Co=L.MapAlpha,bi=L.VP8LPredictorsAdd=[];bi.length=16,(L.VP8LPredictors=[]).length=16,(L.VP8LPredictorsAdd_C=[]).length=16,(L.VP8LPredictors_C=[]).length=16;var Jo,ci,qi,es,Xr,fo,rl,ko,Dr,Lo,Kn,Mr,On,Zn,ts,No,To,Ga,Tn,ho,Ro,Mo,zi,fn,Ei,on,Kr,qn,ti=i(511),Io=i(2041),_l=i(225),nl=i(767),cu=0,jo=Io,Sl=_l,wi=nl,Wa=ti,xl=0,Fo=1,sf=2,El=3,fu=4,hn=5,Vu=6,Pl=7,ks=8,hu=9,du=10,pu=[2,3,7],bc=[3,3,11],il=[280,256,256,256,40],Bf=[0,1,1,1,0],qh=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],qf=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],lf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Gu=8,Ls=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Wu=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Ol=null,uf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],$a=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],wc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],$u=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],zf=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Uf=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],_c=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ui=[],Hi=[],na=[],po=1,gu=2,Vi=[],pa=[];ht("UpsampleRgbLinePair",Or,3),ht("UpsampleBgrLinePair",Nn,3),ht("UpsampleRgbaLinePair",Ua,4),ht("UpsampleBgraLinePair",ui,4),ht("UpsampleArgbLinePair",ei,4),ht("UpsampleRgba4444LinePair",Bn,2),ht("UpsampleRgb565LinePair",Pn,2);var Hf=L.UpsampleRgbLinePair,Vf=L.UpsampleBgrLinePair,Ns=L.UpsampleRgbaLinePair,vu=L.UpsampleBgraLinePair,fi=L.UpsampleArgbLinePair,_i=L.UpsampleRgba4444LinePair,Sc=L.UpsampleRgb565LinePair,rs=16,go=1<<rs-1,en=-227,sn=482,ns=6,Pi=0,ia=i(256),al=i(256),Al=i(256),aa=i(256),mu=i(sn-en),cf=i(sn-en);Pa("YuvToRgbRow",Or,3),Pa("YuvToBgrRow",Nn,3),Pa("YuvToRgbaRow",Ua,4),Pa("YuvToBgraRow",ui,4),Pa("YuvToArgbRow",ei,4),Pa("YuvToRgba4444Row",Bn,2),Pa("YuvToRgb565Row",Pn,2);var Yu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],is=[0,2,8],Gf=[8,7,6,4,4,2,2,2,1,1,1,1],as=1;this.WebPDecodeRGBA=function(N,W,re,oe,ue){var de=Fo,ge=new Xn,me=new xt;ge.ba=me,me.S=de,me.width=[me.width],me.height=[me.height];var we=me.width,Ee=me.height,De=new Jt;if(De==null||N==null)var Xe=2;else r(De!=null),Xe=Ha(N,W,re,De.width,De.height,De.Pd,De.Qd,De.format,null);if(Xe!=0?we=0:(we!=null&&(we[0]=De.width[0]),Ee!=null&&(Ee[0]=De.height[0]),we=1),we){me.width=me.width[0],me.height=me.height[0],oe!=null&&(oe[0]=me.width),ue!=null&&(ue[0]=me.height);e:{if(oe=new Jr,(ue=new mi).data=N,ue.w=W,ue.ha=re,ue.kd=1,W=[0],r(ue!=null),((N=Ha(ue.data,ue.w,ue.ha,null,null,null,W,null,ue))==0||N==7)&&W[0]&&(N=4),(W=N)==0){if(r(ge!=null),oe.data=ue.data,oe.w=ue.w+ue.offset,oe.ha=ue.ha-ue.offset,oe.put=bt,oe.ac=Ze,oe.bc=Vt,oe.ma=ge,ue.xa){if((N=Sn())==null){ge=1;break e}if(function(We,Ge){var _t=[0],ot=[0],Ie=[0];t:for(;;){if(We==null)return 0;if(Ge==null)return We.a=2,0;if(We.l=Ge,We.a=0,B(We.m,Ge.data,Ge.w,Ge.ha),!wt(We.m,_t,ot,Ie)){We.a=3;break t}if(We.xb=gu,Ge.width=_t[0],Ge.height=ot[0],!Ni(_t[0],ot[0],1,We,null))break t;return 1}return r(We.a!=0),0}(N,oe)){if(oe=(W=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){t:{oe=N;r:for(;;){if(oe==null){oe=0;break t}if(r(oe.s.yc!=null),r(oe.s.Ya!=null),r(0<oe.s.Wb),r((re=oe.l)!=null),r((ue=re.ma)!=null),oe.xb!=0){if(oe.ca=ue.ba,oe.tb=ue.tb,r(oe.ca!=null),!Js(ue.Oa,re,El)){oe.a=2;break r}if(!Si(oe,re.width)||re.da)break r;if((re.da||it(oe.ca.S))&&Ke(),11>oe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),oe.ca.f.kb.F!=null&&Ke()),oe.Pb&&0<oe.s.ua&&oe.s.vb.X==null&&!Re(oe.s.vb,oe.s.Wa.Xa)){oe.a=1;break r}oe.xb=0}if(!hr(oe,oe.V,oe.Ba,oe.c,oe.i,re.o,qt))break r;ue.Dc=oe.Ma,oe=1;break t}r(oe.a!=0),oe=0}oe=!oe}oe&&(W=N.a)}else W=N.a}else{if((N=new Nr)==null){ge=1;break e}if(N.Fa=ue.na,N.P=ue.P,N.qc=ue.Sa,Ti(N,oe)){if((W=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){if(N.Aa=0,re=ge.Oa,r((ue=N)!=null),re!=null){if(0<(we=0>(we=re.Md)?0:100<we?255:255*we/100)){for(Ee=De=0;4>Ee;++Ee)12>(Xe=ue.pb[Ee]).lc&&(Xe.ia=we*Gf[0>Xe.lc?0:Xe.lc]>>3),De|=Xe.ia;De&&(alert("todo:VP8InitRandom"),ue.ia=1)}ue.Ga=re.Id,100<ue.Ga?ue.Ga=100:0>ue.Ga&&(ue.Ga=0)}oi(N,oe)||(W=N.a)}}else W=N.a}W==0&&ge.Oa!=null&&ge.Oa.fd&&(W=bl(ge.ba))}ge=W}de=ge!=0?null:11>de?me.f.RGBA.eb:me.f.kb.y}else de=null;return de};var Cl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(L,I){for(var R="",A=0;A<4;A++)R+=String.fromCharCode(L[I++]);return R}function h(L,I){return(L[I+0]<<0|L[I+1]<<8|L[I+2]<<16)>>>0}function v(L,I){return(L[I+0]<<0|L[I+1]<<8|L[I+2]<<16|L[I+3]<<24)>>>0}new u;var g=[0],f=[0],E=[],S=new u,w=e,_=function(L,I){var R={},A=0,O=!1,M=0,q=0;if(R.frames=[],!function(F,Y,J,X){for(var Q=0;Q<X;Q++)if(F[Y+Q]!=J.charCodeAt(Q))return!0;return!1}(L,I,"RIFF",4)){for(v(L,I+=4),I+=8;I<L.length;){var D=c(L,I),te=v(L,I+=4);I+=4;var H=te+(1&te);switch(D){case"VP8 ":case"VP8L":R.frames[A]===void 0&&(R.frames[A]={}),(V=R.frames[A]).src_off=O?q:I-8,V.src_size=M+te+8,A++,O&&(O=!1,M=0,q=0);break;case"VP8X":(V=R.header={}).feature_flags=L[I];var B=I+4;V.canvas_width=1+h(L,B),B+=3,V.canvas_height=1+h(L,B),B+=3;break;case"ALPH":O=!0,M=H+8,q=I-8;break;case"ANIM":(V=R.header).bgcolor=v(L,I),B=I+4,V.loop_count=(j=L)[(z=B)+0]<<0|j[z+1]<<8,B+=2;break;case"ANMF":var $,V;(V=R.frames[A]={}).offset_x=2*h(L,I),I+=3,V.offset_y=2*h(L,I),I+=3,V.width=1+h(L,I),I+=3,V.height=1+h(L,I),I+=3,V.duration=h(L,I),I+=3,$=L[I++],V.dispose=1&$,V.blend=$>>1&1}D!="ANMF"&&(I+=H)}var j,z;return R}}(w,0);_.response=w,_.rgbaoutput=!0,_.dataurl=!1;var y=_.header?_.header:null,p=_.frames?_.frames:null;if(y){y.loop_counter=y.loop_count,g=[y.canvas_height],f=[y.canvas_width];for(var m=0;m<p.length&&p[m].blend!=0;m++);}var P=p[0],T=S.WebPDecodeRGBA(w,P.src_off,P.src_size,f,g);P.rgba=T,P.imgwidth=f[0],P.imgheight=g[0];for(var k=0;k<f[0]*g[0]*4;k++)E[k]=T[k];return this.width=f,this.height=g,this.data=E,this}(function(e){var r=function(){return typeof R2=="function"},t=function(g,f,E,S){var w=4,_=o;switch(S){case e.image_compression.FAST:w=1,_=i;break;case e.image_compression.MEDIUM:w=6,_=s;break;case e.image_compression.SLOW:w=9,_=u}g=n(g,f,E,_);var y=R2(g,{level:w});return e.__addimage__.arrayBufferToBinaryString(y)},n=function(g,f,E,S){for(var w,_,y,p=g.length/f,m=new Uint8Array(g.length+p),P=h(),T=0;T<p;T+=1){if(y=T*f,w=g.subarray(y,y+f),S)m.set(S(w,E,_),y+T);else{for(var k,L=P.length,I=[];k<L;k+=1)I[k]=P[k](w,E,_);var R=v(I.concat());m.set(I[R],y+T)}_=w}return m},a=function(g){var f=Array.apply([],g);return f.unshift(0),f},i=function(g,f){var E,S=[],w=g.length;S[0]=1;for(var _=0;_<w;_+=1)E=g[_-f]||0,S[_+1]=g[_]-E+256&255;return S},o=function(g,f,E){var S,w=[],_=g.length;w[0]=2;for(var y=0;y<_;y+=1)S=E&&E[y]||0,w[y+1]=g[y]-S+256&255;return w},s=function(g,f,E){var S,w,_=[],y=g.length;_[0]=3;for(var p=0;p<y;p+=1)S=g[p-f]||0,w=E&&E[p]||0,_[p+1]=g[p]+256-(S+w>>>1)&255;return _},u=function(g,f,E){var S,w,_,y,p=[],m=g.length;p[0]=4;for(var P=0;P<m;P+=1)S=g[P-f]||0,w=E&&E[P]||0,_=E&&E[P-f]||0,y=c(S,w,_),p[P+1]=g[P]-y+256&255;return p},c=function(g,f,E){if(g===f&&f===E)return g;var S=Math.abs(f-E),w=Math.abs(g-E),_=Math.abs(g+f-E-E);return S<=w&&S<=_?g:w<=_?f:E},h=function(){return[a,i,o,s,u]},v=function(g){var f=g.map(function(E){return E.reduce(function(S,w){return S+Math.abs(w)},0)});return f.indexOf(Math.min.apply(null,f))};e.processPNG=function(g,f,E,S){var w,_,y,p,m,P,T,k,L,I,R,A,O,M,q,D=this.decode.FLATE_DECODE,te="";if(this.__addimage__.isArrayBuffer(g)&&(g=new Uint8Array(g)),this.__addimage__.isArrayBufferView(g)){if(g=(y=new sL(g)).imgData,_=y.bits,w=y.colorSpace,m=y.colors,[4,6].indexOf(y.colorType)!==-1){if(y.bits===8){L=(k=y.pixelBitlength==32?new Uint32Array(y.decodePixels().buffer):y.pixelBitlength==16?new Uint16Array(y.decodePixels().buffer):new Uint8Array(y.decodePixels().buffer)).length,R=new Uint8Array(L*y.colors),I=new Uint8Array(L);var H,B=y.pixelBitlength-y.bits;for(M=0,q=0;M<L;M++){for(O=k[M],H=0;H<B;)R[q++]=O>>>H&255,H+=y.bits;I[M]=O>>>H&255}}if(y.bits===16){L=(k=new Uint32Array(y.decodePixels().buffer)).length,R=new Uint8Array(L*(32/y.pixelBitlength)*y.colors),I=new Uint8Array(L*(32/y.pixelBitlength)),A=y.colors>1,M=0,q=0;for(var $=0;M<L;)O=k[M++],R[q++]=O>>>0&255,A&&(R[q++]=O>>>16&255,O=k[M++],R[q++]=O>>>0&255),I[$++]=O>>>16&255;_=8}S!==e.image_compression.NONE&&r()?(g=t(R,y.width*y.colors,y.colors,S),T=t(I,y.width,1,S)):(g=R,T=I,D=void 0)}if(y.colorType===3&&(w=this.color_spaces.INDEXED,P=y.palette,y.transparency.indexed)){var V=y.transparency.indexed,j=0;for(M=0,L=V.length;M<L;++M)j+=V[M];if((j/=255)===L-1&&V.indexOf(0)!==-1)p=[V.indexOf(0)];else if(j!==L){for(k=y.decodePixels(),I=new Uint8Array(k.length),M=0,L=k.length;M<L;M++)I[M]=V[k[M]];T=t(I,y.width,1)}}var z=function(F){var Y;switch(F){case e.image_compression.FAST:Y=11;break;case e.image_compression.MEDIUM:Y=13;break;case e.image_compression.SLOW:Y=14;break;default:Y=12}return Y}(S);return D===this.decode.FLATE_DECODE&&(te="/Predictor "+z+" "),te+="/Colors "+m+" /BitsPerComponent "+_+" /Columns "+y.width,(this.__addimage__.isArrayBuffer(g)||this.__addimage__.isArrayBufferView(g))&&(g=this.__addimage__.arrayBufferToBinaryString(g)),(T&&this.__addimage__.isArrayBuffer(T)||this.__addimage__.isArrayBufferView(T))&&(T=this.__addimage__.arrayBufferToBinaryString(T)),{alias:E,data:g,index:f,filter:D,decodeParameters:te,transparency:p,palette:P,sMask:T,predictor:z,width:y.width,height:y.height,bitsPerComponent:_,colorSpace:w}}}})(vr.API),function(e){e.processGIF89A=function(r,t,n,a){var i=new lL(r),o=i.width,s=i.height,u=[];i.decodeAndBlitFrameRGBA(0,u);var c={data:u,width:o,height:s},h=new h2(100).encode(c,100);return e.processJPEG.call(this,h,t,n,a)},e.processGIF87A=e.processGIF89A}(vr.API),Hl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var r=0;r<e;r++){var t=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[r]={red:a,green:n,blue:t,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Hl.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,r=this.width*this.height*4;this.data=new Uint8Array(r),this[e]()}catch(t){Yn.log("bit decode error:"+t)}},Hl.prototype.bit1=function(){var e,r=Math.ceil(this.width/8),t=r%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,a=0;a<r;a++)for(var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*a*4,s=0;s<8&&8*a+s<this.width;s++){var u=this.palette[i>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}t!==0&&(this.pos+=4-t)}},Hl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),r=e%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<e;a++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*a*4,s=i>>4,u=15&i,c=this.palette[s];if(this.data[o]=c.blue,this.data[o+1]=c.green,this.data[o+2]=c.red,this.data[o+3]=255,2*a+1>=this.width)break;c=this.palette[u],this.data[o+4]=c.blue,this.data[o+4+1]=c.green,this.data[o+4+2]=c.red,this.data[o+4+3]=255}r!==0&&(this.pos+=4-r)}},Hl.prototype.bit8=function(){for(var e=this.width%4,r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),i=t*this.width*4+4*n;if(a<this.palette.length){var o=this.palette[a];this.data[i]=o.red,this.data[i+1]=o.green,this.data[i+2]=o.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}e!==0&&(this.pos+=4-e)}},Hl.prototype.bit15=function(){for(var e=this.width%3,r=parseInt("11111",2),t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(i&r)/r*255|0,s=(i>>5&r)/r*255|0,u=(i>>10&r)/r*255|0,c=i>>15?255:0,h=n*this.width*4+4*a;this.data[h]=u,this.data[h+1]=s,this.data[h+2]=o,this.data[h+3]=c}this.pos+=e}},Hl.prototype.bit16=function(){for(var e=this.width%3,r=parseInt("11111",2),t=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&r)/r*255|0,u=(o>>5&t)/t*255|0,c=(o>>11)/r*255|0,h=a*this.width*4+4*i;this.data[h]=c,this.data[h+1]=u,this.data[h+2]=s,this.data[h+3]=255}this.pos+=e}},Hl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+4*t;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Hl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+4*t;this.data[s]=i,this.data[s+1]=a,this.data[s+2]=n,this.data[s+3]=o}},Hl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(r,t,n,a){var i=new Hl(r,!1),o=i.width,s=i.height,u={data:i.getData(),width:o,height:s},c=new h2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(vr.API),pw.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(r,t,n,a){var i=new pw(r),o=i.width,s=i.height,u={data:i.getData(),width:o,height:s},c=new h2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(vr.API),vr.API.processRGBA=function(e,r,t){for(var n=e.data,a=n.length,i=new Uint8Array(a/4*3),o=new Uint8Array(a/4),s=0,u=0,c=0;c<a;c+=4){var h=n[c],v=n[c+1],g=n[c+2],f=n[c+3];i[s++]=h,i[s++]=v,i[s++]=g,o[u++]=f}var E=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:E,index:r,alias:t,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},vr.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},ah=vr.API,p1=ah.getCharWidthsArray=function(e,r){var t,n,a=(r=r||{}).font||this.internal.getFont(),i=r.fontSize||this.internal.getFontSize(),o=r.charSpace||this.internal.getCharSpace(),s=r.widths?r.widths:a.metadata.Unicode.widths,u=s.fof?s.fof:1,c=r.kerning?r.kerning:a.metadata.Unicode.kerning,h=c.fof?c.fof:1,v=r.doKerning!==!1,g=0,f=e.length,E=0,S=s[0]||u,w=[];for(t=0;t<f;t++)n=e.charCodeAt(t),typeof a.metadata.widthOfString=="function"?w.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(n))+o*(1e3/i)||0)/1e3):(g=v&&kn(c[n])==="object"&&!isNaN(parseInt(c[n][E],10))?c[n][E]/h:0,w.push((s[n]||S)/u+g)),E=n;return w},cw=ah.getStringUnitWidth=function(e,r){var t=(r=r||{}).fontSize||this.internal.getFontSize(),n=r.font||this.internal.getFont(),a=r.charSpace||this.internal.getCharSpace();return ah.processArabic&&(e=ah.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,t,a)/t:p1.apply(this,arguments).reduce(function(i,o){return i+o},0)},fw=function(e,r,t,n){for(var a=[],i=0,o=e.length,s=0;i!==o&&s+r[i]<t;)s+=r[i],i++;a.push(e.slice(0,i));var u=i;for(s=0;i!==o;)s+r[i]>n&&(a.push(e.slice(u,i)),s=0,u=i),s+=r[i],i++;return u!==i&&a.push(e.slice(u,i)),a},hw=function(e,r,t){t||(t={});var n,a,i,o,s,u,c,h=[],v=[h],g=t.textIndent||0,f=0,E=0,S=e.split(" "),w=p1.apply(this,[" ",t])[0];if(u=t.lineIndent===-1?S[0].length+2:t.lineIndent||0){var _=Array(u).join(" "),y=[];S.map(function(m){(m=m.split(/\s*\n/)).length>1?y=y.concat(m.map(function(P,T){return(T&&P.length?`
|
|
597
|
+
`:"")+P})):y.push(m[0])}),S=y,u=cw.apply(this,[_,t])}for(i=0,o=S.length;i<o;i++){var p=0;if(n=S[i],u&&n[0]==`
|
|
598
|
+
`&&(n=n.substr(1),p=1),g+f+(E=(a=p1.apply(this,[n,t])).reduce(function(m,P){return m+P},0))>r||p){if(E>r){for(s=fw.apply(this,[n,a,r-(g+f),r]),h.push(s.shift()),h=[s.pop()];s.length;)v.push([s.shift()]);E=a.slice(n.length-(h[0]?h[0].length:0)).reduce(function(m,P){return m+P},0)}else h=[n];v.push(h),g=E+u,f=w}else h.push(n),g+=f+E,f=w}return c=u?function(m,P){return(P?_:"")+m.join(" ")}:function(m){return m.join(" ")},v.map(c)},ah.splitTextToSize=function(e,r,t){var n,a=(t=t||{}).fontSize||this.internal.getFontSize(),i=(function(h){if(h.widths&&h.kerning)return{widths:h.widths,kerning:h.kerning};var v=this.internal.getFont(h.fontName,h.fontStyle);return v.metadata.Unicode?{widths:v.metadata.Unicode.widths||{0:1},kerning:v.metadata.Unicode.kerning||{}}:{font:v.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*r/a;i.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=t.lineIndent;var s,u,c=[];for(s=0,u=n.length;s<u;s++)c=c.concat(hw.apply(this,[n[s],o,i]));return c},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var r="klmnopqrstuvwxyz",t={},n={},a=0;a<r.length;a++)t[r[a]]="0123456789abcdef"[a],n["0123456789abcdef"[a]]=r[a];var i=function(v){return"0x"+parseInt(v,10).toString(16)},o=e.__fontmetrics__.compress=function(v){var g,f,E,S,w=["{"];for(var _ in v){if(g=v[_],isNaN(parseInt(_,10))?f="'"+_+"'":(_=parseInt(_,10),f=(f=i(_).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof g=="number")g<0?(E=i(g).slice(3),S="-"):(E=i(g).slice(2),S=""),E=S+E.slice(0,-1)+n[E.slice(-1)];else{if(kn(g)!=="object")throw new Error("Don't know what to do with value type "+kn(g)+".");E=o(g)}w.push(f+E)}return w.push("}"),w.join("")},s=e.__fontmetrics__.uncompress=function(v){if(typeof v!="string")throw new Error("Invalid argument passed to uncompress.");for(var g,f,E,S,w={},_=1,y=w,p=[],m="",P="",T=v.length-1,k=1;k<T;k+=1)(S=v[k])=="'"?g?(E=g.join(""),g=void 0):g=[]:g?g.push(S):S=="{"?(p.push([y,E]),y={},E=void 0):S=="}"?((f=p.pop())[0][f[1]]=y,E=void 0,y=f[0]):S=="-"?_=-1:E===void 0?t.hasOwnProperty(S)?(m+=t[S],E=parseInt(m,16)*_,_=1,m=""):m+=S:t.hasOwnProperty(S)?(P+=t[S],y[E]=parseInt(P,16)*_,_=1,E=void 0,P=""):P+=S;return w},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},c={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":s("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(v){var g=v.font,f=h.Unicode[g.postScriptName];f&&(g.metadata.Unicode={},g.metadata.Unicode.widths=f.widths,g.metadata.Unicode.kerning=f.kerning);var E=c.Unicode[g.postScriptName];E&&(g.metadata.Unicode.encoding=E,g.encoding=E.codePages[0])}])}(vr.API),function(e){var r=function(t){for(var n=t.length,a=new Uint8Array(n),i=0;i<n;i++)a[i]=t.charCodeAt(i);return a};e.API.events.push(["addFont",function(t){var n=void 0,a=t.font,i=t.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(n=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?r(s):r(cp(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,n)}}])}(vr),function(e){function r(){return(yr.canvg?Promise.resolve(yr.canvg):C2(()=>import("./index.es-DBuDDb35.js"),[],import.meta.url)).catch(function(t){return Promise.reject(new Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t})}vr.API.addSvgAsImage=function(t,n,a,i,o,s,u,c){if(isNaN(n)||isNaN(a))throw Yn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Yn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var v=h.getContext("2d");v.fillStyle="#fff",v.fillRect(0,0,h.width,h.height);var g={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return r().then(function(E){return E.fromString(v,t,g)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(E){return E.render(g)}).then(function(){f.addImage(h.toDataURL("image/jpeg",1),n,a,i,o,u,c)})}}(),vr.API.putTotalPages=function(e){var r,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(r=new RegExp(e,"g"),t=this.internal.getNumberOfPages()):(r=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var a=0;a<this.internal.pages[n].length;a++)this.internal.pages[n][a]=this.internal.pages[n][a].replace(r,t);return this},vr.API.viewerPreferences=function(e,r){var t;e=e||{},r=r||!1;var n,a,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),u=[],c=0,h=0,v=0;function g(E,S){var w,_=!1;for(w=0;w<E.length;w+=1)E[w]===S&&(_=!0);return _}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),t=this.internal.viewerpreferences.configuration,e==="reset"||r===!0){var f=s.length;for(v=0;v<f;v+=1)t[s[v]].value=t[s[v]].defaultValue,t[s[v]].explicitSet=!1}if(kn(e)==="object"){for(a in e)if(i=e[a],g(s,a)&&i!==void 0){if(t[a].type==="boolean"&&typeof i=="boolean")t[a].value=i;else if(t[a].type==="name"&&g(t[a].valueSet,i))t[a].value=i;else if(t[a].type==="integer"&&Number.isInteger(i))t[a].value=i;else if(t[a].type==="array"){for(c=0;c<i.length;c+=1)if(n=!0,i[c].length===1&&typeof i[c][0]=="number")u.push(String(i[c]-1));else if(i[c].length>1){for(h=0;h<i[c].length;h+=1)typeof i[c][h]!="number"&&(n=!1);n===!0&&u.push([i[c][0]-1,i[c][1]-1].join(" "))}t[a].value="["+u.join(" ")+"]"}else t[a].value=t[a].defaultValue;t[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var E,S=[];for(E in t)t[E].explicitSet===!0&&(t[E].type==="name"?S.push("/"+E+" /"+t[E].value):S.push("/"+E+" "+t[E].value));S.length!==0&&this.internal.write(`/ViewerPreferences
|
|
599
|
+
<<
|
|
600
|
+
`+S.join(`
|
|
601
|
+
`)+`
|
|
602
|
+
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},function(e){var r=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),i=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),c=i.length+o.length+s.length+a.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+c+" >>"),this.internal.write("stream"),this.internal.write(a+i+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},t=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(n,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",t),this.internal.events.subscribe("postPutResources",r)),this}}(vr.API),function(e){var r=e.API,t=r.pdfEscape16=function(i,o){for(var s,u=o.metadata.Unicode.widths,c=["","0","00","000","0000"],h=[""],v=0,g=i.length;v<g;++v){if(s=o.metadata.characterToGlyph(i.charCodeAt(v)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=i.charCodeAt(v),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return h.join("");s=s.toString(16),h.push(c[4-s.length],s)}return h.join("")},n=function(i){var o,s,u,c,h,v,g;for(h=`/CIDInit /ProcSet findresource begin
|
|
603
|
+
12 dict begin
|
|
604
|
+
begincmap
|
|
605
|
+
/CIDSystemInfo <<
|
|
606
|
+
/Registry (Adobe)
|
|
607
|
+
/Ordering (UCS)
|
|
608
|
+
/Supplement 0
|
|
609
|
+
>> def
|
|
610
|
+
/CMapName /Adobe-Identity-UCS def
|
|
611
|
+
/CMapType 2 def
|
|
612
|
+
1 begincodespacerange
|
|
613
|
+
<0000><ffff>
|
|
614
|
+
endcodespacerange`,u=[],v=0,g=(s=Object.keys(i).sort(function(f,E){return f-E})).length;v<g;v++)o=s[v],u.length>=100&&(h+=`
|
|
615
|
+
`+u.length+` beginbfchar
|
|
616
|
+
`+u.join(`
|
|
617
|
+
`)+`
|
|
618
|
+
endbfchar`,u=[]),i[o]!==void 0&&i[o]!==null&&typeof i[o].toString=="function"&&(c=("0000"+i[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+c+">"));return u.length&&(h+=`
|
|
619
|
+
`+u.length+` beginbfchar
|
|
620
|
+
`+u.join(`
|
|
621
|
+
`)+`
|
|
622
|
+
endbfchar
|
|
623
|
+
`),h+=`endcmap
|
|
624
|
+
CMapName currentdict /CMap defineresource pop
|
|
625
|
+
end
|
|
626
|
+
end`};r.events.push(["putFont",function(i){(function(o){var s=o.font,u=o.out,c=o.newObject,h=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="Identity-H"){for(var v=s.metadata.Unicode.widths,g=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),f="",E=0;E<g.length;E++)f+=String.fromCharCode(g[E]);var S=c();h({data:f,addLength1:!0,objectId:S}),u("endobj");var w=c();h({data:n(s.metadata.toUnicode),addLength1:!0,objectId:w}),u("endobj");var _=c();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+uh(s.fontName)),u("/FontFile2 "+S+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var y=c();u("<<"),u("/Type /Font"),u("/BaseFont /"+uh(s.fontName)),u("/FontDescriptor "+_+" 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 ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=c(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+w+" 0 R"),u("/BaseFont /"+uh(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+y+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(i)}]),r.events.push(["putFont",function(i){(function(o){var s=o.font,u=o.out,c=o.newObject,h=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var v=s.metadata.rawData,g="",f=0;f<v.length;f++)g+=String.fromCharCode(v[f]);var E=c();h({data:g,addLength1:!0,objectId:E}),u("endobj");var S=c();h({data:n(s.metadata.toUnicode),addLength1:!0,objectId:S}),u("endobj");var w=c();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+E+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+uh(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=c();for(var _=0;_<s.metadata.hmtx.widths.length;_++)s.metadata.hmtx.widths[_]=parseInt(s.metadata.hmtx.widths[_]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+S+" 0 R/BaseFont/"+uh(s.fontName)+"/FontDescriptor "+w+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,s=i.text||"",u=i.x,c=i.y,h=i.options||{},v=i.mutex||{},g=v.pdfEscape,f=v.activeFontKey,E=v.fonts,S=f,w="",_=0,y="",p=E[S].encoding;if(E[S].encoding!=="Identity-H")return{text:s,x:u,y:c,options:h,mutex:v};for(y=s,S=f,Array.isArray(s)&&(y=s[0]),_=0;_<y.length;_+=1)E[S].metadata.hasOwnProperty("cmap")&&(o=E[S].metadata.cmap.unicode.codeMap[y[_].charCodeAt(0)]),o||y[_].charCodeAt(0)<256&&E[S].metadata.hasOwnProperty("Unicode")?w+=y[_]:w+="";var m="";return parseInt(S.slice(1))<14||p==="WinAnsiEncoding"?m=g(w,S).split("").map(function(P){return P.charCodeAt(0).toString(16)}).join(""):p==="Identity-H"&&(m=t(w,E[S])),v.isHex=!0,{text:m,x:u,y:c,options:h,mutex:v}};r.events.push(["postProcessText",function(i){var o=i.text||"",s=[],u={text:o,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(o)){var c=0;for(c=0;c<o.length;c+=1)Array.isArray(o[c])&&o[c].length===3?s.push([a(Object.assign({},u,{text:o[c][0]})).text,o[c][1],o[c][2]]):s.push(a(Object.assign({},u,{text:o[c]})).text);i.text=s}else i.text=a(Object.assign({},u,{text:o})).text}])}(vr),function(e){var r=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0},e.addFileToVFS=function(t,n){return r.call(this),this.internal.vFS[t]=n,this},e.getFileFromVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0?this.internal.vFS[t]:null}}(vr.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var a,i,o,s,u,c,h,v=r,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]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],E={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},S={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},w=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],_=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)$/),y=!1,p=0;this.__bidiEngine__={};var m=function(A){var O=A.charCodeAt(),M=O>>8,q=S[M];return q!==void 0?v[256*q+(255&O)]:M===252||M===253?"AL":_.test(M)?"L":M===8?"R":"N"},P=function(A){for(var O,M=0;M<A.length;M++){if((O=m(A.charAt(M)))==="L")return!1;if(O==="R")return!0}return!1},T=function(A,O,M,q){var D,te,H,B,$=O[q];switch($){case"L":case"R":y=!1;break;case"N":case"AN":break;case"EN":y&&($="AN");break;case"AL":y=!0,$="R";break;case"WS":$="N";break;case"CS":q<1||q+1>=O.length||(D=M[q-1])!=="EN"&&D!=="AN"||(te=O[q+1])!=="EN"&&te!=="AN"?$="N":y&&(te="AN"),$=te===D?te:"N";break;case"ES":$=(D=q>0?M[q-1]:"B")==="EN"&&q+1<O.length&&O[q+1]==="EN"?"EN":"N";break;case"ET":if(q>0&&M[q-1]==="EN"){$="EN";break}if(y){$="N";break}for(H=q+1,B=O.length;H<B&&O[H]==="ET";)H++;$=H<B&&O[H]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(B=O.length,H=q+1;H<B&&O[H]==="NSM";)H++;if(H<B){var V=A[q],j=V>=1425&&V<=2303||V===64286;if(D=O[H],j&&(D==="R"||D==="AL")){$="R";break}}}$=q<1||(D=O[q-1])==="B"?"N":M[q-1];break;case"B":y=!1,a=!0,$=p;break;case"S":i=!0,$="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":y=!1;break;case"BN":$="N"}return $},k=function(A,O,M){var q=A.split("");return M&&L(q,M,{hiLevel:p}),q.reverse(),O&&O.reverse(),q.join("")},L=function(A,O,M){var q,D,te,H,B,$=-1,V=A.length,j=0,z=[],F=p?f:g,Y=[];for(y=!1,a=!1,i=!1,D=0;D<V;D++)Y[D]=m(A[D]);for(te=0;te<V;te++){if(B=j,z[te]=T(A,Y,z,te),q=240&(j=F[B][E[z[te]]]),j&=15,O[te]=H=F[j][5],q>0)if(q===16){for(D=$;D<te;D++)O[D]=1;$=-1}else $=-1;if(F[j][6])$===-1&&($=te);else if($>-1){for(D=$;D<te;D++)O[D]=H;$=-1}Y[te]==="B"&&(O[te]=0),M.hiLevel|=H}i&&function(J,X,Q){for(var ae=0;ae<Q;ae++)if(J[ae]==="S"){X[ae]=p;for(var se=ae-1;se>=0&&J[se]==="WS";se--)X[se]=p}}(Y,O,V)},I=function(A,O,M,q,D){if(!(D.hiLevel<A)){if(A===1&&p===1&&!a)return O.reverse(),void(M&&M.reverse());for(var te,H,B,$,V=O.length,j=0;j<V;){if(q[j]>=A){for(B=j+1;B<V&&q[B]>=A;)B++;for($=j,H=B-1;$<H;$++,H--)te=O[$],O[$]=O[H],O[H]=te,M&&(te=M[$],M[$]=M[H],M[H]=te);j=B}j++}}},R=function(A,O,M){var q=A.split(""),D={hiLevel:p};return M||(M=[]),L(q,M,D),function(te,H,B){if(B.hiLevel!==0&&h)for(var $,V=0;V<te.length;V++)H[V]===1&&($=w.indexOf(te[V]))>=0&&(te[V]=w[$+1])}(q,M,D),I(2,q,O,M,D),I(1,q,O,M,D),q.join("")};return this.__bidiEngine__.doBidiReorder=function(A,O,M){if(function(D,te){if(te)for(var H=0;H<D.length;H++)te[H]=H;s===void 0&&(s=P(D)),c===void 0&&(c=P(D))}(A,O),o||!u||c)if(o&&u&&s^c)p=s?1:0,A=k(A,O,M);else if(!o&&u&&c)p=s?1:0,A=R(A,O,M),A=k(A,O);else if(!o||s||u||c){if(o&&!u&&s^c)A=k(A,O),s?(p=0,A=R(A,O,M)):(p=1,A=R(A,O,M),A=k(A,O));else if(o&&s&&!u&&c)p=1,A=R(A,O,M),A=k(A,O);else if(!o&&!u&&s^c){var q=h;s?(p=1,A=R(A,O,M),p=0,h=!1,A=R(A,O,M),h=q):(p=0,A=R(A,O,M),A=k(A,O),p=1,h=!1,A=R(A,O,M),h=q,A=k(A,O))}}else p=0,A=R(A,O,M);else p=s?1:0,A=R(A,O,M);return A},this.__bidiEngine__.setOptions=function(A){A&&(o=A.isInputVisual,u=A.isOutputVisual,s=A.isInputRtl,c=A.isOutputRtl,h=A.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var r=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],t=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var a=n.text;n.x,n.y;var i=n.options||{};n.mutex,i.lang;var o=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,t.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var s=0;for(o=[],s=0;s<a.length;s+=1)Object.prototype.toString.call(a[s])==="[object Array]"?o.push([t.doBidiReorder(a[s][0]),a[s][1],a[s][2]]):o.push([t.doBidiReorder(a[s])]);n.text=o}else n.text=t.doBidiReorder(a);t.setOptions({isInputVisual:!0})}])}(vr),vr.API.TTFFont=function(){function e(r){var t;if(this.rawData=r,t=this.contents=new Kc(r),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new xL(this),this.registerTTF()}return e.open=function(r){return new e(r)},e.prototype.parse=function(){return this.directory=new uL(this.contents),this.head=new fL(this),this.name=new vL(this),this.cmap=new I_(this),this.toUnicode={},this.hhea=new hL(this),this.maxp=new mL(this),this.hmtx=new yL(this),this.post=new pL(this),this.os2=new dL(this),this.loca=new SL(this),this.glyf=new bL(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var r,t,n,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,c;for(c=[],o=0,s=(u=this.bbox).length;o<s;o++)r=u[o],c.push(Math.round(r*this.scaleFactor));return c}).call(this),this.stemV=0,this.post.exists?(n=255&(a=this.post.italic_angle),(32768&(t=a>>16))!=0&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(r){var t;return((t=this.cmap.unicode)!=null?t.codeMap[r]:void 0)||0},e.prototype.widthOfGlyph=function(r){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(r).advance*t},e.prototype.widthOfString=function(r,t,n){var a,i,o,s;for(o=0,i=0,s=(r=""+r).length;0<=s?i<s:i>s;i=0<=s?++i:--i)a=r.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(a))+n*(1e3/t)||0;return o*(t/1e3)},e.prototype.lineHeight=function(r,t){var n;return t==null&&(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*r},e}();var eu,Kc=function(){function e(r){this.data=r??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(r){return this.data[this.pos++]=r},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(r){return this.writeByte(r>>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt32=function(){var r;return(r=this.readUInt32())>=2147483648?r-4294967296:r},e.prototype.writeInt32=function(r){return r<0&&(r+=4294967296),this.writeUInt32(r)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(r){return this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt16=function(){var r;return(r=this.readUInt16())>=32768?r-65536:r},e.prototype.writeInt16=function(r){return r<0&&(r+=65536),this.writeUInt16(r)},e.prototype.readString=function(r){var t,n;for(n=[],t=0;0<=r?t<r:t>r;t=0<=r?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(r){var t,n,a;for(a=[],t=0,n=r.length;0<=n?t<n:t>n;t=0<=n?++t:--t)a.push(this.writeByte(r.charCodeAt(t)));return a},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(r){return this.writeInt16(r)},e.prototype.readLongLong=function(){var r,t,n,a,i,o,s,u;return r=this.readByte(),t=this.readByte(),n=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&r?-1*(72057594037927940*(255^r)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^a)+16777216*(255^i)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*r+281474976710656*t+1099511627776*n+4294967296*a+16777216*i+65536*o+256*s+u},e.prototype.writeLongLong=function(r){var t,n;return t=Math.floor(r/4294967296),n=4294967295&r,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(r){return this.writeInt32(r)},e.prototype.read=function(r){var t,n;for(t=[],n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(r){var t,n,a,i;for(i=[],n=0,a=r.length;n<a;n++)t=r[n],i.push(this.writeByte(t));return i},e}(),uL=function(){var e;function r(t){var n,a,i;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)n={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[n.tag]=n}return r.prototype.encode=function(t){var n,a,i,o,s,u,c,h,v,g,f,E,S;for(S in f=Object.keys(t).length,u=Math.log(2),v=16*Math.floor(Math.log(f)/u),o=Math.floor(v/u),h=16*f-v,(a=new Kc).writeInt(this.scalarType),a.writeShort(f),a.writeShort(v),a.writeShort(o),a.writeShort(h),i=16*f,c=a.pos+i,s=null,E=[],t)for(g=t[S],a.writeString(S),a.writeInt(e(g)),a.writeInt(c),a.writeInt(g.length),E=E.concat(g),S==="head"&&(s=c),c+=g.length;c%4;)E.push(0),c++;return a.write(E),n=2981146554-e(a.data),a.pos=s+8,a.writeUInt32(n),a.data},e=function(t){var n,a,i,o;for(t=j_.call(t);t.length%4;)t.push(0);for(i=new Kc(t),a=0,n=0,o=t.length;n<o;n=n+=4)a+=i.readUInt32();return 4294967295&a},r}(),cL={}.hasOwnProperty,Du=function(e,r){for(var t in r)cL.call(r,t)&&(e[t]=r[t]);function n(){this.constructor=e}return n.prototype=r.prototype,e.prototype=new n,e.__super__=r.prototype,e};eu=function(){function e(r){var t;this.file=r,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var fL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="head",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},r.prototype.encode=function(t){var n;return(n=new Kc).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},r}(),gw=function(){function e(r,t){var n,a,i,o,s,u,c,h,v,g,f,E,S,w,_,y,p;switch(this.platformID=r.readUInt16(),this.encodingID=r.readShort(),this.offset=t+r.readInt(),v=r.pos,r.pos=this.offset,this.format=r.readUInt16(),this.length=r.readUInt16(),this.language=r.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=r.readByte();break;case 4:for(f=r.readUInt16(),g=f/2,r.pos+=6,i=function(){var m,P;for(P=[],u=m=0;0<=g?m<g:m>g;u=0<=g?++m:--m)P.push(r.readUInt16());return P}(),r.pos+=2,S=function(){var m,P;for(P=[],u=m=0;0<=g?m<g:m>g;u=0<=g?++m:--m)P.push(r.readUInt16());return P}(),c=function(){var m,P;for(P=[],u=m=0;0<=g?m<g:m>g;u=0<=g?++m:--m)P.push(r.readUInt16());return P}(),h=function(){var m,P;for(P=[],u=m=0;0<=g?m<g:m>g;u=0<=g?++m:--m)P.push(r.readUInt16());return P}(),a=(this.length-r.pos+this.offset)/2,s=function(){var m,P;for(P=[],u=m=0;0<=a?m<a:m>a;u=0<=a?++m:--m)P.push(r.readUInt16());return P}(),u=_=0,p=i.length;_<p;u=++_)for(w=i[u],n=y=E=S[u];E<=w?y<=w:y>=w;n=E<=w?++y:--y)h[u]===0?o=n+c[u]:(o=s[h[u]/2+(n-E)-(g-u)]||0)!==0&&(o+=c[u]),this.codeMap[n]=65535&o}r.pos=v}return e.encode=function(r,t){var n,a,i,o,s,u,c,h,v,g,f,E,S,w,_,y,p,m,P,T,k,L,I,R,A,O,M,q,D,te,H,B,$,V,j,z,F,Y,J,X,Q,ae,se,fe,be,_e;switch(q=new Kc,o=Object.keys(r).sort(function(Ae,Re){return Ae-Re}),t){case"macroman":for(S=0,w=function(){var Ae=[];for(E=0;E<256;++E)Ae.push(0);return Ae}(),y={0:0},i={},D=0,$=o.length;D<$;D++)y[se=r[a=o[D]]]==null&&(y[se]=++S),i[a]={old:r[a],new:y[r[a]]},w[a]=y[r[a]];return q.writeUInt16(1),q.writeUInt16(0),q.writeUInt32(12),q.writeUInt16(0),q.writeUInt16(262),q.writeUInt16(0),q.write(w),{charMap:i,subtable:q.data,maxGlyphID:S+1};case"unicode":for(O=[],v=[],p=0,y={},n={},_=c=null,te=0,V=o.length;te<V;te++)y[P=r[a=o[te]]]==null&&(y[P]=++p),n[a]={old:P,new:y[P]},s=y[P]-a,_!=null&&s===c||(_&&v.push(_),O.push(a),c=s),_=a;for(_&&v.push(_),v.push(65535),O.push(65535),R=2*(I=O.length),L=2*Math.pow(Math.log(I)/Math.LN2,2),g=Math.log(L/2)/Math.LN2,k=2*I-L,u=[],T=[],f=[],E=H=0,j=O.length;H<j;E=++H){if(A=O[E],h=v[E],A===65535){u.push(0),T.push(0);break}if(A-(M=n[A].new)>=32768)for(u.push(0),T.push(2*(f.length+I-E)),a=B=A;A<=h?B<=h:B>=h;a=A<=h?++B:--B)f.push(n[a].new);else u.push(M-A),T.push(0)}for(q.writeUInt16(3),q.writeUInt16(1),q.writeUInt32(12),q.writeUInt16(4),q.writeUInt16(16+8*I+2*f.length),q.writeUInt16(0),q.writeUInt16(R),q.writeUInt16(L),q.writeUInt16(g),q.writeUInt16(k),Q=0,z=v.length;Q<z;Q++)a=v[Q],q.writeUInt16(a);for(q.writeUInt16(0),ae=0,F=O.length;ae<F;ae++)a=O[ae],q.writeUInt16(a);for(fe=0,Y=u.length;fe<Y;fe++)s=u[fe],q.writeUInt16(s);for(be=0,J=T.length;be<J;be++)m=T[be],q.writeUInt16(m);for(_e=0,X=f.length;_e<X;_e++)S=f[_e],q.writeUInt16(S);return{charMap:n,subtable:q.data,maxGlyphID:p+1}}},e}(),I_=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="cmap",r.prototype.parse=function(t){var n,a,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,a=0;0<=i?a<i:a>i;a=0<=i?++a:--a)n=new gw(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},r.encode=function(t,n){var a,i;return n==null&&(n="macroman"),a=gw.encode(t,n),(i=new Kc).writeUInt16(0),i.writeUInt16(1),a.table=i.data.concat(a.subtable),a},r}(),hL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hhea",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},r}(),dL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="OS/2",r.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,a;for(a=[],n=0;n<10;++n)a.push(t.readByte());return a}(),this.charRange=function(){var n,a;for(a=[],n=0;n<4;++n)a.push(t.readInt());return a}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,a;for(a=[],n=0;n<2;n=++n)a.push(t.readInt());return a}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},r}(),pL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="post",r.prototype.parse=function(t){var n,a,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:var o;for(a=t.readUInt16(),this.glyphNameIndex=[],o=0;0<=a?o<a:o>a;o=0<=a?++o:--o)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)n=t.readByte(),i.push(this.names.push(t.readString(n)));return i;case 151552:return a=t.readUInt16(),this.offsets=t.read(a);case 196608:break;case 262144:return this.map=(function(){var s,u,c;for(c=[],o=s=0,u=this.file.maxp.numGlyphs;0<=u?s<u:s>u;o=0<=u?++s:--s)c.push(t.readUInt32());return c}).call(this)}},r}(),gL=function(e,r){this.raw=e,this.length=e.length,this.platformID=r.platformID,this.encodingID=r.encodingID,this.languageID=r.languageID},vL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="name",r.prototype.parse=function(t){var n,a,i,o,s,u,c,h,v,g,f;for(t.pos=this.offset,t.readShort(),n=t.readShort(),u=t.readShort(),a=[],o=0;0<=n?o<n:o>n;o=0<=n?++o:--o)a.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+u+t.readShort()});for(c={},o=v=0,g=a.length;v<g;o=++v)i=a[o],t.pos=i.offset,h=t.readString(i.length),s=new gL(h,i),c[f=i.nameID]==null&&(c[f]=[]),c[i.nameID].push(s);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},r}(),mL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="maxp",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},r}(),yL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hmtx",r.prototype.parse=function(t){var n,a,i,o,s,u,c;for(t.pos=this.offset,this.metrics=[],n=0,u=this.file.hhea.numberOfMetrics;0<=u?n<u:n>u;n=0<=u?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var h,v;for(v=[],n=h=0;0<=i?h<i:h>i;n=0<=i?++h:--h)v.push(t.readInt16());return v}(),this.widths=(function(){var h,v,g,f;for(f=[],h=0,v=(g=this.metrics).length;h<v;h++)o=g[h],f.push(o.advance);return f}).call(this),a=this.widths[this.widths.length-1],c=[],n=s=0;0<=i?s<i:s>i;n=0<=i?++s:--s)c.push(this.widths.push(a));return c},r.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},r}(),j_=[].slice,bL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="glyf",r.prototype.parse=function(){return this.cache={}},r.prototype.glyphFor=function(t){var n,a,i,o,s,u,c,h,v,g;return t in this.cache?this.cache[t]:(o=this.file.loca,n=this.file.contents,a=o.indexOf(t),(i=o.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+a,s=(u=new Kc(n.read(i))).readShort(),h=u.readShort(),g=u.readShort(),c=u.readShort(),v=u.readShort(),this.cache[t]=s===-1?new _L(u,h,g,c,v):new wL(u,s,h,g,c,v),this.cache[t]))},r.prototype.encode=function(t,n,a){var i,o,s,u,c;for(s=[],o=[],u=0,c=n.length;u<c;u++)i=t[n[u]],o.push(s.length),i&&(s=s.concat(i.encode(a)));return o.push(s.length),{table:s,offsets:o}},r}(),wL=function(){function e(r,t,n,a,i,o){this.raw=r,this.numberOfContours=t,this.xMin=n,this.yMin=a,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),_L=function(){function e(r,t,n,a,i){var o,s;for(this.raw=r,this.xMin=t,this.yMin=n,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return e.prototype.encode=function(){var r,t,n;for(t=new Kc(j_.call(this.raw.data)),r=0,n=this.glyphIDs.length;r<n;++r)t.pos=this.glyphOffsets[r];return t.data},e}(),SL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="loca",r.prototype.parse=function(t){var n,a;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=2)o.push(2*t.readUInt16());return o}).call(this):(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=4)o.push(t.readUInt32());return o}).call(this)},r.prototype.indexOf=function(t){return this.offsets[t]},r.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},r.prototype.encode=function(t,n){for(var a=new Uint32Array(this.offsets.length),i=0,o=0,s=0;s<a.length;++s)if(a[s]=i,o<n.length&&n[o]==s){++o,a[s]=i;var u=this.offsets[s],c=this.offsets[s+1]-u;c>0&&(i+=c)}for(var h=new Array(4*a.length),v=0;v<a.length;++v)h[4*v+3]=255&a[v],h[4*v+2]=(65280&a[v])>>8,h[4*v+1]=(16711680&a[v])>>16,h[4*v]=(4278190080&a[v])>>24;return h},r}(),xL=function(){function e(r){this.font=r,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var r,t,n,a,i;for(t in a=this.font.cmap.tables[0].codeMap,r={},i=this.subset)n=i[t],r[t]=a[n];return r},e.prototype.glyphsFor=function(r){var t,n,a,i,o,s,u;for(a={},o=0,s=r.length;o<s;o++)a[i=r[o]]=this.font.glyf.glyphFor(i);for(i in t=[],a)(n=a[i])!=null&&n.compound&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in u=this.glyphsFor(t))n=u[i],a[i]=n;return a},e.prototype.encode=function(r,t){var n,a,i,o,s,u,c,h,v,g,f,E,S,w,_;for(a in n=I_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(r),f={0:0},_=n.charMap)f[(u=_[a]).old]=u.new;for(E in g=n.maxGlyphID,o)E in f||(f[E]=g++);return h=function(y){var p,m;for(p in m={},y)m[y[p]]=p;return m}(f),v=Object.keys(h).sort(function(y,p){return y-p}),S=function(){var y,p,m;for(m=[],y=0,p=v.length;y<p;y++)s=v[y],m.push(h[s]);return m}(),i=this.font.glyf.encode(o,S,f),c=this.font.loca.encode(i.offsets,S),w={cmap:this.font.cmap.raw(),glyf:i.table,loca:c,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(w["OS/2"]=this.font.os2.raw()),this.font.directory.encode(w)},e}();vr.API.PDFObject=function(){var e;function r(){}return e=function(t,n){return(Array(n+1).join("0")+t).slice(-n)},r.convert=function(t){var n,a,i,o;if(Array.isArray(t))return"["+function(){var s,u,c;for(c=[],s=0,u=t.length;s<u;s++)n=t[s],c.push(r.convert(n));return c}().join(" ")+"]";if(typeof t=="string")return"/"+t;if(t?.isString)return"("+t+")";if(t instanceof Date)return"(D:"+e(t.getUTCFullYear(),4)+e(t.getUTCMonth(),2)+e(t.getUTCDate(),2)+e(t.getUTCHours(),2)+e(t.getUTCMinutes(),2)+e(t.getUTCSeconds(),2)+"Z)";if({}.toString.call(t)==="[object Object]"){for(a in i=["<<"],t)o=t[a],i.push("/"+a+" "+r.convert(o));return i.push(">>"),i.join(`
|
|
627
|
+
`)}return""+t},r}();window.jspdf={jsPDF:vr};xk.toggleFadeInAnimation(!1);ap.setTextOverflow("change-font-size");const EL=new URLSearchParams(location.search).get("key"),F_=Sk.createStore({key:EL});window.store=F_;window.config={addGlobalFont:Ek.addGlobalFont,unstable_useHtmlTextRender:ap.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:ap.setTextVerticalResizeEnabled,unstable_setTextOverflow:ap.setTextOverflow,onLoadError:n2.onLoadError,setAssetLoadTimeout:n2.setAssetLoadTimeout,setFontLoadTimeout:n2.setFontLoadTimeout,unstable_setTextSplitAllowed:ap.setTextSplitAllowed};const PL=mw.createRoot(document.getElementById("root"));PL.render($r.createElement(_k.WorkspaceCanvas,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:F_,components:{PageControls:()=>null,Tooltip:()=>null}}));export{kn as _,bh as c,yp as g};
|