Files
web-cad/backend/public/assets/index-Bdiu6cTh.js
T

455 lines
590 KiB
JavaScript

var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function I(e,t){ie++,re[ie]=e.current,e.current=t}var se=ae(null),ce=ae(null),le=ae(null),ue=ae(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}oe(se),I(se,e)}function fe(){oe(se),oe(ce),oe(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(oe(se),oe(ce)),ue.current===e&&(oe(ue),Qf._currentValue=ne)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function ot(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[ct])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=RegExp(`^[: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]*$`),Dt={},Ot={};function kt(e){return Se.call(Ot,e)?!0:Se.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),$t=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(bu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=m({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=m({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(m({},kn,{dataTransfer:0})),Mn=xn(m({},wn,{relatedTarget:0})),Nn=xn(m({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(m({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(m({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(m({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(m({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(m({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(m({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(m({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Kn=xn(m({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Ed(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){yd(e,0)}function dr(e){if(Lt(yt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(dn){var mr;if(dn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,rn(e)),ln(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Se.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var jr=dn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Rt(r)||(r=Mr,`selectionStart`in r&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pr&&Tr(Pr,r)||(Pr=r,r=Ed(Nr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};dn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),Yr=new Map,Xr=`abort auxClick beforeToggle 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(` `);Xr.push(`scrollEnd`);function Zr(e,t){Yr.set(e,t),wt(t,[e])}var Qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},$r=[],ei=0,ti=0;function L(){for(var e=ei,t=ti=ei=0;t<e;){var n=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];$r[t++]=null;var a=$r[t];if($r[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){$r[ei++]=e,$r[ei++]=t,$r[ei++]=n,$r[ei++]=r,ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=li(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=li(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=li(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function R(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var yi=[],bi=0,xi=null,z=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){yi[bi++]=z,yi[bi++]=xi,xi=e,z=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-ze(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,z=yi[--bi],yi[bi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,B=null,V=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(R(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Mi=Mi.return}}function zi(e){if(e!==Mi)return!1;if(!V)return Ri(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&B&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));B=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));B=uf(e)}else t===27?(t=B,Zd(e.type)?(e=lf,lf=null,B=e):B=t):B=Mi?cf(e.stateNode.nextSibling):null;return!0}function Bi(){B=Mi=null,V=!1}function Vi(){var e=Ni;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=ae(null),Wi=null,Gi=null;function Ki(e,t,n){I(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,oe(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=dd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=P.S;P.S=function(e,t){eu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ae(null);function _a(){var e=ga.current;return e===null?q.pooledCache:e}function va(e,t){t===null?I(ga,ga.current):I(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(te(t)||M(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Di(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ea(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function H(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var U=ae(null),Ya=ae(0);function Xa(e,t){e=Ul,I(Ya,e),I(U,t),Ul=e|t.baseLanes}function Za(){I(Ya,Ul),I(U,U.current)}function Qa(){Ul=Ya.current,oe(U),oe(Ya)}var $a=ae(null),eo=null;function to(e){var t=e.alternate;I(oo,oo.current&1),I($a,e),eo===null&&(t===null||U.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){I(oo,oo.current),I($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(I(oo,oo.current),I($a,e),eo===null&&(eo=e)):io(e)}function io(){I(oo,oo.current),I($a,$a.current)}function ao(e){oe($a),eo===e&&(eo=null),oe(oo)}var oo=ae(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){P.H=Is;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Zi(e)&&(tc=!0))}function So(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ta(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),G,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((co&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(tc=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);wr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,a=Oo(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((G||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||co&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Ho(e){var t=ii(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,G,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(V){var n=q.formState;if(n!==null){a:{var r=W;if(V){if(B){b:{for(var i=B,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){B=cf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),G,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=G;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&yo(r,G.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return wr(n,t)?n:U.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=vs(e,n,r),wr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ms(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,ma(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,ne,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return $i(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Va(n);var r=Ha(t,e,n);r!==null&&(hu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ri(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o))return ni(e,t,i,0),q===null&&L(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Is={readContext:$i,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:$i,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(V){var n=Ei,r=Ti;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:$i,use:jo,useCallback:gs,useContext:$i,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),G.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:$i,use:jo,useCallback:gs,useContext:$i,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return G===null?vs(n,e,t):ys(n,G.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(hu(t,e,n),Ua(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,r)||!Tr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Qr(e)}function Ks(e){console.error(e)}function qs(e){Qr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=Va(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(V)return t=$a.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(R(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=R(r,n),a=Xs(e.stateNode,r,a),Wa(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(R(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=R(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=R(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(V&&s&&ki(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),Za(),io(t)):(va(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),Za(),ro(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Ia(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=B)?(e=rf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Mi=t,B=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=q,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,B=cf(s.nextSibling),Mi=t,V=!0,Ni=null,Pi=!1,e!==null&&ji(t,e),t=lc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Qi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(V&&r&&ki(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(V&&r&&ki(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),H(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,H(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ra||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,H(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ra||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Bi(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:ya()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(V){if(a?to(t):io(t),(e=B)?(e=rf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Mi=t,B=null)):e=null,e===null)throw Ii(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,B=cf(c.nextSibling),Mi=t,V=!0,Ni=null,Pi=!1,e!==null&&ji(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Ia(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(oo,o),nc(e,t,r,n),r=V?z:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,V&&t.flags&1048576&&Oi(t,z,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),H(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=R(Error(i(424)),t),Hi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(B=cf(e.firstChild),Mi=t,V=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[ct]=t,r[lt]=e,Pd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&V&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Mi=t,Pi=!0,a=B,Zd(t.type)?(lf=a,B=cf(r.firstChild)):B=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=B)&&(r=tf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Mi=t,B=cf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=B)&&(n=nf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Mi=t,B=null,e=!0)),e||Ii(t)),null;case 13:return bc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=q,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),H(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Da=Ca,xa}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=se.current,zi(t)?Li(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=se.current,zi(t))Li(t,o);else{var s=Bd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Bd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return fe(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return qi(t.type),Ic(t),null;case 19:if(oe(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return I(oo,oo.current&1|2),V&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return Ic(t),null}else 2*De()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=oo.current,I(oo,a?n&1|2:n&1),V&&Di(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&oe(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(oo),null;case 4:return fe(),null;case 10:return qi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&oe(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function zc(e,t){switch(Ai(t),t.tag){case 3:qi(aa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:oe(oo);break;case 10:qi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&oe(ga);break;case 24:qi(aa)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[lt]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ct]=e,t[lt]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=kr(e),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ja(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&gt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:P.T===null?at():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||V){var e=We;We<<=1,!(We&3932160)&&(We=262144),Jl=e}else Jl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Qe(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-De(),10<a)){if(yu(r,t,Jl,!Bl),qe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},jl(t,a,d);var m=(a&62914560)===a?$l-De():(a&4194048)===a?eu-De():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Gi=Wi=null,Eo(e),Aa=null,ja=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=di(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Je(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,L(),n}function Cu(e,t){W=null,P.H=Is,t===ba||t===Sa?(t=Oa(),X=3):t===xa?(t=Oa(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,R(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?eo===null:(Y&62914560)===Y||Y&536870912?e===eo:!1}function Tu(){var e=P.H;return P.H=Is,e===null?Is:e}function Eu(){var e=P.A;return P.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&$a.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,K=r,P.H=i,P.A=a,J===null&&(q=null,Y=0,L()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=De()+500,Su(e,t)):Vl=Je(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(wa(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:wa(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Gi=Wi=null,P.H=r,P.A=a,K=n,J===null?(q=null,Y=0,L(),Wl):0}function ju(){for(;J!==null&&!Te();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=fi(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Gi=Wi=null,Eo(t),Aa=null,ja=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,R(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,R(n,e.current)),J=null;return}t.flags&32768?(V||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ti,$e(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(je,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,F.p=a,P.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,F.p=r,P.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,F.p=r,P.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Ee();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),it(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=it(su),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Vu(e,t)}}function Wu(e,t,n){t=R(n,t),t=Xs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Qe(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=R(n,e),n=Zs(2),r=Ha(t,n,2),r!==null&&(Qs(n,r,t,e),Qe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>De()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Xe()),e=ii(e,t),e!==null&&(Qe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ce(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=qe(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=De(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),it(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=cd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=qe(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,De()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Ce(ke,ad):od()})}function dd(){if(nd===0){var e=ua;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Xr.length;hd++){var gd=Xr[hd];Zr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Zr(Hr,`onAnimationEnd`),Zr(Ur,`onAnimationIteration`),Zr(Wr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Gr,`onTransitionRun`),Zr(Kr,`onTransitionStart`),Zr(qr,`onTransitionCancel`),Zr(Jr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,St.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Yr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case Hr:case Ur:case Wr:l=Nn;break;case Jr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(or(c))if(pr)v=Sr;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=Ed(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Td(e,i,a)),i=un(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=bt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);xt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=bt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),xt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=bt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),xt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=le.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Bt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),xt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Bt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,xt(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function tp(e){return e?(e=si,e):si}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(hu(n,e,t),Ua(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=rt(t);var n=ii(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=De()+500,id(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=rn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[ut]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ie=zp.inject(Rp),Le=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ut]=t.current,Sd(e),new Fp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=l(_(),1),b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w=`popstate`;function T(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return j(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:M(t)}return ee(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function k(){return Math.random().toString(36).substring(2,10)}function A(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function j(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?N(t):t,state:n,key:t&&t.key||r||k(),mask:i}}function M({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function N(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ee(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u()+1;let d=A(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u();let i=A(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return te(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(w,d),c=e,()=>{i.removeEventListener(w,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function te(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),D(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:M(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function P(e,t,n=`/`){return F(e,t,n,!1)}function F(e,t,n,r,i){let a=ye((typeof t==`string`?N(t):t).pathname||`/`,n);if(a==null)return null;let o=i??re(e),s=null,c=ve(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function ne(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function re(e){let t=ie(e);return oe(t),t}function ie(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Oe([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ie(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ae(e.path))a(e,t,!0,n)}),t}function ae(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ae(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function oe(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var I=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,de=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=de),t&&(r+=ce),n.filter(e=>!fe(e)).reduce((e,t)=>e+(I.test(t)?se:t===``?le:ue),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Oe([a,u.pathname]),pathnameBase:Ae(Oe([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Oe([a,u.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ye(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var be=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=De(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:je(r),hash:Me(i)}}function Se(e,t){let n=ke(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function we(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Te(e){let t=we(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ee(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),Ce(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var De=e=>e.replace(/\/\/+/g,`/`),Oe=e=>De(e.join(`/`)),ke=e=>e.replace(/\/+$/,``),Ae=e=>ke(e).replace(/^\/*/,`/`),je=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Me=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ne=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Pe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Fe(e){return Oe(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ie=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Le(e,t){let n=e;if(typeof n!=`string`||!be.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ie)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ye(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Re=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Re);var ze=[`GET`,...Re];new Set(ze);var Be=v.createContext(null);Be.displayName=`DataRouter`;var Ve=v.createContext(null);Ve.displayName=`DataRouterState`;var He=v.createContext(!1);function Ue(){return v.useContext(He)}var We=v.createContext({isTransitioning:!1});We.displayName=`ViewTransition`;var Ge=v.createContext(new Map);Ge.displayName=`Fetchers`;var Ke=v.createContext(null);Ke.displayName=`Await`;var qe=v.createContext(null);qe.displayName=`Navigation`;var Je=v.createContext(null);Je.displayName=`Location`;var Ye=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ye.displayName=`Route`;var Xe=v.createContext(null);Xe.displayName=`RouteError`;var Ze=`REACT_ROUTER_ERROR`,Qe=`REDIRECT`,$e=`ROUTE_ERROR_RESPONSE`;function et(e){if(e.startsWith(`${Ze}:${Qe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function tt(e){if(e.startsWith(`${Ze}:${$e}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ne(t.status,t.statusText,t.data)}catch{}}function nt(e,{relative:t}={}){D(rt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(qe),{hash:i,pathname:a,search:o}=ut(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Oe([n,a])),r.createHref({pathname:s,search:o,hash:i})}function rt(){return v.useContext(Je)!=null}function it(){return D(rt(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(Je).location}var at=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ot(e){v.useContext(qe).static||v.useLayoutEffect(e)}function st(){let{isDataRoute:e}=v.useContext(Ye);return e?kt():ct()}function ct(){D(rt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(Be),{basename:t,navigator:n}=v.useContext(qe),{matches:r}=v.useContext(Ye),{pathname:i}=it(),a=JSON.stringify(Te(r)),o=v.useRef(!1);return ot(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(O(o.current,at),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ee(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Oe([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function lt(){let{matches:e}=v.useContext(Ye);return e[e.length-1]?.params??{}}function ut(e,{relative:t}={}){let{matches:n}=v.useContext(Ye),{pathname:r}=it(),i=JSON.stringify(Te(n));return v.useMemo(()=>Ee(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function dt(e,t){return ft(e,t)}function ft(e,t,n){D(rt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(qe),{matches:i}=v.useContext(Ye),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;jt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=it(),d;if(t){let e=typeof t==`string`?N(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):P(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=yt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Oe([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Oe([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(Je.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function pt(){let e=Ot(),t=Pe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var mt=v.createElement(pt,null),ht=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=tt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Ye.Provider,{value:this.props.routeContext},v.createElement(Xe.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(_t,{error:e},t):t}};ht.contextType=He;var gt=new WeakMap;function _t({children:e,error:t}){let{basename:n}=v.useContext(qe);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=et(t.digest);if(e){let r=gt.get(t);if(r)throw r;let i=Le(e.location,n);if(Ie&&!gt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw gt.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function vt({routeContext:e,match:t,children:n}){let r=v.useContext(Be);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ye.Provider,{value:e},n)}function yt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Fe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||mt,o&&(s<0&&c===0?(jt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(vt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(ht,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function bt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xt(e){let t=v.useContext(Be);return D(t,bt(e)),t}function St(e){let t=v.useContext(Ve);return D(t,bt(e)),t}function Ct(e){let t=v.useContext(Ye);return D(t,bt(e)),t}function wt(e){let t=Ct(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Tt(){return wt(`useRouteId`)}function Et(){let e=St(`useNavigation`);return v.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Dt(){let{matches:e,loaderData:t}=St(`useMatches`);return v.useMemo(()=>e.map(e=>ne(e,t)),[e,t])}function Ot(){let e=v.useContext(Xe),t=St(`useRouteError`),n=wt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function kt(){let{router:e}=xt(`useNavigate`),t=wt(`useNavigate`),n=v.useRef(!1);return ot(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{O(n.current,at),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var At={};function jt(e,t,n){!t&&!At[e]&&(At[e]=!0,O(!1,n))}v.memo(Mt);function Mt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ft(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Nt({to:e,replace:t,state:n,relative:r}){D(rt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(qe);O(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=v.useContext(Ye),{pathname:o}=it(),s=st(),c=Ee(e,Te(a),o,r===`path`),l=JSON.stringify(c);return v.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Pt(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ft({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!rt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=ye(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(qe.Provider,{value:c},v.createElement(Je.Provider,{children:t,value:h}))}function It({children:e,location:t}){return dt(Lt(e),t)}v.Component;function Lt(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Lt(e.props.children,i));return}D(e.type===Pt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Lt(e.props.children,i)),n.push(a)}),n}var Rt=`get`,zt=`application/x-www-form-urlencoded`;function Bt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Vt(e){return Bt(e)&&e.tagName.toLowerCase()===`button`}function Ht(e){return Bt(e)&&e.tagName.toLowerCase()===`form`}function Ut(e){return Bt(e)&&e.tagName.toLowerCase()===`input`}function Wt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gt(e,t){return e.button===0&&(!t||t===`_self`)&&!Wt(e)}var Kt=null;function qt(){if(Kt===null)try{new FormData(document.createElement(`form`),0),Kt=!1}catch{Kt=!0}return Kt}var Jt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Yt(e){return e!=null&&!Jt.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zt}"`),null):e}function Xt(e,t){let n,r,i,a,o;if(Ht(e)){let o=e.getAttribute(`action`);r=o?ye(o,t):null,n=e.getAttribute(`method`)||Rt,i=Yt(e.getAttribute(`enctype`))||zt,a=new FormData(e)}else if(Vt(e)||Ut(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ye(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Rt,i=Yt(e.getAttribute(`formenctype`))||Yt(o.getAttribute(`enctype`))||zt,a=new FormData(o,e),!qt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Bt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Rt,r=null,i=zt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Zt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Qt=/[&><\u2028\u2029]/g;function $t(e){return e.replace(Qt,e=>Zt[e])}function en(e,t){if(e===!1||e==null)throw Error(t)}function tn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ye(i.pathname,t)===`/`?i.pathname=`${ke(t)}/_root.${r}`:i.pathname=`${ke(i.pathname)}.${r}`,i}async function nn(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rn(e){return e!=null&&typeof e.page==`string`}function an(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function on(e,t,n){return dn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await nn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(an).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function sn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function cn(e,t,{includeHydrateFallback:n}={}){return ln(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ln(e){return[...new Set(e)]}function un(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function dn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!rn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(un(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function fn(){let e=v.useContext(Be);return en(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function pn(){let e=v.useContext(Ve);return en(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var mn=v.createContext(void 0);mn.displayName=`FrameworkContext`;function hn(){let e=v.useContext(mn);return en(e,`You must render this element inside a <HydratedRouter> element`),e}function gn(e,t){let n=v.useContext(mn),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:_n(s,p),onBlur:_n(c,m),onMouseEnter:_n(l,p),onMouseLeave:_n(u,m),onTouchStart:_n(d,p)}]:[a,f,{}]:[!1,f,{}]}function _n(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vn({page:e,...t}){let n=Ue(),{router:r}=fn(),i=v.useMemo(()=>P(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?v.createElement(bn,{page:e,matches:i,...t}):v.createElement(xn,{page:e,matches:i,...t}):null}function yn(e){let{manifest:t,routeModules:n}=hn(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return on(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function bn({page:e,matches:t,...n}){let r=it(),{future:i}=hn(),{basename:a}=fn(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=tn(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function xn({page:e,matches:t,...n}){let r=it(),{future:i,manifest:a,routeModules:o}=hn(),{basename:s}=fn(),{loaderData:c,matches:l}=pn(),u=v.useMemo(()=>sn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>sn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=tn(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>cn(d,a),[d,a]),m=yn(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Sn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Cn&&(window.__reactRouterVersion=`7.15.1`)}catch{}function wn({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=E({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(Ft,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Tn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=v.useState({action:n.action,location:n.location}),o=v.useCallback(e=>{r===!1?a(e):v.startTransition(()=>a(e))},[r]);return v.useLayoutEffect(()=>n.listen(o),[n,o]),v.createElement(Ft,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Tn.displayName=`unstable_HistoryRouter`;var En=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(qe),y=typeof l==`string`&&En.test(l),b=Le(l,h);l=b.to;let x=nt(l,{relative:r}),S=it(),C=null;if(o){let e=Ee(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Oe([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=gn(n,p),D=Pn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=v.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Sn(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,A,v.createElement(vn,{page:x})):A});Dn.displayName=`Link`;var On=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ut(a,{relative:c.relative}),d=it(),f=v.useContext(Ve),{navigator:p,basename:m}=v.useContext(qe),h=f!=null&&Wn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=ye(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(Dn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});On.displayName=`NavLink`;var kn=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Rt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(qe),g=Ln(),_=Rn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&En.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});kn.displayName=`Form`;function An({getKey:e,storageKey:t,...n}){let r=v.useContext(mn),{basename:i}=v.useContext(qe),a=it(),o=Dt();Hn({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=Vn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${$t(JSON.stringify(t||zn))}, ${$t(JSON.stringify(s))})`}})}An.displayName=`ScrollRestoration`;function jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mn(e){let t=v.useContext(Be);return D(t,jn(e)),t}function Nn(e){let t=v.useContext(Ve);return D(t,jn(e)),t}function Pn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=st(),d=it(),f=ut(e,{relative:o});return v.useCallback(p=>{if(Gt(p,t)){p.preventDefault();let t=n===void 0?M(d)===M(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Fn=0,In=()=>`__${String(++Fn)}__`;function Ln(){let{router:e}=Mn(`useSubmit`),{basename:t}=v.useContext(qe),n=Tt(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Xt(e,t);a.navigate===!1?await r(a.fetcherKey||In(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Rn(e,{relative:t}={}){let{basename:n}=v.useContext(qe),r=v.useContext(Ye);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ut(e||`.`,{relative:t})},o=it();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Oe([n,a.pathname])),M(a)}var zn=`react-router-scroll-positions`,Bn={};function Vn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ye(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Hn({getKey:e,storageKey:t}={}){let{router:n}=Mn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Nn(`useScrollRestoration`),{basename:a}=v.useContext(qe),o=it(),s=Dt(),c=Et();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Un(v.useCallback(()=>{if(c.state===`idle`){let t=Vn(o,s,a,e);Bn[t]=window.scrollY}try{sessionStorage.setItem(t||zn,JSON.stringify(Bn))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(v.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||zn);e&&(Bn=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Bn,()=>window.scrollY,e?(t,n)=>Vn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),v.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Un(e,t){let{capture:n}=t||{};v.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Wn(e,{relative:t}={}){let n=v.useContext(We);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Mn(`useViewTransitionState`),i=ut(e,{relative:t});if(!n.isTransitioning)return!1;let a=ye(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ye(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ge(i.pathname,o)!=null||ge(i.pathname,a)!=null}function Gn(e,t){return function(){return e.apply(t,arguments)}}var{toString:Kn}=Object.prototype,{getPrototypeOf:qn}=Object,{iterator:Jn,toStringTag:Yn}=Symbol,Xn=(e=>t=>{let n=Kn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zn=e=>(e=e.toLowerCase(),t=>Xn(t)===e),Qn=e=>t=>typeof t===e,{isArray:$n}=Array,er=Qn(`undefined`);function tr(e){return e!==null&&!er(e)&&e.constructor!==null&&!er(e.constructor)&&ar(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var nr=Zn(`ArrayBuffer`);function rr(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&nr(e.buffer),t}var ir=Qn(`string`),ar=Qn(`function`),or=Qn(`number`),sr=e=>typeof e==`object`&&!!e,cr=e=>e===!0||e===!1,lr=e=>{if(Xn(e)!==`object`)return!1;let t=qn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Yn in e)&&!(Jn in e)},ur=e=>{if(!sr(e)||tr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dr=Zn(`Date`),fr=Zn(`File`),pr=e=>!!(e&&e.uri!==void 0),mr=e=>e&&e.getParts!==void 0,hr=Zn(`Blob`),gr=Zn(`FileList`),_r=e=>sr(e)&&ar(e.pipe);function vr(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var yr=vr(),br=yr.FormData===void 0?void 0:yr.FormData,xr=e=>{if(!e)return!1;if(br&&e instanceof br)return!0;let t=qn(e);if(!t||t===Object.prototype||!ar(e.append))return!1;let n=Xn(e);return n===`formdata`||n===`object`&&ar(e.toString)&&e.toString()===`[object FormData]`},Sr=Zn(`URLSearchParams`),[Cr,wr,Tr,Er]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(Zn),Dr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Or(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),$n(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(tr(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function kr(e,t){if(tr(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Ar=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,jr=e=>!er(e)&&e!==Ar;function Mr(...e){let{caseless:t,skipUndefined:n}=jr(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&kr(r,i)||i,o=Wr(r,a)?r[a]:void 0;lr(o)&&lr(e)?r[a]=Mr(o,e):lr(e)?r[a]=Mr({},e):$n(e)?r[a]=e.slice():(!n||!er(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++)e[t]&&Or(e[t],i);return r}var Nr=(e,t,n,{allOwnKeys:r}={})=>(Or(t,(t,r)=>{n&&ar(t)?Object.defineProperty(e,r,{__proto__:null,value:Gn(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Pr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Fr=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Ir=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&qn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lr=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Rr=e=>{if(!e)return null;if($n(e))return e;let t=e.length;if(!or(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},zr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&qn(Uint8Array)),Br=(e,t)=>{let n=(e&&e[Jn]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Vr=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Hr=Zn(`HTMLFormElement`),Ur=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Wr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gr=Zn(`RegExp`),Kr=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Or(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},qr=e=>{Kr(e,(t,n)=>{if(ar(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(ar(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Jr=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return $n(e)?r(e):r(String(e).split(t)),n},Yr=()=>{},Xr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zr(e){return!!(e&&ar(e.append)&&e[Yn]===`FormData`&&e[Jn])}var Qr=e=>{let t=new WeakSet,n=e=>{if(sr(e)){if(t.has(e))return;if(tr(e))return e;if(!(`toJSON`in e)){t.add(e);let r=$n(e)?[]:{};return Or(e,(e,t)=>{let i=n(e);!er(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},$r=Zn(`AsyncFunction`),ei=e=>e&&(sr(e)||ar(e))&&ar(e.then)&&ar(e.catch),ti=((e,t)=>e?setImmediate:t?((e,t)=>(Ar.addEventListener(`message`,({source:n,data:r})=>{n===Ar&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Ar.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,ar(Ar.postMessage)),L={isArray:$n,isArrayBuffer:nr,isBuffer:tr,isFormData:xr,isArrayBufferView:rr,isString:ir,isNumber:or,isBoolean:cr,isObject:sr,isPlainObject:lr,isEmptyObject:ur,isReadableStream:Cr,isRequest:wr,isResponse:Tr,isHeaders:Er,isUndefined:er,isDate:dr,isFile:fr,isReactNativeBlob:pr,isReactNative:mr,isBlob:hr,isRegExp:Gr,isFunction:ar,isStream:_r,isURLSearchParams:Sr,isTypedArray:zr,isFileList:gr,forEach:Or,merge:Mr,extend:Nr,trim:Dr,stripBOM:Pr,inherits:Fr,toFlatObject:Ir,kindOf:Xn,kindOfTest:Zn,endsWith:Lr,toArray:Rr,forEachEntry:Br,matchAll:Vr,isHTMLForm:Hr,hasOwnProperty:Wr,hasOwnProp:Wr,reduceDescriptors:Kr,freezeMethods:qr,toObjectSet:Jr,toCamelCase:Ur,noop:Yr,toFiniteNumber:Xr,findKey:kr,global:Ar,isContextDefined:jr,isSpecCompliantForm:Zr,toJSONObject:Qr,isAsyncFn:$r,isThenable:ei,setImmediate:ti,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Ar):typeof process<`u`&&process.nextTick||ti,isIterable:e=>e!=null&&ar(e[Jn])},ni=L.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),ri=e=>{let t={},n,r,i;return e&&e.split(`
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&ni[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};function ii(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var ai=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),oi=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function si(e,t){return L.isArray(e)?e.map(e=>si(e,t)):ii(String(e).replace(t,``))}var ci=e=>si(e,ai),li=e=>si(e,oi);function ui(e){let t=Object.create(null);return L.forEach(e.toJSON(),(e,n)=>{t[n]=li(e)}),t}var di=Symbol(`internals`);function fi(e){return e&&String(e).trim().toLowerCase()}function pi(e){return e===!1||e==null?e:L.isArray(e)?e.map(pi):ci(String(e))}function mi(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var hi=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function gi(e,t,n,r,i){if(L.isFunction(r))return r.call(this,t,n);if(i&&(t=n),L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function _i(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function vi(e,t){let n=L.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var R=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=fi(t);if(!i)throw Error(`header name must be a non-empty string`);let a=L.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=pi(e))}let a=(e,t)=>L.forEach(e,(e,n)=>i(e,n,t));if(L.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(L.isString(e)&&(e=e.trim())&&!hi(e))a(ri(e),t);else if(L.isObject(e)&&L.isIterable(e)){let n={},r,i;for(let t of e){if(!L.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?L.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=fi(e),e){let n=L.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return mi(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=fi(e),e){let n=L.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||gi(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=fi(e),e){let i=L.findKey(n,e);i&&(!t||gi(n,n[i],i,t))&&(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||gi(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return L.forEach(this,(r,i)=>{let a=L.findKey(n,i);if(a){t[a]=pi(r),delete t[i];return}let o=e?_i(i):String(i).trim();o!==i&&delete t[i],t[o]=pi(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return L.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&L.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[di]=this[di]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=fi(e);t[r]||(vi(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};R.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),L.reduceDescriptors(R.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),L.freezeMethods(R);var yi=`[REDACTED ****]`;function bi(e){if(L.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function xi(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||L.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof R&&(e=e.toJSON()),r.push(e);let t;if(L.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);L.isUndefined(r)||(t[n]=r)});else{if(!L.isPlainObject(e)&&bi(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?yi:i(a);L.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var z=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&L.hasOwnProp(e,`redact`)?e.redact:void 0,n=L.isArray(t)&&t.length>0?xi(e,t):L.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};z.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,z.ERR_BAD_OPTION=`ERR_BAD_OPTION`,z.ECONNABORTED=`ECONNABORTED`,z.ETIMEDOUT=`ETIMEDOUT`,z.ECONNREFUSED=`ECONNREFUSED`,z.ERR_NETWORK=`ERR_NETWORK`,z.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,z.ERR_DEPRECATED=`ERR_DEPRECATED`,z.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,z.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,z.ERR_CANCELED=`ERR_CANCELED`,z.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,z.ERR_INVALID_URL=`ERR_INVALID_URL`,z.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function Si(e){return L.isPlainObject(e)||L.isArray(e)}function Ci(e){return L.endsWith(e,`[]`)?e.slice(0,-2):e}function wi(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ci(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Ti(e){return L.isArray(e)&&!e.some(Si)}var Ei=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function Di(e,t,n){if(!L.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!L.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&L.isSpecCompliantForm(t);if(!L.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(L.isDate(e))return e.toISOString();if(L.isBoolean(e))return e.toString();if(!l&&L.isBlob(e))throw new z(`Blob is not supported. Use a Buffer instead.`);return L.isArrayBuffer(e)||L.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(L.isReactNative(t)&&L.isReactNativeBlob(e))return t.append(wi(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(L.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&Ti(e)||(L.isFileList(e)||L.endsWith(n,`[]`))&&(s=L.toArray(e)))return n=Ci(n),s.forEach(function(e,r){!(L.isUndefined(e)||e===null)&&t.append(o===!0?wi([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return Si(e)?!0:(t.append(wi(i,n,a),u(e)),!1)}let f=[],p=Object.assign(Ei,{defaultVisitor:d,convertValue:u,isVisitable:Si});function m(e,n,r=0){if(!L.isUndefined(e)){if(r>c)throw new z(`Object is too deeply nested (`+r+` levels). Max depth: `+c,z.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),L.forEach(e,function(e,a){(!(L.isUndefined(e)||e===null)&&i.call(t,e,L.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!L.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function Oi(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ki(e,t){this._pairs=[],e&&Di(e,this,t)}var Ai=ki.prototype;Ai.append=function(e,t){this._pairs.push([e,t])},Ai.toString=function(e){let t=e?function(t){return e.call(this,t,Oi)}:Oi;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function ji(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Mi(e,t,n){if(!t)return e;let r=n&&n.encode||ji,i=L.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):L.isURLSearchParams(t)?t.toString():new ki(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var B=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){L.forEach(this.handlers,function(t){t!==null&&e(t)})}},V={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ni={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:ki,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Pi=s({hasBrowserEnv:()=>Fi,hasStandardBrowserEnv:()=>Li,hasStandardBrowserWebWorkerEnv:()=>Ri,navigator:()=>Ii,origin:()=>zi}),Fi=typeof window<`u`&&typeof document<`u`,Ii=typeof navigator==`object`&&navigator||void 0,Li=Fi&&(!Ii||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ii.product)<0),Ri=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,zi=Fi&&window.location.href||`http://localhost`,Bi={...Pi,...Ni};function Vi(e,t){return Di(e,new Bi.classes.URLSearchParams,{visitor:function(e,t,n,r){return Bi.isNode&&L.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Hi(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Ui(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Wi(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&L.isArray(r)?r.length:a,s?(L.hasOwnProp(r,a)?r[a]=L.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!L.hasOwnProp(r,a)||!L.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=Ui(r[a])),!o)}if(L.isFormData(e)&&L.isFunction(e.entries)){let n={};return L.forEachEntry(e,(e,r)=>{t(Hi(e),r,n,0)}),n}return null}var Gi=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function Ki(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var qi={transitional:V,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r?JSON.stringify(Wi(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Gi(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Vi(e,t).toString();if((a=L.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Gi(this,`env`),r=n&&n.FormData;return Di(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Ki(e)):e}],transformResponse:[function(e){let t=Gi(this,`transitional`)||qi.transitional,n=t&&t.forcedJSONParsing,r=Gi(this,`responseType`),i=r===`json`;if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Gi(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?z.from(e,z.ERR_BAD_RESPONSE,this,null,Gi(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bi.classes.FormData,Blob:Bi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{qi.headers[e]={}});function Ji(e,t){let n=this||qi,r=t||n,i=R.from(r.headers),a=r.data;return L.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Yi(e){return!!(e&&e.__CANCEL__)}var Xi=class extends z{constructor(e,t,n){super(e??`canceled`,z.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Zi(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new z(`Request failed with status code `+n.status,n.status>=400&&n.status<500?z.ERR_BAD_REQUEST:z.ERR_BAD_RESPONSE,n.config,n.request,n))}function Qi(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function $i(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function ea(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var ta=(e,t,n=3)=>{let r=0,i=$i(50,250);return ea(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},na=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ra=e=>(...t)=>L.asap(()=>e(...t)),ia=Bi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Bi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Bi.origin),Bi.navigator&&/(msie|trident)/i.test(Bi.navigator.userAgent)):()=>!0,aa=Bi.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&s.push(`path=${r}`),L.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),L.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)return decodeURIComponent(r.slice(i+1))}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function oa(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function sa(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function ca(e,t,n){let r=!oa(t);return e&&(r||n===!1)?sa(e,t):t}var la=e=>e instanceof R?{...e}:e;function ua(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:r},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n,i){if(!L.isUndefined(t))return r(e,t,n,i);if(!L.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){if(!L.isUndefined(t))return r(void 0,t);if(!L.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(L.hasOwnProp(t,a))return r(n,i);if(L.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(la(e),la(t),n,!0)};return L.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=L.hasOwnProp(c,r)?c[r]:i,o=a(L.hasOwnProp(e,r)?e[r]:void 0,L.hasOwnProp(t,r)?t[r]:void 0,r);L.isUndefined(o)&&a!==s||(n[r]=o)}),n}var da=[`content-type`,`content-length`];function fa(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{da.includes(t.toLowerCase())&&e.set(t,n)})}var pa=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),ma=e=>{let t=ua({},e),n=e=>L.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=R.from(s),t.url=Mi(ca(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?pa(c.password):``))),L.isFormData(r)&&(Bi.hasStandardBrowserEnv||Bi.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):L.isFunction(r.getHeaders)&&fa(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Bi.hasStandardBrowserEnv&&(L.isFunction(i)&&(i=i(t)),i===!0||i==null&&ia(t.url))){let e=a&&o&&aa.read(o);e&&s.set(a,e)}return t},ha=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=ma(e),i=r.data,a=R.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=R.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Zi(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new z(`Request aborted`,z.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new z(t&&t.message?t.message:`Network Error`,z.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||V;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new z(t,i.clarifyTimeoutError?z.ETIMEDOUT:z.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&L.forEach(ui(a),function(e,t){h.setRequestHeader(t,e)}),L.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=ta(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=ta(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Xi(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Qi(r.url);if(_&&!Bi.protocols.includes(_)){n(new z(`Unsupported protocol `+_+`:`,z.ERR_BAD_REQUEST,e));return}h.send(i||null)})},ga=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof z?t:new Xi(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new z(`timeout of ${t}ms exceeded`,z.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>L.asap(o),s},_a=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},va=async function*(e,t){for await(let n of ya(e))yield*_a(n,t)},ya=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ba=(e,t,n,r)=>{let i=va(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};function xa(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n<t;n++)if(r.charCodeAt(n)===37&&n+2<t){let t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(typeof Buffer<`u`&&typeof Buffer.byteLength==`function`)return Buffer.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var Sa=`1.16.1`,Ca=64*1024,{isFunction:wa}=L,Ta=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ea=e=>{let t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?wa(i):typeof fetch==`function`,c=wa(a),l=wa(o);if(!s)return!1;let u=s&&wa(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Ta(()=>{let e=!1,t=new a(Bi.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Ta(()=>L.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new z(`Response type '${e}' is not supported`,z.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(L.isBlob(e))return e.size;if(L.isSpecCompliantForm(e))return(await new a(Bi.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(L.isArrayBufferView(e)||L.isArrayBuffer(e))return e.byteLength;if(L.isURLSearchParams(e)&&(e+=``),L.isString(e))return(await d(e)).byteLength},g=async(e,t)=>L.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=ma(e),w=L.isNumber(S)&&S>-1,T=L.isNumber(C)&&C>-1,E=i||fetch;v=v?(v+``).toLowerCase():`text`;let D=ga([l,u&&u.toAbortSignal()],d),O=null,k=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),A;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&xa(t)>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O);if(T&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new z(`Request body larger than maxBodyLength limit`,z.ERR_BAD_REQUEST,e,O)}if(_&&f&&n!==`get`&&n!==`head`&&(A=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(L.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=na(A,ta(ra(_)));s=ba(e.body,Ca,t,n)}}L.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;if(L.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+Sa,!1);let l={...x,signal:D,method:n.toUpperCase(),headers:ui(y.normalize()),body:s,duplex:`half`,credentials:i?b:void 0};O=c&&new a(t,l);let u=await(c?E(O,x):E(t,l));if(w){let t=L.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&k)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=L.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&na(n,ta(ra(h),!0))||[],a=0;u=new o(ba(u.body,Ca,t=>{if(w&&(a=t,a>S))throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O);r&&r(t)},()=>{i&&i(),k&&k()}),t)}v||=`text`;let j=await m[L.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(j!=null&&(typeof j.byteLength==`number`?t=j.byteLength:typeof j.size==`number`?t=j.size:typeof j==`string`&&(t=typeof r==`function`?new r().encode(j).byteLength:j.length)),typeof t==`number`&&t>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O)}return!d&&k&&k(),await new Promise((t,n)=>{Zi(t,n,{data:j,headers:R.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(k&&k(),D&&D.aborted&&D.reason instanceof z){let n=D.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new z(`Network Error`,z.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t}):z.from(t,t&&t.code,e,O,t&&t.response)}}},Da=new Map,Oa=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Da;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Ea(t)),l=c;return c};Oa();var ka={http:null,xhr:ha,fetch:{get:Oa}};L.forEach(ka,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Aa=e=>`- ${e}`,ja=e=>L.isFunction(e)||e===null||e===!1;function Ma(e,t){e=L.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!ja(r)&&(i=ka[(n=String(r)).toLowerCase()],i===void 0))throw new z(`Unknown adapter '${n}'`);if(i&&(L.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new z(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
`+e.map(Aa).join(`
`):` `+Aa(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Na={getAdapter:Ma,adapters:ka};function Pa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xi(null,e)}function Fa(e){return Pa(e),e.headers=R.from(e.headers),e.data=Ji.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Na.getAdapter(e.adapter||qi.adapter,e)(e).then(function(t){Pa(e),e.response=t;try{t.data=Ji.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=R.from(t.headers),t},function(t){if(!Yi(t)&&(Pa(e),t&&t.response)){e.response=t.response;try{t.response.data=Ji.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=R.from(t.response.headers)}return Promise.reject(t)})}var Ia={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Ia[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var La={};Ia.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Sa+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new z(r(i,` has been removed`+(t?` in `+t:``)),z.ERR_DEPRECATED);return t&&!La[i]&&(La[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Ia.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ra(e,t,n){if(typeof e!=`object`)throw new z(`options must be an object`,z.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new z(`option `+a+` must be `+n,z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new z(`Unknown option `+a,z.ERR_BAD_OPTION)}}var za={assertOptions:Ra,validators:Ia},Ba=za.validators,Va=class{constructor(e){this.defaults=e||{},this.interceptors={request:new B,response:new B}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
`),r=t===-1?-1:n.indexOf(`
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=ua(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&za.assertOptions(n,{silentJSONParsing:Ba.transitional(Ba.boolean),forcedJSONParsing:Ba.transitional(Ba.boolean),clarifyTimeoutError:Ba.transitional(Ba.boolean),legacyInterceptorReqResOrdering:Ba.transitional(Ba.boolean)},!1),r!=null&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:za.assertOptions(r,{encode:Ba.function,serialize:Ba.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),za.assertOptions(t,{baseUrl:Ba.spelling(`baseURL`),withXsrfToken:Ba.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&L.merge(i.common,i[t.method]);i&&L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=R.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||V;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Fa.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Fa.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=ua(this.defaults,e),Mi(ca(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};L.forEach([`delete`,`get`,`head`,`options`],function(e){Va.prototype[e]=function(t,n){return this.request(ua(n||{},{method:e,url:t,data:(n||{}).data}))}}),L.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(ua(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Va.prototype[e]=t(),e!==`query`&&(Va.prototype[e+`Form`]=t(!0))});var Ha=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Xi(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Ua(e){return function(t){return e.apply(null,t)}}function Wa(e){return L.isObject(e)&&e.isAxiosError===!0}var Ga={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ga).forEach(([e,t])=>{Ga[t]=e});function Ka(e){let t=new Va(e),n=Gn(Va.prototype.request,t);return L.extend(n,Va.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Ka(ua(e,t))},n}var H=Ka(qi);H.Axios=Va,H.CanceledError=Xi,H.CancelToken=Ha,H.isCancel=Yi,H.VERSION=Sa,H.toFormData=Di,H.AxiosError=z,H.Cancel=H.CanceledError,H.all=function(e){return Promise.all(e)},H.spread=Ua,H.isAxiosError=Wa,H.mergeConfig=ua,H.AxiosHeaders=R,H.formToJSON=e=>Wi(L.isHTMLForm(e)?new FormData(e):e),H.getAdapter=Na.getAdapter,H.HttpStatusCode=Ga,H.default=H;var qa=H.create({baseURL:`/api`});qa.interceptors.request.use(e=>{let t=localStorage.getItem(`token`);return t&&(e.headers.Authorization=`Bearer ${t}`),e});var Ja=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),U=o(((e,t)=>{t.exports=Ja()}))(),Ya=(0,v.createContext)(null),Xa=({children:e})=>{let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{localStorage.getItem(`token`)?qa.get(`/auth/me`).then(e=>{n(e.data)}).catch(()=>{localStorage.removeItem(`token`)}).finally(()=>i(!1)):i(!1)},[]),(0,U.jsx)(Ya.Provider,{value:{user:t,loading:r,login:async(e,t)=>{let{token:r,user:i}=(await qa.post(`/auth/login`,{email:e,password:t})).data;return localStorage.setItem(`token`,r),n(i),i},register:async(e,t)=>{let{token:r,user:i}=(await qa.post(`/auth/register`,{email:e,password:t})).data;return localStorage.setItem(`token`,r),n(i),i},logout:()=>{localStorage.removeItem(`token`),n(null)}},children:e})},Za=()=>(0,v.useContext)(Ya),Qa=()=>{let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),{login:o}=Za(),s=st();return(0,U.jsxs)(`div`,{style:{maxWidth:400,margin:`100px auto`,padding:20,background:`white`,borderRadius:8,boxShadow:`0 2px 8px rgba(0,0,0,0.15)`},children:[(0,U.jsx)(`h2`,{children:`Web-CAD Anmeldung`}),i&&(0,U.jsx)(`p`,{style:{color:`red`},children:i}),(0,U.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),a(``);try{await o(e,n),s(`/dashboard`)}catch(e){a(e.response?.data?.error||`Login fehlgeschlagen`)}},children:[(0,U.jsxs)(`div`,{style:{marginBottom:12},children:[(0,U.jsx)(`label`,{children:`E-Mail`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`input`,{type:`email`,value:e,onChange:e=>t(e.target.value),required:!0,style:{width:`100%`,padding:8,borderRadius:4,border:`1px solid #ccc`}})]}),(0,U.jsxs)(`div`,{style:{marginBottom:16},children:[(0,U.jsx)(`label`,{children:`Passwort`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),required:!0,style:{width:`100%`,padding:8,borderRadius:4,border:`1px solid #ccc`}})]}),(0,U.jsx)(`button`,{type:`submit`,style:{width:`100%`,padding:10,backgroundColor:`#1890ff`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Anmelden`})]}),(0,U.jsxs)(`p`,{style:{marginTop:12,textAlign:`center`},children:[`Kein Konto? `,(0,U.jsx)(Dn,{to:`/register`,children:`Registrieren`})]})]})},$a=()=>{let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),{register:c}=Za(),l=st();return(0,U.jsxs)(`div`,{style:{maxWidth:400,margin:`100px auto`,padding:20,background:`white`,borderRadius:8,boxShadow:`0 2px 8px rgba(0,0,0,0.15)`},children:[(0,U.jsx)(`h2`,{children:`Registrierung`}),o&&(0,U.jsx)(`p`,{style:{color:`red`},children:o}),(0,U.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),s(``),n!==i){s(`Passwörter stimmen nicht überein`);return}try{await c(e,n),l(`/dashboard`)}catch(e){s(e.response?.data?.error||`Registrierung fehlgeschlagen`)}},children:[(0,U.jsxs)(`div`,{style:{marginBottom:12},children:[(0,U.jsx)(`label`,{children:`E-Mail`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`input`,{type:`email`,value:e,onChange:e=>t(e.target.value),required:!0,style:{width:`100%`,padding:8,borderRadius:4,border:`1px solid #ccc`}})]}),(0,U.jsxs)(`div`,{style:{marginBottom:12},children:[(0,U.jsx)(`label`,{children:`Passwort`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),required:!0,style:{width:`100%`,padding:8,borderRadius:4,border:`1px solid #ccc`}})]}),(0,U.jsxs)(`div`,{style:{marginBottom:16},children:[(0,U.jsx)(`label`,{children:`Passwort bestätigen`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`input`,{type:`password`,value:i,onChange:e=>a(e.target.value),required:!0,style:{width:`100%`,padding:8,borderRadius:4,border:`1px solid #ccc`}})]}),(0,U.jsx)(`button`,{type:`submit`,style:{width:`100%`,padding:10,backgroundColor:`#52c41a`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Registrieren`})]}),(0,U.jsxs)(`p`,{style:{marginTop:12,textAlign:`center`},children:[`Bereits registriert? `,(0,U.jsx)(Dn,{to:`/login`,children:`Anmelden`})]})]})},eo=()=>{let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),{user:i,logout:a}=Za(),o=st();(0,v.useEffect)(()=>{qa.get(`/drawings`).then(e=>{t(e.data),r(!1)}).catch(()=>r(!1))},[]);let s=async()=>{try{o(`/editor/${(await qa.post(`/drawings`,{name:`Neue Zeichnung`})).data.id}`)}catch{alert(`Fehler beim Erstellen`)}},c=async n=>{if(confirm(`Zeichnung wirklich löschen?`))try{await qa.delete(`/drawings/${n}`),t(e.filter(e=>e.id!==n))}catch{alert(`Fehler beim Löschen`)}};return n?(0,U.jsx)(`div`,{style:{padding:20},children:`Lade...`}):(0,U.jsxs)(`div`,{style:{maxWidth:800,margin:`20px auto`,padding:20},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,U.jsxs)(`h2`,{children:[`Meine Zeichnungen (`,i?.email,`)`]}),(0,U.jsx)(`button`,{onClick:a,style:{padding:`8px 16px`,backgroundColor:`#ff4d4f`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Abmelden`})]}),(0,U.jsx)(`button`,{onClick:s,style:{padding:`10px 20px`,backgroundColor:`#1890ff`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`,marginBottom:20},children:`Neue Zeichnung`}),e.length===0?(0,U.jsx)(`p`,{children:`Keine Zeichnungen vorhanden.`}):(0,U.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`},children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{style:{textAlign:`left`,padding:8,borderBottom:`1px solid #ddd`},children:`Name`}),(0,U.jsx)(`th`,{style:{textAlign:`left`,padding:8,borderBottom:`1px solid #ddd`},children:`Zuletzt geändert`}),(0,U.jsx)(`th`,{style:{textAlign:`left`,padding:8,borderBottom:`1px solid #ddd`},children:`Aktionen`})]})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{style:{padding:8,borderBottom:`1px solid #eee`},children:e.name}),(0,U.jsx)(`td`,{style:{padding:8,borderBottom:`1px solid #eee`},children:new Date(e.updatedAt).toLocaleString()}),(0,U.jsxs)(`td`,{style:{padding:8,borderBottom:`1px solid #eee`},children:[(0,U.jsx)(`button`,{onClick:()=>o(`/editor/${e.id}`),style:{marginRight:8,padding:`4px 12px`,backgroundColor:`#52c41a`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Öffnen`}),(0,U.jsx)(`button`,{onClick:()=>c(e.id),style:{padding:`4px 12px`,backgroundColor:`#ff4d4f`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Löschen`})]})]},e.id))})]})]})},to=o(((e,t)=>{t.exports={}})),no=o((e=>{var t=t||{version:`5.5.2`};if(e===void 0?typeof define==`function`&&define.amd&&define([],function(){return t}):e.fabric=t,typeof document<`u`&&typeof window<`u`)document instanceof(typeof HTMLDocument<`u`?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(``),t.window=window;else{var n=new(to()).JSDOM(`<!DOCTYPE html><html><head></head><body></body></html>`,{features:{FetchExternalResources:[`img`]},resources:`usable`}).window;t.document=n.document,t.jsdomImplForWrapper=to().implForWrapper,t.nodeCanvas=to().Canvas,t.window=n,DOMParser=t.window.DOMParser}t.isTouchSupported=`ontouchstart`in t.window||`ontouchstart`in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof Buffer<`u`&&typeof window>`u`,t.SHARED_ATTRIBUTES=[`display`,`transform`,`fill`,`fill-opacity`,`fill-rule`,`opacity`,`stroke`,`stroke-dasharray`,`stroke-linecap`,`stroke-dashoffset`,`stroke-linejoin`,`stroke-miterlimit`,`stroke-opacity`,`stroke-width`,`id`,`paint-order`,`vector-effect`,`instantiated_by_use`,`clip-path`],t.DPI=96,t.reNum=`(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)`,t.commaWsp=`(?:\\s+,?\\s*|,\\s*)`,t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS=`http://www.w3.org/2000/svg`,t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){if(t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize))return console.log(`max texture size: `+t.maxTextureSize),new t.WebglFilterBackend({tileSize:t.textureSize});if(t.Canvas2dFilterBackend)return new t.Canvas2dFilterBackend},typeof document<`u`&&typeof window<`u`&&(window.fabric=t),(function(){function e(e,n){if(this.__eventListeners[e]){var r=this.__eventListeners[e];n?r[r.indexOf(n)]=!1:t.util.array.fill(r,!1)}}function n(e,t){if(this.__eventListeners||={},arguments.length===1)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this}function r(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}function i(e,t){if(arguments.length===1)for(var n in e)r.call(this,n,e[n]);else r.call(this,e,t);return this}function a(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)e.call(this,t);else if(arguments.length===1&&typeof arguments[0]==`object`)for(var r in t)e.call(this,r,t[r]);else e.call(this,t,n);return this}function o(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r<i;r++)n[r]&&n[r].call(this,t||{});return this.__eventListeners[e]=n.filter(function(e){return e!==!1}),this}t.Observable={fire:o,on:n,once:i,off:a}})(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var r=this._objects;return n?r[t]=e:r.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e=this._objects,t,n=!1,r=0,i=arguments.length;r<i;r++)t=e.indexOf(arguments[r]),t!==-1&&(n=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var n=this.getObjects(),r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);return this},getObjects:function(e){return e===void 0?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1?!0:t?this._objects.some(function(t){return typeof t.contains==`function`&&t.contains(e,!0)}):!1},complexity:function(){return this._objects.reduce(function(e,t){return e+=t.complexity?t.complexity():0,e},0)}},t.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,n){e&&e.colorStops&&!(e instanceof t.Gradient)&&this.set(n,new t.Gradient(e))},_initPattern:function(e,n,r){e&&e.source&&!(e instanceof t.Pattern)?this.set(n,new t.Pattern(e,r)):r&&r()},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return typeof e==`object`?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return typeof t==`boolean`&&this.set(e,!t),this},get:function(e){return this[e]}},(function(e){var n=Math.sqrt,r=Math.atan2,i=Math.pow,a=Math.PI/180,o=Math.PI/2;t.util={cos:function(e){if(e===0)return 1;switch(e<0&&(e=-e),e/o){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(e===0)return 0;var t=e/o,n=1;switch(e<0&&(n=-1),t){case 1:return n;case 2:return 0;case 3:return-n}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return n!==-1&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*a},radiansToDegrees:function(e){return e/a},rotatePoint:function(e,n,r){var i=new t.Point(e.x-n.x,e.y-n.y),a=t.util.rotateVector(i,r);return new t.Point(a.x,a.y).addEquals(n)},rotateVector:function(e,n){var r=t.util.sin(n),i=t.util.cos(n);return{x:e.x*i-e.y*r,y:e.x*r+e.y*i}},createVector:function(e,n){return new t.Point(n.x-e.x,n.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new t.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,n,r){var i=t.util.createVector(e,n),a=t.util.createVector(e,r),o=t.util.calcAngleBetweenVectors(i,a),s=o*(t.util.calcAngleBetweenVectors(t.util.rotateVector(i,o),a)===0?1:-1)/2;return{vector:t.util.getHatVector(t.util.rotateVector(i,s)),angle:o}},projectStrokeOnPoints:function(e,n,r){var i=[],a=n.strokeWidth/2,o=n.strokeUniform?new t.Point(1/n.scaleX,1/n.scaleY):new t.Point(1,1),s=function(e){var n=a/Math.hypot(e.x,e.y);return new t.Point(e.x*n*o.x,e.y*n*o.y)};return e.length<=1||e.forEach(function(c,l){var u=new t.Point(c.x,c.y),d,f;l===0?(f=e[l+1],d=r?s(t.util.createVector(f,u)).addEquals(u):e[e.length-1]):l===e.length-1?(d=e[l-1],f=r?s(t.util.createVector(d,u)).addEquals(u):e[0]):(d=e[l-1],f=e[l+1]);var p=t.util.getBisector(u,d,f),m=p.vector,h=p.angle,g,_;if(n.strokeLineJoin===`miter`&&(g=-a/Math.sin(h/2),_=new t.Point(m.x*g*o.x,m.y*g*o.y),Math.hypot(_.x,_.y)/a<=n.strokeMiterLimit)){i.push(u.add(_)),i.push(u.subtract(_));return}g=-a*Math.SQRT2,_=new t.Point(m.x*g*o.x,m.y*g*o.y),i.push(u.add(_)),i.push(u.subtract(_))}),i},transformPoint:function(e,n,r){return r?new t.Point(n[0]*e.x+n[2]*e.y,n[1]*e.x+n[3]*e.y):new t.Point(n[0]*e.x+n[2]*e.y+n[4],n[1]*e.x+n[3]*e.y+n[5])},makeBoundingBoxFromPoints:function(e,n){if(n)for(var r=0;r<e.length;r++)e[r]=t.util.transformPoint(e[r],n);var i=[e[0].x,e[1].x,e[2].x,e[3].x],a=t.util.array.min(i),o=t.util.array.max(i)-a,s=[e[0].y,e[1].y,e[2].y,e[3].y],c=t.util.array.min(s);return{left:a,top:c,width:o,height:t.util.array.max(s)-c}},invertTransform:function(e){var n=1/(e[0]*e[3]-e[1]*e[2]),r=[n*e[3],-n*e[1],-n*e[2],n*e[0]],i=t.util.transformPoint({x:e[4],y:e[5]},r,!0);return r[4]=-i.x,r[5]=-i.y,r},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,n){var r=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(n||=t.Text.DEFAULT_SVG_FONT_SIZE,r[0]){case`mm`:return i*t.DPI/25.4;case`cm`:return i*t.DPI/2.54;case`in`:return i*t.DPI;case`pt`:return i*t.DPI/72;case`pc`:return i*t.DPI/72*12;case`em`:return i*n;default:return i}},falseFunction:function(){return!1},getKlass:function(e,n){return e=t.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),t.util.resolveNamespace(n)[e]},getSvgAttributes:function(e){var t=[`instantiated_by_use`,`style`,`id`,`class`];switch(e){case`linearGradient`:t=t.concat([`x1`,`y1`,`x2`,`y2`,`gradientUnits`,`gradientTransform`]);break;case`radialGradient`:t=t.concat([`gradientUnits`,`gradientTransform`,`cx`,`cy`,`r`,`fx`,`fy`,`fr`]);break;case`stop`:t=t.concat([`offset`,`stop-color`,`stop-opacity`]);break}return t},resolveNamespace:function(n){if(!n)return t;var r=n.split(`.`),i=r.length,a,o=e||t.window;for(a=0;a<i;++a)o=o[r[a]];return o},loadImage:function(e,n,r,i){if(!e){n&&n.call(r,e);return}var a=t.util.createImage(),o=function(){n&&n.call(r,a,!1),a=a.onload=a.onerror=null};a.onload=o,a.onerror=function(){t.log(`Error loading `+a.src),n&&n.call(r,null,!0),a=a.onload=a.onerror=null},e.indexOf(`data`)!==0&&i!=null&&(a.crossOrigin=i),e.substring(0,14)===`data:image/svg`&&(a.onload=null,t.util.loadImageInDom(a,o)),a.src=e},loadImageInDom:function(e,n){var r=t.document.createElement(`div`);r.style.width=r.style.height=`1px`,r.style.left=r.style.top=`-100%`,r.style.position=`absolute`,r.appendChild(e),t.document.querySelector(`body`).appendChild(r),e.onload=function(){n(),r.parentNode.removeChild(r),r=null}},enlivenObjects:function(e,n,r,i){e||=[];var a=[],o=0,s=e.length;function c(){++o===s&&n&&n(a.filter(function(e){return e}))}if(!s){n&&n(a);return}e.forEach(function(e,n){if(!e||!e.type){c();return}t.util.getKlass(e.type,r).fromObject(e,function(t,r){r||(a[n]=t),i&&i(e,t,r),c()})})},enlivenObjectEnlivables:function(e,n,r){var i=t.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});t.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var t={};i.forEach(function(r,i){t[r]=e[i],n&&(n[r]=e[i])}),r&&r(t)})},enlivenPatterns:function(e,n){e||=[];function r(){++a===o&&n&&n(i)}var i=[],a=0,o=e.length;if(!o){n&&n(i);return}e.forEach(function(e,n){e&&e.source?new t.Pattern(e,function(e){i[n]=e,r()}):(i[n]=e,r())})},groupSVGElements:function(e,n,r){var i;return e&&e.length===1?(r!==void 0&&(e[0].sourcePath=r),e[0]):(n&&(n.width&&n.height?n.centerPoint={x:n.width/2,y:n.height/2}:(delete n.width,delete n.height)),i=new t.Group(e,n),r!==void 0&&(i.sourcePath=r),i)},populateWithProperties:function(e,t,n){if(n&&Array.isArray(n))for(var r=0,i=n.length;r<i;r++)n[r]in e&&(t[n[r]]=e[n[r]])},createCanvasElement:function(){return t.document.createElement(`canvas`)},copyCanvasElement:function(e){var n=t.util.createCanvasElement();return n.width=e.width,n.height=e.height,n.getContext(`2d`).drawImage(e,0,0),n},toDataURL:function(e,t,n){return e.toDataURL(`image/`+t,n)},createImage:function(){return t.document.createElement(`img`)},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=r(e[1],e[0]),o=i(e[0],2)+i(e[1],2),s=n(o),c=(e[0]*e[3]-e[2]*e[1])/s,l=r(e[0]*e[2]+e[1]*e[3],o);return{angle:t/a,scaleX:s,scaleY:c,skewX:l/a,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return t.iMatrix.concat();var n=t.util.degreesToRadians(e.angle),r=t.util.cos(n),i=t.util.sin(n);return[r,i,-i,r,0,0]},calcDimensionsMatrix:function(e){var n=e.scaleX===void 0?1:e.scaleX,r=e.scaleY===void 0?1:e.scaleY,i=[e.flipX?-n:n,0,0,e.flipY?-r:r,0,0],a=t.util.multiplyTransformMatrices,o=t.util.degreesToRadians;return e.skewX&&(i=a(i,[1,0,Math.tan(o(e.skewX)),1],!0)),e.skewY&&(i=a(i,[1,Math.tan(o(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var n=[1,0,0,1,e.translateX||0,e.translateY||0],r=t.util.multiplyTransformMatrices;return e.angle&&(n=r(n,t.util.calcRotateMatrix(e))),(e.scaleX!==1||e.scaleY!==1||e.skewX||e.skewY||e.flipX||e.flipY)&&(n=r(n,t.util.calcDimensionsMatrix(e))),n},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i=!0,a,o,s=e.getImageData(t,n,r*2||1,r*2||1),c=s.data.length;for(a=3;a<c&&(o=s.data[a],i=o<=0,i!==!1);a+=4);return s=null,i},parsePreserveAspectRatioAttribute:function(e){var t=`meet`,n=`Mid`,r=`Mid`,i=e.split(` `),a;return i&&i.length&&(t=i.pop(),t!==`meet`&&t!==`slice`?(a=t,t=`meet`):i.length&&(a=i.pop())),n=a===`none`?`none`:a.slice(1,4),r=a===`none`?`none`:a.slice(5,8),{meetOrSlice:t,alignX:n,alignY:r}},clearFabricFontCache:function(e){e=(e||``).toLowerCase(),e?t.charWidthsCache[e]&&delete t.charWidthsCache[e]:t.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),r=Math.floor(t/n);return{x:Math.floor(n),y:r}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return`matrix(`+e.map(function(e){return t.util.toFixed(e,t.Object.NUM_FRACTION_DIGITS)}).join(` `)+`)`},removeTransformFromObject:function(e,n){var r=t.util.invertTransform(n),i=t.util.multiplyTransformMatrices(r,e.calcOwnMatrix());t.util.applyTransformToObject(e,i)},addTransformToObject:function(e,n){t.util.applyTransformToObject(e,t.util.multiplyTransformMatrices(n,e.calcOwnMatrix()))},applyTransformToObject:function(e,n){var r=t.util.qrDecompose(n),i=new t.Point(r.translateX,r.translateY);e.flipX=!1,e.flipY=!1,e.set(`scaleX`,r.scaleX),e.set(`scaleY`,r.scaleY),e.skewX=r.skewX,e.skewY=r.skewY,e.angle=r.angle,e.setPositionByOrigin(i,`center`,`center`)},sizeAfterTransform:function(e,n,r){var i=e/2,a=n/2,o=[{x:-i,y:-a},{x:i,y:-a},{x:-i,y:a},{x:i,y:a}],s=t.util.calcDimensionsMatrix(r),c=t.util.makeBoundingBoxFromPoints(o,s);return{x:c.width,y:c.height}},mergeClipPaths:function(e,n){var r=e,i=n;r.inverted&&!i.inverted&&(r=n,i=e),t.util.applyTransformToObject(i,t.util.multiplyTransformMatrices(t.util.invertTransform(r.calcTransformMatrix()),i.calcTransformMatrix()));var a=r.inverted&&i.inverted;return a&&(r.inverted=i.inverted=!1),new t.Group([r],{clipPath:i,inverted:a})},hasStyleChanged:function(e,t,n){return n||=!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||n&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,n){for(var e=t.util.object.clone(e,!0),r=n.split(`
`),i=-1,a={},o=[],s=0;s<r.length;s++){if(!e[s]){i+=r[s].length;continue}for(var c=0;c<r[s].length;c++){i++;var l=e[s][c];l&&Object.keys(l).length>0&&(t.util.hasStyleChanged(a,l,!0)?o.push({start:i,end:i+1,style:l}):o[o.length-1].end++),a=l||{}}}return o},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var n=t.split(`
`),r=-1,i=0,a={},o=0;o<n.length;o++)for(var s=0;s<n[o].length;s++)r++,e[i]&&e[i].start<=r&&r<e[i].end&&(a[o]=a[o]||{},a[o][s]=Object.assign({},e[i].style),r===e[i].end-1&&i++);return a}}})(e),(function(){var e=Array.prototype.join,n={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},r={m:`l`,M:`L`};function i(e,n,r,i,a,o,s,c,l,u,d){var f=t.util.cos(e),p=t.util.sin(e),m=t.util.cos(n),h=t.util.sin(n),g=r*a*m-i*o*h+s,_=i*a*m+r*o*h+c;return[`C`,u+l*(-r*a*p-i*o*f),d+l*(-i*a*p+r*o*f),g+l*(r*a*h+i*o*m),_+l*(i*a*h-r*o*m),g,_]}function a(e,n,r,a,s,c,l){var u=Math.PI,d=l*u/180,f=t.util.sin(d),p=t.util.cos(d),m=0,h=0;r=Math.abs(r),a=Math.abs(a);var g=-p*e*.5-f*n*.5,_=-p*n*.5+f*e*.5,v=r*r,y=a*a,b=_*_,x=g*g,S=v*y-v*b-y*x,C=0;if(S<0){var w=Math.sqrt(1-S/(v*y));r*=w,a*=w}else C=(s===c?-1:1)*Math.sqrt(S/(v*b+y*x));var T=C*r*_/a,E=-C*a*g/r,D=p*T-f*E+e*.5,O=f*T+p*E+n*.5,k=o(1,0,(g-T)/r,(_-E)/a),A=o((g-T)/r,(_-E)/a,(-g-T)/r,(-_-E)/a);c===0&&A>0?A-=2*u:c===1&&A<0&&(A+=2*u);for(var j=Math.ceil(Math.abs(A/u*2)),M=[],N=A/j,ee=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),te=k+N,P=0;P<j;P++)M[P]=i(k,te,p,f,r,a,D,O,ee,m,h),m=M[P][5],h=M[P][6],k=te,te+=N;return M}function o(e,t,n,r){var i=Math.atan2(t,e),a=Math.atan2(r,n);return a>=i?a-i:2*Math.PI-(i-a)}function s(n,r,i,a,o,s,c,l){var u;if(t.cachesBoundsOfCurve&&(u=e.call(arguments),t.boundsOfCurveCache[u]))return t.boundsOfCurveCache[u];var d=Math.sqrt,f=Math.min,p=Math.max,m=Math.abs,h=[],g=[[],[]],_,v=6*n-12*i+6*o,y,b,x,S,C,w;_=-3*n+9*i-9*o+3*c,y=3*i-3*n;for(var T=0;T<2;++T){if(T>0&&(v=6*r-12*a+6*s,_=-3*r+9*a-9*s+3*l,y=3*a-3*r),m(_)<1e-12){if(m(v)<1e-12)continue;b=-y/v,0<b&&b<1&&h.push(b);continue}C=v*v-4*y*_,!(C<0)&&(w=d(C),x=(-v+w)/(2*_),0<x&&x<1&&h.push(x),S=(-v-w)/(2*_),0<S&&S<1&&h.push(S))}for(var E,D,O=h.length,k=O,A;O--;)b=h[O],A=1-b,E=A*A*A*n+3*A*A*b*i+3*A*b*b*o+b*b*b*c,g[0][O]=E,D=A*A*A*r+3*A*A*b*a+3*A*b*b*s+b*b*b*l,g[1][O]=D;g[0][k]=n,g[1][k]=r,g[0][k+1]=c,g[1][k+1]=l;var j=[{x:f.apply(null,g[0]),y:f.apply(null,g[1])},{x:p.apply(null,g[0]),y:p.apply(null,g[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[u]=j),j}function c(e,t,n){for(var r=n[1],i=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=a(l-e,u-t,r,i,s,c,o),f=0,p=d.length;f<p;f++)d[f][1]+=e,d[f][2]+=t,d[f][3]+=e,d[f][4]+=t,d[f][5]+=e,d[f][6]+=t;return d}function l(e){var t=0,n=0,r=e.length,i=0,a=0,o,s,l,u=[],d,f,p;for(s=0;s<r;++s){switch(l=!1,o=e[s].slice(0),o[0]){case`l`:o[0]=`L`,o[1]+=t,o[2]+=n;case`L`:t=o[1],n=o[2];break;case`h`:o[1]+=t;case`H`:o[0]=`L`,o[2]=n,t=o[1];break;case`v`:o[1]+=n;case`V`:o[0]=`L`,n=o[1],o[1]=t,o[2]=n;break;case`m`:o[0]=`M`,o[1]+=t,o[2]+=n;case`M`:t=o[1],n=o[2],i=o[1],a=o[2];break;case`c`:o[0]=`C`,o[1]+=t,o[2]+=n,o[3]+=t,o[4]+=n,o[5]+=t,o[6]+=n;case`C`:f=o[3],p=o[4],t=o[5],n=o[6];break;case`s`:o[0]=`S`,o[1]+=t,o[2]+=n,o[3]+=t,o[4]+=n;case`S`:d===`C`?(f=2*t-f,p=2*n-p):(f=t,p=n),t=o[3],n=o[4],o[0]=`C`,o[5]=o[3],o[6]=o[4],o[3]=o[1],o[4]=o[2],o[1]=f,o[2]=p,f=o[3],p=o[4];break;case`q`:o[0]=`Q`,o[1]+=t,o[2]+=n,o[3]+=t,o[4]+=n;case`Q`:f=o[1],p=o[2],t=o[3],n=o[4];break;case`t`:o[0]=`T`,o[1]+=t,o[2]+=n;case`T`:d===`Q`?(f=2*t-f,p=2*n-p):(f=t,p=n),o[0]=`Q`,t=o[1],n=o[2],o[1]=f,o[2]=p,o[3]=t,o[4]=n;break;case`a`:o[0]=`A`,o[6]+=t,o[7]+=n;case`A`:l=!0,u=u.concat(c(t,n,o)),t=o[6],n=o[7];break;case`z`:case`Z`:t=i,n=a;break;default:}l||u.push(o),d=o[0]}return u}function u(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}function d(e){return e*e*e}function f(e){return 3*e*e*(1-e)}function p(e){return 3*e*(1-e)*(1-e)}function m(e){return(1-e)*(1-e)*(1-e)}function h(e,t,n,r,i,a,o,s){return function(c){var l=d(c),u=f(c),h=p(c),g=m(c);return{x:o*l+i*u+n*h+e*g,y:s*l+a*u+r*h+t*g}}}function g(e,t,n,r,i,a,o,s){return function(c){var l=1-c,u=3*l*l*(n-e)+6*l*c*(i-n)+3*c*c*(o-i),d=3*l*l*(r-t)+6*l*c*(a-r)+3*c*c*(s-a);return Math.atan2(d,u)}}function _(e){return e*e}function v(e){return 2*e*(1-e)}function y(e){return(1-e)*(1-e)}function b(e,t,n,r,i,a){return function(o){var s=_(o),c=v(o),l=y(o);return{x:i*s+n*c+e*l,y:a*s+r*c+t*l}}}function x(e,t,n,r,i,a){return function(o){var s=1-o,c=2*s*(n-e)+2*o*(i-n),l=2*s*(r-t)+2*o*(a-r);return Math.atan2(l,c)}}function S(e,t,n){var r={x:t,y:n},i,a=0,o;for(o=1;o<=100;o+=1)i=e(o/100),a+=u(r.x,r.y,i.x,i.y),r=i;return a}function C(e,t){for(var n=0,r=0,i=e.iterator,a={x:e.x,y:e.y},o,s,c=.01,l=e.angleFinder,d;r<t&&c>1e-4;)o=i(n),d=n,s=u(a.x,a.y,o.x,o.y),s+r>t?(n-=c,c/=2):(a=o,n+=c,r+=s);return o.angle=l(d),o}function w(e){for(var t=0,n=e.length,r,i=0,a=0,o=0,s=0,c=[],l,d,f,p=0;p<n;p++){switch(r=e[p],d={x:i,y:a,command:r[0]},r[0]){case`M`:d.length=0,o=i=r[1],s=a=r[2];break;case`L`:d.length=u(i,a,r[1],r[2]),i=r[1],a=r[2];break;case`C`:l=h(i,a,r[1],r[2],r[3],r[4],r[5],r[6]),f=g(i,a,r[1],r[2],r[3],r[4],r[5],r[6]),d.iterator=l,d.angleFinder=f,d.length=S(l,i,a),i=r[5],a=r[6];break;case`Q`:l=b(i,a,r[1],r[2],r[3],r[4]),f=x(i,a,r[1],r[2],r[3],r[4]),d.iterator=l,d.angleFinder=f,d.length=S(l,i,a),i=r[3],a=r[4];break;case`Z`:case`z`:d.destX=o,d.destY=s,d.length=u(i,a,o,s),i=o,a=s;break}t+=d.length,c.push(d)}return c.push({length:t,x:i,y:a}),c}function T(e,n,r){r||=w(e);for(var i=0;n-r[i].length>0&&i<r.length-2;)n-=r[i].length,i++;var a=r[i],o=n/a.length,s=a.command,c=e[i],l;switch(s){case`M`:return{x:a.x,y:a.y,angle:0};case`Z`:case`z`:return l=new t.Point(a.x,a.y).lerp(new t.Point(a.destX,a.destY),o),l.angle=Math.atan2(a.destY-a.y,a.destX-a.x),l;case`L`:return l=new t.Point(a.x,a.y).lerp(new t.Point(c[1],c[2]),o),l.angle=Math.atan2(c[2]-a.y,c[1]-a.x),l;case`C`:return C(a,n);case`Q`:return C(a,n)}}function E(e){var i=[],a=[],o,s,c=t.rePathCommand,l=`[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*`,u=`(`+l+`)`+t.commaWsp,d=`([01])`+t.commaWsp+`?`,f=u+`?`+u+`?`+u+d+d+u+`?(`+l+`)`,p=new RegExp(f,`g`),m,h,g;if(!e||!e.match)return i;g=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);for(var _=0,v,y=g.length;_<y;_++){o=g[_],h=o.slice(1).trim(),a.length=0;var b=o.charAt(0);if(v=[b],b.toLowerCase()===`a`)for(var x;x=p.exec(h);)for(var S=1;S<x.length;S++)a.push(x[S]);else for(;m=c.exec(h);)a.push(m[0]);for(var S=0,C=a.length;S<C;S++)s=parseFloat(a[S]),isNaN(s)||v.push(s);var w=n[b.toLowerCase()],T=r[b]||b;if(v.length-1>w)for(var E=1,D=v.length;E<D;E+=w)i.push([b].concat(v.slice(E,E+w))),b=T;else i.push(v)}return i}function D(e,n){var r=[],i,a=new t.Point(e[0].x,e[0].y),o=new t.Point(e[1].x,e[1].y),s=e.length,c=1,l=0,u=s>2;for(n||=0,u&&(c=e[2].x<o.x?-1:e[2].x===o.x?0:1,l=e[2].y<o.y?-1:e[2].y===o.y?0:1),r.push([`M`,a.x-c*n,a.y-l*n]),i=1;i<s;i++){if(!a.eq(o)){var d=a.midPointFrom(o);r.push([`Q`,a.x,a.y,d.x,d.y])}a=e[i],i+1<e.length&&(o=e[i+1])}return u&&(c=a.x>e[i-2].x?1:a.x===e[i-2].x?0:-1,l=a.y>e[i-2].y?1:a.y===e[i-2].y?0:-1),r.push([`L`,a.x+c*n,a.y+l*n]),r}function O(e,n,r){return r&&(n=t.util.multiplyTransformMatrices(n,[1,0,0,1,-r.x,-r.y])),e.map(function(e){for(var r=e.slice(0),i={},a=1;a<e.length-1;a+=2)i.x=e[a],i.y=e[a+1],i=t.util.transformPoint(i,n),r[a]=i.x,r[a+1]=i.y;return r})}t.util.joinPath=function(e){return e.map(function(e){return e.join(` `)}).join(` `)},t.util.parsePath=E,t.util.makePathSimpler=l,t.util.getSmoothPathFromPoints=D,t.util.getPathSegmentsInfo=w,t.util.getBoundsOfCurve=s,t.util.getPointOnPath=T,t.util.transformPath=O})(),(function(){var e=Array.prototype.slice;function n(t,n){for(var r=e.call(arguments,2),i=[],a=0,o=t.length;a<o;a++)i[a]=r.length?t[a][n].apply(t[a],r):t[a][n].call(t[a]);return i}function r(e,t){return o(e,t,function(e,t){return e>=t})}function i(e,t){return o(e,t,function(e,t){return e<t})}function a(e,t){for(var n=e.length;n--;)e[n]=t;return e}function o(e,t,n){if(!(!e||e.length===0)){var r=e.length-1,i=t?e[r][t]:e[r];if(t)for(;r--;)n(e[r][t],i)&&(i=e[r][t]);else for(;r--;)n(e[r],i)&&(i=e[r]);return i}}t.util.array={fill:a,invoke:n,min:i,max:r}})(),(function(){function e(n,r,i){if(i)if(!t.isLikelyNode&&r instanceof Element)n=r;else if(r instanceof Array){n=[];for(var a=0,o=r.length;a<o;a++)n[a]=e({},r[a],i)}else if(r&&typeof r==`object`)for(var s in r)s===`canvas`||s===`group`?n[s]=null:r.hasOwnProperty(s)&&(n[s]=e({},r[s],i));else n=r;else for(var s in r)n[s]=r[s];return n}function n(t,n){return e({},t,n)}t.util.object={extend:e,clone:n},t.util.object.extend(t.util,t.Observable)})(),(function(){function e(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():``})}function n(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())}function r(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function i(e){var t=0,n,r=[];for(t=0;t<e.length;t++)(n=a(e,t))!==!1&&r.push(n);return r}function a(e,t){var n=e.charCodeAt(t);if(isNaN(n))return``;if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw`High surrogate without following low surrogate`;var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw`High surrogate without following low surrogate`;return e.charAt(t)+e.charAt(t+1)}if(t===0)throw`Low surrogate without preceding high surrogate`;var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw`Low surrogate without preceding high surrogate`;return!1}t.util.string={camelize:e,capitalize:n,escapeXml:r,graphemeSplit:i}})(),(function(){var e=Array.prototype.slice,n=function(){},r=(function(){for(var e in{toString:1})if(e===`toString`)return!1;return!0})(),i=function(e,t,n){for(var i in t)i in e.prototype&&typeof e.prototype[i]==`function`&&(t[i]+``).indexOf(`callSuper`)>-1?e.prototype[i]=(function(e){return function(){var r=this.constructor.superclass;this.constructor.superclass=n;var i=t[e].apply(this,arguments);if(this.constructor.superclass=r,e!==`initialize`)return i}})(i):e.prototype[i]=t[i],r&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function a(){}function o(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):console.log(`tried to callSuper `+t+`, method not found in prototype chain`,this)}function s(){var t=null,r=e.call(arguments,0);typeof r[0]==`function`&&(t=r.shift());function s(){this.initialize.apply(this,arguments)}s.superclass=t,s.subclasses=[],t&&(a.prototype=t.prototype,s.prototype=new a,t.subclasses.push(s));for(var c=0,l=r.length;c<l;c++)i(s,r[c],t);return s.prototype.initialize||(s.prototype.initialize=n),s.prototype.constructor=s,s.prototype.callSuper=o,s}t.util.createClass=s})(),(function(){var e=!!t.document.createElement(`div`).attachEvent,n=[`touchstart`,`touchmove`,`touchend`];t.util.addListener=function(t,n,r,i){t&&t.addEventListener(n,r,e?!1:i)},t.util.removeListener=function(t,n,r,i){t&&t.removeEventListener(n,r,e?!1:i)};function r(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}t.util.getPointer=function(e){var n=e.target,i=t.util.getScrollLeftTop(n),a=r(e);return{x:a.clientX+i.left,y:a.clientY+i.top}},t.util.isTouchEvent=function(e){return n.indexOf(e.type)>-1||e.pointerType===`touch`}})(),(function(){function e(e,t){var n=e.style;if(!n)return e;if(typeof t==`string`)return e.style.cssText+=`;`+t,t.indexOf(`opacity`)>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)if(r===`opacity`)o(e,t[r]);else{var i=r===`float`||r===`cssFloat`?n.styleFloat===void 0?`cssFloat`:`styleFloat`:r;n.setProperty(i,t[r])}return e}var n=t.document.createElement(`div`),r=typeof n.style.opacity==`string`,i=typeof n.style.filter==`string`,a=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};r?o=function(e,t){return e.style.opacity=t,e}:i&&(o=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),a.test(n.filter)?(t=t>=.9999?``:`alpha(opacity=`+t*100+`)`,n.filter=n.filter.replace(a,t)):n.filter+=` alpha(opacity=`+t*100+`)`,e}),t.util.setStyle=e})(),(function(){var e=Array.prototype.slice;function n(e){return typeof e==`string`?t.document.getElementById(e):e}var r,i=function(t){return e.call(t,0)};try{r=i(t.document.childNodes)instanceof Array}catch{}r||(i=function(e){for(var t=Array(e.length),n=e.length;n--;)t[n]=e[n];return t});function a(e,n){var r=t.document.createElement(e);for(var i in n)i===`class`?r.className=n[i]:i===`for`?r.htmlFor=n[i]:r.setAttribute(i,n[i]);return r}function o(e,t){e&&(` `+e.className+` `).indexOf(` `+t+` `)===-1&&(e.className+=(e.className?` `:``)+t)}function s(e,t,n){return typeof t==`string`&&(t=a(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t}function c(e){for(var n=0,r=0,i=t.document.documentElement,a=t.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&(e=e.parentNode||e.host,e===t.document?(n=a.scrollLeft||i.scrollLeft||0,r=a.scrollTop||i.scrollTop||0):(n+=e.scrollLeft||0,r+=e.scrollTop||0),!(e.nodeType===1&&e.style.position===`fixed`)););return{left:n,top:r}}function l(e){var t,n=e&&e.ownerDocument,r={left:0,top:0},i={left:0,top:0},a,o={borderLeftWidth:`left`,borderTopWidth:`top`,paddingLeft:`left`,paddingTop:`top`};if(!n)return i;for(var s in o)i[o[s]]+=parseInt(u(e,s),10)||0;return t=n.documentElement,e.getBoundingClientRect!==void 0&&(r=e.getBoundingClientRect()),a=c(e),{left:r.left+a.left-(t.clientLeft||0)+i.left,top:r.top+a.top-(t.clientTop||0)+i.top}}var u=t.document.defaultView&&t.document.defaultView.getComputedStyle?function(e,n){var r=t.document.defaultView.getComputedStyle(e,null);return r?r[n]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n};(function(){var e=t.document.documentElement.style,n=`userSelect`in e?`userSelect`:`MozUserSelect`in e?`MozUserSelect`:`WebkitUserSelect`in e?`WebkitUserSelect`:`KhtmlUserSelect`in e?`KhtmlUserSelect`:``;function r(e){return e.onselectstart!==void 0&&(e.onselectstart=t.util.falseFunction),n?e.style[n]=`none`:typeof e.unselectable==`string`&&(e.unselectable=`on`),e}function i(e){return e.onselectstart!==void 0&&(e.onselectstart=null),n?e.style[n]=``:typeof e.unselectable==`string`&&(e.unselectable=``),e}t.util.makeElementUnselectable=r,t.util.makeElementSelectable=i})();function d(e){var n=t.jsdomImplForWrapper(e);return n._canvas||n._image}function f(e){if(t.isLikelyNode){var n=t.jsdomImplForWrapper(e);n&&(n._image=null,n._canvas=null,n._currentSrc=null,n._attributes=null,n._classList=null)}}function p(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t}t.util.setImageSmoothing=p,t.util.getById=n,t.util.toArray=i,t.util.addClass=o,t.util.makeElement=a,t.util.wrapElement=s,t.util.getScrollLeftTop=c,t.util.getElementOffset=l,t.util.getNodeCanvas=d,t.util.cleanUpJsdomNode=f})(),(function(){function e(e,t){return e+(/\?/.test(e)?`&`:`?`)+t}function n(){}function r(r,i){i||={};var a=i.method?i.method.toUpperCase():`GET`,o=i.onComplete||function(){},s=new t.window.XMLHttpRequest,c=i.body||i.parameters;return s.onreadystatechange=function(){s.readyState===4&&(o(s),s.onreadystatechange=n)},a===`GET`&&(c=null,typeof i.parameters==`string`&&(r=e(r,i.parameters))),s.open(a,r,!0),(a===`POST`||a===`PUT`)&&s.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),s.send(c),s}t.util.request=r})(),t.log=console.log,t.warn=console.warn,(function(){var e=t.util.object.extend,n=t.util.object.clone,r=[];t.util.object.extend(r,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return typeof t.target==`object`&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});function i(){return!1}function a(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}function o(r){r||={};var o=!1,s,c=function(){var e=t.runningAnimations.indexOf(s);return e>-1&&t.runningAnimations.splice(e,1)[0]};return s=e(n(r),{cancel:function(){return o=!0,c()},currentValue:`startValue`in r?r.startValue:0,completionRate:0,durationRate:0}),t.runningAnimations.push(s),l(function(e){var t=e||+new Date,n=r.duration||500,u=t+n,d,f=r.onChange||i,p=r.abort||i,m=r.onComplete||i,h=r.easing||a,g=`startValue`in r?r.startValue.length>0:!1,_=`startValue`in r?r.startValue:0,v=`endValue`in r?r.endValue:100,y=r.byValue||(g?_.map(function(e,t){return v[t]-_[t]}):v-_);r.onStart&&r.onStart(),(function e(r){d=r||+new Date;var i=d>u?n:d-t,a=i/n,b=g?_.map(function(e,t){return h(i,_[t],y[t],n)}):h(i,_,y,n),x=Math.abs(g?(b[0]-_[0])/y[0]:(b-_)/y);if(s.currentValue=g?b.slice():b,s.completionRate=x,s.durationRate=a,!o){if(p(b,x,a)){c();return}if(d>u){s.currentValue=g?v.slice():v,s.completionRate=1,s.durationRate=1,f(g?v.slice():v,1,1),m(v,1,1),c();return}else f(b,x,a),l(e)}})(t)}),s.cancel}var s=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(e){return t.window.setTimeout(e,1e3/60)},c=t.window.cancelAnimationFrame||t.window.clearTimeout;function l(){return s.apply(t.window,arguments)}function u(){return c.apply(t.window,arguments)}t.util.animate=o,t.util.requestAnimFrame=l,t.util.cancelAnimFrame=u,t.runningAnimations=r})(),(function(){function e(e,t,n){var r=`rgba(`+parseInt(e[0]+n*(t[0]-e[0]),10)+`,`+parseInt(e[1]+n*(t[1]-e[1]),10)+`,`+parseInt(e[2]+n*(t[2]-e[2]),10);return r+=`,`+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1),r+=`)`,r}function n(n,r,i,a){var o=new t.Color(n).getSource(),s=new t.Color(r).getSource(),c=a.onComplete,l=a.onChange;return a||={},t.util.animate(t.util.object.extend(a,{duration:i||500,startValue:o,endValue:s,byValue:s,easing:function(t,n,r,i){return e(n,r,a.colorEasing?a.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,n,r){if(c)return c(e(s,s,0),n,r)},onChange:function(t,n,r){if(l){if(Array.isArray(t))return l(e(t,t,0),n,r);l(t,n,r)}}}))}t.util.animateColor=n})(),(function(){function e(e,t,n,r){return e<Math.abs(t)?(e=t,r=n/4):r=t===0&&e===0?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:r}}function n(e,t,n){return e.a*2**(10*--t)*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function r(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function i(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t}function a(e,t,n,r){return n*(e/=r)*e*e*e+t}function o(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t}function s(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}function c(e,t,n,r){return n*(e/=r)*e*e*e*e+t}function l(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t}function u(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t}function d(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}function f(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t}function p(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t}function m(e,t,n,r){return e===0?t:n*2**(10*(e/r-1))+t}function h(e,t,n,r){return e===r?t+n:n*(-(2**(-10*e/r))+1)+t}function g(e,t,n,r){return e===0?t:e===r?t+n:(e/=r/2,e<1?n/2*2**(10*(e-1))+t:n/2*(-(2**(-10*--e))+2)+t)}function _(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t}function v(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t}function y(e,t,n,r){return e/=r/2,e<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t}function b(t,r,i,a){var o=1.70158,s=0,c=i;return t===0?r:(t/=a,t===1?r+i:(s||=a*.3,-n(e(c,i,s,o),t,a)+r))}function x(t,n,r,i){var a=1.70158,o=0,s=r;if(t===0)return n;if(t/=i,t===1)return n+r;o||=i*.3;var c=e(s,r,o,a);return c.a*2**(-10*t)*Math.sin((t*i-c.s)*(2*Math.PI)/c.p)+c.c+n}function S(t,r,i,a){var o=1.70158,s=0,c=i;if(t===0)return r;if(t/=a/2,t===2)return r+i;s||=.3*1.5*a;var l=e(c,i,s,o);return t<1?-.5*n(l,t,a)+r:l.a*2**(-10*--t)*Math.sin((t*a-l.s)*(2*Math.PI)/l.p)*.5+l.c+r}function C(e,t,n,r,i){return i===void 0&&(i=1.70158),n*(e/=r)*e*((i+1)*e-i)+t}function w(e,t,n,r,i){return i===void 0&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t}function T(e,t,n,r,i){return i===void 0&&(i=1.70158),e/=r/2,e<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t}function E(e,t,n,r){return n-D(r-e,0,n,r)+t}function D(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}function O(e,t,n,r){return e<r/2?E(e*2,0,n,r)*.5+t:D(e*2-r,0,n,r)*.5+n*.5+t}t.util.ease={easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return e/=r/2,e<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:r,easeInOutCubic:i,easeInQuart:a,easeOutQuart:o,easeInOutQuart:s,easeInQuint:c,easeOutQuint:l,easeInOutQuint:u,easeInSine:d,easeOutSine:f,easeInOutSine:p,easeInExpo:m,easeOutExpo:h,easeInOutExpo:g,easeInCirc:_,easeOutCirc:v,easeInOutCirc:y,easeInElastic:b,easeOutElastic:x,easeInOutElastic:S,easeInBack:C,easeOutBack:w,easeInOutBack:T,easeInBounce:E,easeOutBounce:D,easeInOutBounce:O}})(),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,a=t.util.parseUnit,o=t.util.multiplyTransformMatrices,s=[`path`,`circle`,`polygon`,`polyline`,`ellipse`,`rect`,`line`,`image`,`text`],c=[`symbol`,`image`,`marker`,`pattern`,`view`,`svg`],l=[`pattern`,`defs`,`symbol`,`metadata`,`clipPath`,`mask`,`desc`],u=[`symbol`,`g`,`a`,`svg`,`clipPath`,`defs`],d={cx:`left`,x:`left`,r:`radius`,cy:`top`,y:`top`,display:`visible`,visibility:`visible`,transform:`transformMatrix`,"fill-opacity":`fillOpacity`,"fill-rule":`fillRule`,"font-family":`fontFamily`,"font-size":`fontSize`,"font-style":`fontStyle`,"font-weight":`fontWeight`,"letter-spacing":`charSpacing`,"paint-order":`paintFirst`,"stroke-dasharray":`strokeDashArray`,"stroke-dashoffset":`strokeDashOffset`,"stroke-linecap":`strokeLineCap`,"stroke-linejoin":`strokeLineJoin`,"stroke-miterlimit":`strokeMiterLimit`,"stroke-opacity":`strokeOpacity`,"stroke-width":`strokeWidth`,"text-decoration":`textDecoration`,"text-anchor":`textAnchor`,opacity:`opacity`,"clip-path":`clipPath`,"clip-rule":`clipRule`,"vector-effect":`strokeUniform`,"image-rendering":`imageSmoothing`},f={stroke:`strokeOpacity`,fill:`fillOpacity`},p=`font-size`,m=`clip-path`;t.svgValidTagNamesRegEx=_(s),t.svgViewBoxElementsRegEx=_(c),t.svgInvalidAncestorsRegEx=_(l),t.svgValidParentsRegEx=_(u),t.cssRules={},t.gradientDefs={},t.clipPaths={};function h(e){return e in d?d[e]:e}function g(e,n,r,i){var s=Array.isArray(n),c;if((e===`fill`||e===`stroke`)&&n===`none`)n=``;else if(e===`strokeUniform`)return n===`non-scaling-stroke`;else if(e===`strokeDashArray`)n=n===`none`?null:n.replace(/,/g,` `).split(/\s+/).map(parseFloat);else if(e===`transformMatrix`)n=r&&r.transformMatrix?o(r.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if(e===`visible`)n=n!==`none`&&n!==`hidden`,r&&r.visible===!1&&(n=!1);else if(e===`opacity`)n=parseFloat(n),r&&r.opacity!==void 0&&(n*=r.opacity);else if(e===`textAnchor`)n=n===`start`?`left`:n===`end`?`right`:`center`;else if(e===`charSpacing`)c=a(n,i)/i*1e3;else if(e===`paintFirst`){var l=n.indexOf(`fill`),u=n.indexOf(`stroke`),n=`fill`;(l>-1&&u>-1&&u<l||l===-1&&u>-1)&&(n=`stroke`)}else if(e===`href`||e===`xlink:href`||e===`font`)return n;else if(e===`imageSmoothing`)return n===`optimizeQuality`;else c=s?n.map(a):a(n,i);return!s&&isNaN(c)?n:c}function _(e){return RegExp(`^(`+e.join(`|`)+`)\\b`,`i`)}function v(e){for(var n in f)if(!(e[f[n]]===void 0||e[n]===``)){if(e[n]===void 0){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(e[n].indexOf(`url(`)!==0){var r=new t.Color(e[n]);e[n]=r.setAlpha(i(r.getAlpha()*e[f[n]],2)).toRgba()}}return e}function y(e,t){var n,r=[],i,a,o;for(a=0,o=t.length;a<o;a++)n=t[a],i=e.getElementsByTagName(n),r=r.concat(Array.prototype.slice.call(i));return r}t.parseTransformAttribute=(function(){function e(e,n){var r=t.util.cos(n[0]),i=t.util.sin(n[0]),a=0,o=0;n.length===3&&(a=n[1],o=n[2]),e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=a-(r*a-i*o),e[5]=o-(i*a+r*o)}function n(e,t){var n=t[0],r=t.length===2?t[1]:t[0];e[0]=n,e[3]=r}function r(e,n,r){e[r]=Math.tan(t.util.degreesToRadians(n[0]))}function i(e,t){e[4]=t[0],t.length===2&&(e[5]=t[1])}var a=t.iMatrix,o=t.reNum,s=t.commaWsp,c=`(?:(skewX)\\s*\\(\\s*(`+o+`)\\s*\\))`,l=`(?:(skewY)\\s*\\(\\s*(`+o+`)\\s*\\))`,u=`(?:(rotate)\\s*\\(\\s*(`+o+`)(?:`+s+`(`+o+`)`+s+`(`+o+`))?\\s*\\))`,d=`(?:(scale)\\s*\\(\\s*(`+o+`)(?:`+s+`(`+o+`))?\\s*\\))`,f=`(?:(translate)\\s*\\(\\s*(`+o+`)(?:`+s+`(`+o+`))?\\s*\\))`,p=`(?:`+(`(?:(matrix)\\s*\\(\\s*(`+o+`)`+s+`(`+o+`)`+s+`(`+o+`)`+s+`(`+o+`)`+s+`(`+o+`)`+s+`(`+o+`)\\s*\\))`)+`|`+f+`|`+d+`|`+u+`|`+c+`|`+l+`)`,m=`^\\s*(?:`+(`(?:`+p+`(?:`+s+`*`+p+`)*)`)+`?)\\s*$`,h=new RegExp(m),g=new RegExp(p,`g`);return function(o){var s=a.concat(),c=[];if(!o||o&&!h.test(o))return s;o.replace(g,function(o){var l=new RegExp(p).exec(o).filter(function(e){return!!e}),u=l[1],d=l.slice(2).map(parseFloat);switch(u){case`translate`:i(s,d);break;case`rotate`:d[0]=t.util.degreesToRadians(d[0]),e(s,d);break;case`scale`:n(s,d);break;case`skewX`:r(s,d,2);break;case`skewY`:r(s,d,1);break;case`matrix`:s=d;break}c.push(s.concat()),s=a.concat()});for(var l=c[0];c.length>1;)c.shift(),l=t.util.multiplyTransformMatrices(l,c[0]);return l}})();function b(e,t){var n,r;e.replace(/;\s*$/,``).split(`;`).forEach(function(e){var i=e.split(`:`);n=i[0].trim().toLowerCase(),r=i[1].trim(),t[n]=r})}function x(e,t){var n,r;for(var i in e)e[i]!==void 0&&(n=i.toLowerCase(),r=e[i],t[n]=r)}function S(e,n){var r={};for(var i in t.cssRules[n])if(C(e,i.split(` `)))for(var a in t.cssRules[n][i])r[a]=t.cssRules[n][i][a];return r}function C(e,t){var n,r=!0;return n=T(e,t.pop()),n&&t.length&&(r=w(e,t)),n&&r&&t.length===0}function w(e,t){for(var n,r=!0;e.parentNode&&e.parentNode.nodeType===1&&t.length;)r&&(n=t.pop()),e=e.parentNode,r=T(e,n);return t.length===0}function T(e,t){var n=e.nodeName,r=e.getAttribute(`class`),i=e.getAttribute(`id`),a=RegExp(`^`+n,`i`),o;if(t=t.replace(a,``),i&&t.length&&(a=RegExp(`#`+i+`(?![a-zA-Z\\-]+)`,`i`),t=t.replace(a,``)),r&&t.length)for(r=r.split(` `),o=r.length;o--;)a=RegExp(`\\.`+r[o]+`(?![a-zA-Z\\-]+)`,`i`),t=t.replace(a,``);return t.length===0}function E(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var r,i,a,o=e.getElementsByTagName(`*`);for(i=0,a=o.length;i<a;i++)if(r=o[i],t===r.getAttribute(`id`))return r}function D(e){for(var n=y(e,[`use`,`svg:use`]),r=0;n.length&&r<n.length;){var i=n[r],a=i.getAttribute(`xlink:href`)||i.getAttribute(`href`);if(a===null)return;var o=a.slice(1),s=i.getAttribute(`x`)||0,c=i.getAttribute(`y`)||0,l=E(e,o).cloneNode(!0),u=(l.getAttribute(`transform`)||``)+` translate(`+s+`, `+c+`)`,d,f=n.length,p,m,h,g,_=t.svgNS;if(k(l),/^svg$/i.test(l.nodeName)){var v=l.ownerDocument.createElementNS(_,`g`);for(m=0,h=l.attributes,g=h.length;m<g;m++)p=h.item(m),v.setAttributeNS(_,p.nodeName,p.nodeValue);for(;l.firstChild;)v.appendChild(l.firstChild);l=v}for(m=0,h=i.attributes,g=h.length;m<g;m++)p=h.item(m),!(p.nodeName===`x`||p.nodeName===`y`||p.nodeName===`xlink:href`||p.nodeName===`href`)&&(p.nodeName===`transform`?u=p.nodeValue+` `+u:l.setAttribute(p.nodeName,p.nodeValue));l.setAttribute(`transform`,u),l.setAttribute(`instantiated_by_use`,`1`),l.removeAttribute(`id`),d=i.parentNode,d.replaceChild(l,i),n.length===f&&r++}}var O=RegExp(`^\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*$`);function k(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n=e.getAttribute(`viewBox`),r=1,i=1,o=0,s=0,c,l,u,d,f=e.getAttribute(`width`),p=e.getAttribute(`height`),m=e.getAttribute(`x`)||0,h=e.getAttribute(`y`)||0,g=e.getAttribute(`preserveAspectRatio`)||``,_=!n||!(n=n.match(O)),v=!f||!p||f===`100%`||p===`100%`,y=_&&v,b={},x=``,S=0,C=0;if(b.width=0,b.height=0,b.toBeParsed=y,_&&(m||h)&&e.parentNode&&e.parentNode.nodeName!==`#document`&&(x=` translate(`+a(m)+` `+a(h)+`) `,u=(e.getAttribute(`transform`)||``)+x,e.setAttribute(`transform`,u),e.removeAttribute(`x`),e.removeAttribute(`y`)),y)return b;if(_)return b.width=a(f),b.height=a(p),b;if(o=-parseFloat(n[1]),s=-parseFloat(n[2]),c=parseFloat(n[3]),l=parseFloat(n[4]),b.minX=o,b.minY=s,b.viewBoxWidth=c,b.viewBoxHeight=l,v?(b.width=c,b.height=l):(b.width=a(f),b.height=a(p),r=b.width/c,i=b.height/l),g=t.util.parsePreserveAspectRatioAttribute(g),g.alignX!==`none`&&(g.meetOrSlice===`meet`&&(i=r=r>i?i:r),g.meetOrSlice===`slice`&&(i=r=r>i?r:i),S=b.width-c*r,C=b.height-l*r,g.alignX===`Mid`&&(S/=2),g.alignY===`Mid`&&(C/=2),g.alignX===`Min`&&(S=0),g.alignY===`Min`&&(C=0)),r===1&&i===1&&o===0&&s===0&&m===0&&h===0)return b;if((m||h)&&e.parentNode.nodeName!==`#document`&&(x=` translate(`+a(m)+` `+a(h)+`) `),u=x+` matrix(`+r+` 0 0 `+i+` `+(o*r+S)+` `+(s*i+C)+`) `,e.nodeName===`svg`){for(d=e.ownerDocument.createElementNS(t.svgNS,`g`);e.firstChild;)d.appendChild(e.firstChild);e.appendChild(d)}else d=e,d.removeAttribute(`x`),d.removeAttribute(`y`),u=d.getAttribute(`transform`)+u;return d.setAttribute(`transform`,u),b}function A(e,t){for(;e&&=e.parentNode;)if(e.nodeName&&t.test(e.nodeName.replace(`svg:`,``))&&!e.getAttribute(`instantiated_by_use`))return!0;return!1}t.parseSVGDocument=function(e,n,i,a){if(e){D(e);var o=t.Object.__uid++,s,c,l=k(e),u=t.util.toArray(e.getElementsByTagName(`*`));if(l.crossOrigin=a&&a.crossOrigin,l.svgUid=o,u.length===0&&t.isLikelyNode){u=e.selectNodes(`//*[name(.)!="svg"]`);var d=[];for(s=0,c=u.length;s<c;s++)d[s]=u[s];u=d}var f=u.filter(function(e){return k(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace(`svg:`,``))&&!A(e,t.svgInvalidAncestorsRegEx)});if(!f||f&&!f.length){n&&n([],{});return}var p={};u.filter(function(e){return e.nodeName.replace(`svg:`,``)===`clipPath`}).forEach(function(e){var n=e.getAttribute(`id`);p[n]=t.util.toArray(e.getElementsByTagName(`*`)).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace(`svg:`,``))})}),t.gradientDefs[o]=t.getGradientDefs(e),t.cssRules[o]=t.getCSSRules(e),t.clipPaths[o]=p,t.parseElements(f,function(e,r){n&&(n(e,l,r,u),delete t.gradientDefs[o],delete t.cssRules[o],delete t.clipPaths[o])},r(l),i,a)}};function j(e,t){var n=[`gradientTransform`,`x1`,`x2`,`y1`,`y2`,`gradientUnits`,`cx`,`cy`,`r`,`fx`,`fy`],r=`xlink:href`,i=E(e,t.getAttribute(r).slice(1));if(i&&i.getAttribute(r)&&j(e,i),n.forEach(function(e){i&&!t.hasAttribute(e)&&i.hasAttribute(e)&&t.setAttribute(e,i.getAttribute(e))}),!t.children.length)for(var a=i.cloneNode(!0);a.firstChild;)t.appendChild(a.firstChild);t.removeAttribute(r)}var M=RegExp(`(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(`+t.reNum+`(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|`+t.reNum+`))?\\s+(.*)`);n(t,{parseFontDeclaration:function(e,t){var n=e.match(M);if(n){var r=n[1],i=n[3],o=n[4],s=n[5],c=n[6];r&&(t.fontStyle=r),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),o&&(t.fontSize=a(o)),c&&(t.fontFamily=c),s&&(t.lineHeight=s===`normal`?1:s)}},getGradientDefs:function(e){var t=y(e,[`linearGradient`,`radialGradient`,`svg:linearGradient`,`svg:radialGradient`]),n,r=0,i={};for(r=t.length;r--;)n=t[r],n.getAttribute(`xlink:href`)&&j(e,n),i[n.getAttribute(`id`)]=n;return i},parseAttributes:function(e,r,i){if(e){var o,s={},c,l;i===void 0&&(i=e.getAttribute(`svgUid`)),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(s=t.parseAttributes(e.parentNode,r,i));var u=r.reduce(function(t,n){return o=e.getAttribute(n),o&&(t[n]=o),t},{}),d=n(S(e,i),t.parseStyleAttribute(e));u=n(u,d),d[m]&&e.setAttribute(m,d[m]),c=l=s.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,u[p]&&(u[p]=c=a(u[p],l));var f,_,y={};for(var b in u)f=h(b),_=g(f,u[b],s,c),y[f]=_;y&&y.font&&t.parseFontDeclaration(y.font,y);var x=n(s,y);return t.svgValidParentsRegEx.test(e.nodeName)?x:v(x)}},parseElements:function(e,n,r,i,a){new t.ElementsParser(e,n,r,i,a).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute(`style`);return n&&(typeof n==`string`?b(n,t):x(n,t)),t},parsePointsAttribute:function(e){if(!e)return null;e=e.replace(/,/g,` `).trim(),e=e.split(/\s+/);var t=[],n,r;for(n=0,r=e.length;n<r;n+=2)t.push({x:parseFloat(e[n]),y:parseFloat(e[n+1])});return t},getCSSRules:function(e){var n=e.getElementsByTagName(`style`),r,i,a={},o;for(r=0,i=n.length;r<i;r++){var s=n[r].textContent;s=s.replace(/\/\*[\s\S]*?\*\//g,``),s.trim()!==``&&(o=s.split(`}`),o=o.filter(function(e){return e.trim()}),o.forEach(function(e){var n=e.split(`{`),o={},s=n[1].trim().split(`;`).filter(function(e){return e.trim()});for(r=0,i=s.length;r<i;r++){var c=s[r].split(`:`),l=c[0].trim();o[l]=c[1].trim()}e=n[0].trim(),e.split(`,`).forEach(function(e){e=e.replace(/^svg/i,``).trim(),e!==``&&(a[e]?t.util.object.extend(a[e],o):a[e]=t.util.object.clone(o))})}))}return a},loadSVGFromURL:function(e,n,r,i){e=e.replace(/^\n\s*/,``).trim(),new t.util.request(e,{method:`get`,onComplete:a});function a(e){var a=e.responseXML;if(!a||!a.documentElement)return n&&n(null),!1;t.parseSVGDocument(a.documentElement,function(e,t,r,i){n&&n(e,t,r,i)},r,i)}},loadSVGFromString:function(e,n,r,i){var a=new t.window.DOMParser().parseFromString(e.trim(),`text/xml`);t.parseSVGDocument(a.documentElement,function(e,t,r,i){n(e,t,r,i)},r,i)}})})(e),t.ElementsParser=function(e,t,n,r,i,a){this.elements=e,this.callback=t,this.options=n,this.reviver=r,this.svgUid=n&&n.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},(function(e){e.parse=function(){this.instances=Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},e.createObjects=function(){var e=this;this.elements.forEach(function(t,n){t.setAttribute(`svgUid`,e.svgUid),e.createObject(t,n)})},e.findTag=function(e){return t[t.util.string.capitalize(e.tagName.replace(`svg:`,``))]},e.createObject=function(e,n){var r=this.findTag(e);if(r&&r.fromElement)try{r.fromElement(e,this.createCallback(n,e),this.options)}catch(e){t.log(e)}else this.checkIfDone()},e.createCallback=function(e,n){var r=this;return function(i){var a;r.resolveGradient(i,n,`fill`),r.resolveGradient(i,n,`stroke`),i instanceof t.Image&&i._originalElement&&(a=i.parsePreserveAspectRatioAttribute(n)),i._removeTransformMatrix(a),r.resolveClipPath(i,n),r.reviver&&r.reviver(n,i),r.instances[e]=i,r.checkIfDone()}},e.extractPropertyDefinition=function(e,n,r){var i=e[n],a=this.regexUrl;if(a.test(i)){a.lastIndex=0;var o=a.exec(i)[1];return a.lastIndex=0,t[r][this.svgUid][o]}},e.resolveGradient=function(e,n,r){var i=this.extractPropertyDefinition(e,r,`gradientDefs`);if(i){var a=n.getAttribute(r+`-opacity`),o=t.Gradient.fromElement(i,e,a,this.options);e.set(r,o)}},e.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},e.resolveClipPath=function(e,n){var r=this.extractPropertyDefinition(e,`clipPath`,`clipPaths`),i,a,o,s,c,l;if(r){s=[],o=t.util.invertTransform(e.calcTransformMatrix());for(var u=r[0].parentNode,d=n;d.parentNode&&d.getAttribute(`clip-path`)!==e.clipPath;)d=d.parentNode;d.parentNode.appendChild(u);for(var f=0;f<r.length;f++)i=r[f],a=this.findTag(i),a.fromElement(i,this.createClipPathCallback(e,s),this.options);r=s.length===1?s[0]:new t.Group(s),c=t.util.multiplyTransformMatrices(o,r.calcTransformMatrix()),r.clipPath&&this.resolveClipPath(r,d);var l=t.util.qrDecompose(c);r.flipX=!1,r.flipY=!1,r.set(`scaleX`,l.scaleX),r.set(`scaleY`,l.scaleY),r.angle=l.angle,r.skewX=l.skewX,r.skewY=0,r.setPositionByOrigin({x:l.translateX,y:l.translateY},`center`,`center`),e.clipPath=r}else delete e.clipPath},e.checkIfDone=function(){--this.numElements===0&&(this.instances=this.instances.filter(function(e){return e!=null}),this.callback(this.instances,this.elements))}})(t.ElementsParser.prototype),(function(e){var t=e.fabric||={};if(t.Point){t.warn(`fabric.Point is already defined`);return}t.Point=n;function n(e,t){this.x=e,this.y=t}n.prototype={type:`point`,constructor:n,add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return t===void 0&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+`,`+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}}})(e),(function(e){var t=e.fabric||={};if(t.Intersection){t.warn(`fabric.Intersection is already defined`);return}function n(e){this.status=e,this.points=[]}t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,r,i,a){var o,s=(a.x-i.x)*(e.y-i.y)-(a.y-i.y)*(e.x-i.x),c=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),l=(a.y-i.y)*(r.x-e.x)-(a.x-i.x)*(r.y-e.y);if(l!==0){var u=s/l,d=c/l;0<=u&&u<=1&&0<=d&&d<=1?(o=new n(`Intersection`),o.appendPoint(new t.Point(e.x+u*(r.x-e.x),e.y+u*(r.y-e.y)))):o=new n}else o=s===0||c===0?new n(`Coincident`):new n(`Parallel`);return o},t.Intersection.intersectLinePolygon=function(e,t,r){var i=new n,a=r.length,o,s,c,l;for(l=0;l<a;l++)o=r[l],s=r[(l+1)%a],c=n.intersectLineLine(e,t,o,s),i.appendPoints(c.points);return i.points.length>0&&(i.status=`Intersection`),i},t.Intersection.intersectPolygonPolygon=function(e,t){var r=new n,i=e.length,a;for(a=0;a<i;a++){var o=e[a],s=e[(a+1)%i],c=n.intersectLinePolygon(o,s,t);r.appendPoints(c.points)}return r.points.length>0&&(r.status=`Intersection`),r},t.Intersection.intersectPolygonRectangle=function(e,r,i){var a=r.min(i),o=r.max(i),s=new t.Point(o.x,a.y),c=new t.Point(a.x,o.y),l=n.intersectLinePolygon(a,s,e),u=n.intersectLinePolygon(s,o,e),d=n.intersectLinePolygon(o,c,e),f=n.intersectLinePolygon(c,a,e),p=new n;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(f.points),p.points.length>0&&(p.status=`Intersection`),p}})(e),(function(e){var t=e.fabric||={};if(t.Color){t.warn(`fabric.Color is already defined.`);return}function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),e===`transparent`&&(t=[255,255,255,0]),t||=n.sourceFromHex(e),t||=n.sourceFromRgb(e),t||=n.sourceFromHsl(e),t||=[0,0,0,1],t&&this.setSource(t)},_rgbToHsl:function(e,n,r){e/=255,n/=255,r/=255;var i,a,o,s=t.util.array.max([e,n,r]),c=t.util.array.min([e,n,r]);if(o=(s+c)/2,s===c)i=a=0;else{var l=s-c;switch(a=o>.5?l/(2-s-c):l/(s+c),s){case e:i=(n-r)/l+(n<r?6:0);break;case n:i=(r-e)/l+2;break;case r:i=(e-n)/l+4;break}i/=6}return[Math.round(i*360),Math.round(a*100),Math.round(o*100)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return`rgb(`+e[0]+`,`+e[1]+`,`+e[2]+`)`},toRgba:function(){var e=this.getSource();return`rgba(`+e[0]+`,`+e[1]+`,`+e[2]+`,`+e[3]+`)`},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return`hsl(`+t[0]+`,`+t[1]+`%,`+t[2]+`%)`},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return`hsla(`+t[0]+`,`+t[1]+`%,`+t[2]+`%,`+e[3]+`)`},toHex:function(){var e=this.getSource(),t=e[0].toString(16),n,r;return t=t.length===1?`0`+t:t,n=e[1].toString(16),n=n.length===1?`0`+n:n,r=e[2].toString(16),r=r.length===1?`0`+r:r,t.toUpperCase()+n.toUpperCase()+r.toUpperCase()},toHexa:function(){var e=this.getSource(),t=Math.round(e[3]*255);return t=t.toString(16),t=t.length===1?`0`+t:t,this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((e[0]*.3+e[1]*.59+e[2]*.11).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(t[0]*.3+t[1]*.59+t[2]*.11).toFixed(0),r=t[3];return e||=127,n=Number(n)<Number(e)?0:255,this.setSource([n,n,n,r]),this},overlayWith:function(e){e instanceof n||(e=new n(e));var t=[],r=this.getAlpha(),i=.5,a=this.getSource(),o=e.getSource(),s;for(s=0;s<3;s++)t.push(Math.round(a[s]*(1-i)+o[s]*i));return t[3]=r,this.setSource(t),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={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`,darkgrey:`#A9A9A9`,darkgreen:`#006400`,darkkhaki:`#BDB76B`,darkmagenta:`#8B008B`,darkolivegreen:`#556B2F`,darkorange:`#FF8C00`,darkorchid:`#9932CC`,darkred:`#8B0000`,darksalmon:`#E9967A`,darkseagreen:`#8FBC8F`,darkslateblue:`#483D8B`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,darkturquoise:`#00CED1`,darkviolet:`#9400D3`,deeppink:`#FF1493`,deepskyblue:`#00BFFF`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1E90FF`,firebrick:`#B22222`,floralwhite:`#FFFAF0`,forestgreen:`#228B22`,fuchsia:`#FF00FF`,gainsboro:`#DCDCDC`,ghostwhite:`#F8F8FF`,gold:`#FFD700`,goldenrod:`#DAA520`,gray:`#808080`,grey:`#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`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,lightgreen:`#90EE90`,lightpink:`#FFB6C1`,lightsalmon:`#FFA07A`,lightseagreen:`#20B2AA`,lightskyblue:`#87CEFA`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#B0C4DE`,lightyellow:`#FFFFE0`,lime:`#00FF00`,limegreen:`#32CD32`,linen:`#FAF0E6`,magenta:`#FF00FF`,maroon:`#800000`,mediumaquamarine:`#66CDAA`,mediumblue:`#0000CD`,mediumorchid:`#BA55D3`,mediumpurple:`#9370DB`,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:`#DB7093`,papayawhip:`#FFEFD5`,peachpuff:`#FFDAB9`,peru:`#CD853F`,pink:`#FFC0CB`,plum:`#DDA0DD`,powderblue:`#B0E0E6`,purple:`#800080`,rebeccapurple:`#663399`,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`,slategrey:`#708090`,snow:`#FFFAFA`,springgreen:`#00FF7F`,steelblue:`#4682B4`,tan:`#D2B48C`,teal:`#008080`,thistle:`#D8BFD8`,tomato:`#FF6347`,turquoise:`#40E0D0`,violet:`#EE82EE`,wheat:`#F5DEB3`,white:`#FFFFFF`,whitesmoke:`#F5F5F5`,yellow:`#FFFF00`,yellowgreen:`#9ACD32`};function r(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color.fromRgb=function(e){return n.fromSource(n.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(n.reRGBa);if(t){var r=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),a=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(r,10),parseInt(i,10),parseInt(a,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=n.fromRgb,t.Color.fromHsl=function(e){return n.fromSource(n.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(n.reHSLa);if(t){var i=(parseFloat(t[1])%360+360)%360/360,a=parseFloat(t[2])/(/%$/.test(t[2])?100:1),o=parseFloat(t[3])/(/%$/.test(t[3])?100:1),s,c,l;if(a===0)s=c=l=o;else{var u=o<=.5?o*(a+1):o+a-o*a,d=o*2-u;s=r(d,u,i+1/3),c=r(d,u,i),l=r(d,u,i-1/3)}return[Math.round(s*255),Math.round(c*255),Math.round(l*255),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=n.fromHsl,t.Color.fromHex=function(e){return n.fromSource(n.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(n.reHex)){var t=e.slice(e.indexOf(`#`)+1),r=t.length===3||t.length===4,i=t.length===8||t.length===4,a=r?t.charAt(0)+t.charAt(0):t.substring(0,2),o=r?t.charAt(1)+t.charAt(1):t.substring(2,4),s=r?t.charAt(2)+t.charAt(2):t.substring(4,6),c=i?r?t.charAt(3)+t.charAt(3):t.substring(6,8):`FF`;return[parseInt(a,16),parseInt(o,16),parseInt(s,16),parseFloat((parseInt(c,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new n;return t.setSource(e),t}})(e),(function(e){var t=e.fabric||={},n=[`e`,`se`,`s`,`sw`,`w`,`nw`,`n`,`ne`,`e`],r=[`ns`,`nesw`,`ew`,`nwse`],i={},a=`left`,o=`top`,s=`right`,c=`bottom`,l=`center`,u={top:c,bottom:o,left:s,right:a,center:l},d=t.util.radiansToDegrees,f=Math.sign||function(e){return(e>0)-(e<0)||+e};function p(e,t){var n=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function m(e,n){var r=n.transform.target,i=r.canvas,a=t.util.object.clone(n);a.target=r,i&&i.fire(`object:`+e,a),r.fire(e,n)}function h(e,t){var n=t.canvas,r=e[n.uniScaleKey];return n.uniformScaling&&!r||!n.uniformScaling&&r}function g(e){return e.originX===l&&e.originY===l}function _(e,t,n){var r=e.lockScalingX,i=e.lockScalingY;return!!(r&&i||!t&&(r||i)&&n||r&&t===`x`||i&&t===`y`)}function v(e,t,r){var i=`not-allowed`,a=h(e,r),o=``;return t.x!==0&&t.y===0?o=`x`:t.x===0&&t.y!==0&&(o=`y`),_(r,o,a)?i:n[p(r,t)]+`-resize`}function y(e,t,n){return t.x!==0&&n.lockSkewingY||t.y!==0&&n.lockSkewingX?`not-allowed`:r[p(n,t)%4]+`-resize`}function b(e,t,n){return e[n.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,n):i.scaleCursorStyleHandler(e,t,n)}function x(e,t,n){var r=e[n.canvas.altActionKey];if(t.x===0)return r?`skewX`:`scaleY`;if(t.y===0)return r?`skewY`:`scaleX`}function S(e,t,n){return n.lockRotation?`not-allowed`:t.cursorStyle}function C(e,t,n,r){return{e,transform:t,pointer:{x:n,y:r}}}function w(e){return function(t,n,r,i){var a=n.target,o=a.getCenterPoint(),s=a.translateToOriginPoint(o,n.originX,n.originY),c=e(t,n,r,i);return a.setPositionByOrigin(s,n.originX,n.originY),c}}function T(e,t){return function(n,r,i,a){var o=t(n,r,i,a);return o&&m(e,C(n,r,i,a)),o}}function E(e,n,r,i,a){var o=e.target,s=o.controls[e.corner],c=o.canvas.getZoom(),l=o.padding/c,u=o.toLocalPoint(new t.Point(i,a),n,r);return u.x>=l&&(u.x-=l),u.x<=-l&&(u.x+=l),u.y>=l&&(u.y-=l),u.y<=l&&(u.y+=l),u.x-=s.offsetX,u.y-=s.offsetY,u}function D(e){return e.flipX!==e.flipY}function O(e,t,n,r,i){if(e[t]!==0){var a=i/e._getTransformedDimensions()[r]*e[n];e.set(n,a)}}function k(e,t,n,r){var i=t.target,l=i._getTransformedDimensions(0,i.skewY),u=E(t,t.originX,t.originY,n,r),f=Math.abs(u.x*2)-l.x,p=i.skewX,m;f<2?m=0:(m=d(Math.atan2(f/i.scaleX,l.y/i.scaleY)),t.originX===a&&t.originY===c&&(m=-m),t.originX===s&&t.originY===o&&(m=-m),D(i)&&(m=-m));var h=p!==m;if(h){var g=i._getTransformedDimensions().y;i.set(`skewX`,m),O(i,`skewY`,`scaleY`,`y`,g)}return h}function A(e,t,n,r){var i=t.target,l=i._getTransformedDimensions(i.skewX,0),u=E(t,t.originX,t.originY,n,r),f=Math.abs(u.y*2)-l.y,p=i.skewY,m;f<2?m=0:(m=d(Math.atan2(f/i.scaleY,l.x/i.scaleX)),t.originX===a&&t.originY===c&&(m=-m),t.originX===s&&t.originY===o&&(m=-m),D(i)&&(m=-m));var h=p!==m;if(h){var g=i._getTransformedDimensions().x;i.set(`skewY`,m),O(i,`skewX`,`scaleX`,`x`,g)}return h}function j(e,t,n,r){var i=t.target,c=i.skewX,u,d=t.originY;return i.lockSkewingX?!1:(c===0?u=E(t,l,l,n,r).x>0?a:s:(c>0&&(u=d===o?a:s),c<0&&(u=d===o?s:a),D(i)&&(u=u===a?s:a)),t.originX=u,T(`skewing`,w(k))(e,t,n,r))}function M(e,t,n,r){var i=t.target,s=i.skewY,u,d=t.originX;return i.lockSkewingY?!1:(s===0?u=E(t,l,l,n,r).y>0?o:c:(s>0&&(u=d===a?o:c),s<0&&(u=d===a?c:o),D(i)&&(u=u===o?c:o)),t.originY=u,T(`skewing`,w(A))(e,t,n,r))}function N(e,t,n,r){var i=t,a=i.target,o=a.translateToOriginPoint(a.getCenterPoint(),i.originX,i.originY);if(a.lockRotation)return!1;var s=Math.atan2(i.ey-o.y,i.ex-o.x),c=d(Math.atan2(r-o.y,n-o.x)-s+i.theta),l=!0;if(a.snapAngle>0){var u=a.snapAngle,f=a.snapThreshold||u,p=Math.ceil(c/u)*u,m=Math.floor(c/u)*u;Math.abs(c-m)<f?c=m:Math.abs(c-p)<f&&(c=p)}return c<0&&(c=360+c),c%=360,l=a.angle!==c,a.angle=c,l}function ee(e,t,n,r,i){i||={};var a=t.target,o=a.lockScalingX,s=a.lockScalingY,c=i.by,l,d,p,m,v=h(e,a),y=_(a,c,v),b,x,S=t.gestureScale;if(y)return!1;if(S)d=t.scaleX*S,p=t.scaleY*S;else{if(l=E(t,t.originX,t.originY,n,r),b=c===`y`?1:f(l.x),x=c===`x`?1:f(l.y),t.signX||=b,t.signY||=x,a.lockScalingFlip&&(t.signX!==b||t.signY!==x))return!1;if(m=a._getTransformedDimensions(),v&&!c){var C=Math.abs(l.x)+Math.abs(l.y),w=t.original,T=C/(Math.abs(m.x*w.scaleX/a.scaleX)+Math.abs(m.y*w.scaleY/a.scaleY));d=w.scaleX*T,p=w.scaleY*T}else d=Math.abs(l.x*a.scaleX/m.x),p=Math.abs(l.y*a.scaleY/m.y);g(t)&&(d*=2,p*=2),t.signX!==b&&c!==`y`&&(t.originX=u[t.originX],d*=-1,t.signX=b),t.signY!==x&&c!==`x`&&(t.originY=u[t.originY],p*=-1,t.signY=x)}var D=a.scaleX,O=a.scaleY;return c?(c===`x`&&a.set(`scaleX`,d),c===`y`&&a.set(`scaleY`,p)):(!o&&a.set(`scaleX`,d),!s&&a.set(`scaleY`,p)),D!==a.scaleX||O!==a.scaleY}function te(e,t,n,r){return ee(e,t,n,r)}function P(e,t,n,r){return ee(e,t,n,r,{by:`x`})}function F(e,t,n,r){return ee(e,t,n,r,{by:`y`})}function ne(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,n,r):i.scalingY(e,t,n,r)}function re(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,n,r):i.scalingX(e,t,n,r)}function ie(e,t,n,r){var i=t.target,a=E(t,t.originX,t.originY,n,r),o=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=g(t)?2:1,c=i.width,l=Math.abs(a.x*s/i.scaleX)-o;return i.set(`width`,Math.max(l,0)),c!==l}function ae(e,t,n,r){var i=t.target,a=n-t.offsetX,o=r-t.offsetY,s=!i.get(`lockMovementX`)&&i.left!==a,c=!i.get(`lockMovementY`)&&i.top!==o;return s&&i.set(`left`,a),c&&i.set(`top`,o),(s||c)&&m(`moving`,C(e,t,n,r)),s||c}i.scaleCursorStyleHandler=v,i.skewCursorStyleHandler=y,i.scaleSkewCursorStyleHandler=b,i.rotationWithSnapping=T(`rotating`,w(N)),i.scalingEqually=T(`scaling`,w(te)),i.scalingX=T(`scaling`,w(P)),i.scalingY=T(`scaling`,w(F)),i.scalingYOrSkewingX=ne,i.scalingXOrSkewingY=re,i.changeWidth=T(`resizing`,w(ie)),i.skewHandlerX=j,i.skewHandlerY=M,i.dragHandler=ae,i.scaleOrSkewActionName=x,i.rotationStyleHandler=S,i.fireEvent=m,i.wrapWithFixedAnchor=w,i.wrapWithFireEvent=T,i.getLocalPoint=E,t.controlsUtils=i})(e),(function(e){var t=e.fabric||={},n=t.util.degreesToRadians,r=t.controlsUtils;function i(e,t,n,r,i){r||={};var a=this.sizeX||r.cornerSize||i.cornerSize,o=this.sizeY||r.cornerSize||i.cornerSize,s=r.transparentCorners===void 0?i.transparentCorners:r.transparentCorners,c=s?`stroke`:`fill`,l=!s&&(r.cornerStrokeColor||i.cornerStrokeColor),u=t,d=n,f;e.save(),e.fillStyle=r.cornerColor||i.cornerColor,e.strokeStyle=r.cornerStrokeColor||i.cornerStrokeColor,a>o?(f=a,e.scale(1,o/a),d=n*a/o):o>a?(f=o,e.scale(a/o,1),u=t*o/a):f=a,e.lineWidth=1,e.beginPath(),e.arc(u,d,f/2,0,2*Math.PI,!1),e[c](),l&&e.stroke(),e.restore()}function a(e,t,r,i,a){i||={};var o=this.sizeX||i.cornerSize||a.cornerSize,s=this.sizeY||i.cornerSize||a.cornerSize,c=i.transparentCorners===void 0?a.transparentCorners:i.transparentCorners,l=c?`stroke`:`fill`,u=!c&&(i.cornerStrokeColor||a.cornerStrokeColor),d=o/2,f=s/2;e.save(),e.fillStyle=i.cornerColor||a.cornerColor,e.strokeStyle=i.cornerStrokeColor||a.cornerStrokeColor,e.lineWidth=1,e.translate(t,r),e.rotate(n(a.angle)),e[l+`Rect`](-d,-f,o,s),u&&e.strokeRect(-d,-f,o,s),e.restore()}r.renderCircleControl=i,r.renderSquareControl=a})(e),(function(e){var t=e.fabric||={};function n(e){for(var t in e)this[t]=e[t]}t.Control=n,t.Control.prototype={visible:!0,actionName:`scale`,angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:`crosshair`,withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&n[t]!==void 0?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,r,i,a){var o,s,c,l,u=a?this.touchSizeX:this.sizeX,d=a?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var f=Math.atan2(d,u),p=Math.sqrt(u*u+d*d)/2,m=f-t.util.degreesToRadians(e),h=Math.PI/2-f-t.util.degreesToRadians(e);o=p*t.util.cos(m),s=p*t.util.sin(m),c=p*t.util.cos(h),l=p*t.util.sin(h)}else{p=(u&&d?u:n)*.7071067812;var m=t.util.degreesToRadians(45-e);o=c=p*t.util.cos(m),s=l=p*t.util.sin(m)}return{tl:{x:r-l,y:i-c},tr:{x:r+o,y:i-s},bl:{x:r-o,y:i+s},br:{x:r+l,y:i+c}}},render:function(e,n,r,i,a){switch(i||={},i.cornerStyle||a.cornerStyle){case`circle`:t.controlsUtils.renderCircleControl.call(this,e,n,r,i,a);break;default:t.controlsUtils.renderSquareControl.call(this,e,n,r,i,a)}}}})(e),(function(){function e(e,n){var r=e.getAttribute(`style`),i=e.getAttribute(`offset`)||0,a,o,s,c;if(i=parseFloat(i)/(/%$/.test(i)?100:1),i=i<0?0:i>1?1:i,r){var l=r.split(/\s*;\s*/);for(l[l.length-1]===``&&l.pop(),c=l.length;c--;){var u=l[c].split(/\s*:\s*/),d=u[0].trim(),f=u[1].trim();d===`stop-color`?a=f:d===`stop-opacity`&&(s=f)}}return a||=e.getAttribute(`stop-color`)||`rgb(0,0,0)`,s||=e.getAttribute(`stop-opacity`),a=new t.Color(a),o=a.getAlpha(),s=isNaN(parseFloat(s))?1:parseFloat(s),s*=o*n,{offset:i,color:a.toRgb(),opacity:s}}function n(e){return{x1:e.getAttribute(`x1`)||0,y1:e.getAttribute(`y1`)||0,x2:e.getAttribute(`x2`)||`100%`,y2:e.getAttribute(`y2`)||0}}function r(e){return{x1:e.getAttribute(`fx`)||e.getAttribute(`cx`)||`50%`,y1:e.getAttribute(`fy`)||e.getAttribute(`cy`)||`50%`,r1:0,x2:e.getAttribute(`cx`)||`50%`,y2:e.getAttribute(`cy`)||`50%`,r2:e.getAttribute(`r`)||`50%`}}var i=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:`pixels`,type:`linear`,initialize:function(e){e||={},e.coords||={};var n,r=this;Object.keys(e).forEach(function(t){r[t]=e[t]}),this.id?this.id+=`_`+ t.Object.__uid++:this.id=t.Object.__uid++,n={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},this.type===`radial`&&(n.r1=e.coords.r1||0,n.r2=e.coords.r2||0),this.coords=n,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var n in e){var r=new t.Color(e[n]);this.colorStops.push({offset:parseFloat(n),color:r.toRgb(),opacity:r.getAlpha()})}return this},toObject:function(e){var n={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return t.util.populateWithProperties(this,n,e),n},toSVG:function(e,n){var r=i(this.coords,!0),a,o,n=n||{},s,c,l=i(this.colorStops,!0),u=r.r1>r.r2,d=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),f=-this.offsetX,p=-this.offsetY,m=!!n.additionalTransform,h=this.gradientUnits===`pixels`?`userSpaceOnUse`:`objectBoundingBox`;if(l.sort(function(e,t){return e.offset-t.offset}),h===`objectBoundingBox`?(f/=e.width,p/=e.height):(f+=e.width/2,p+=e.height/2),e.type===`path`&&this.gradientUnits!==`percentage`&&(f-=e.pathOffset.x,p-=e.pathOffset.y),d[4]-=f,d[5]-=p,c=`id="SVGID_`+this.id+`" gradientUnits="`+h+`"`,c+=` gradientTransform="`+(m?n.additionalTransform+` `:``)+t.util.matrixToSVG(d)+`" `,this.type===`linear`?s=[`<linearGradient `,c,` x1="`,r.x1,`" y1="`,r.y1,`" x2="`,r.x2,`" y2="`,r.y2,`">
`]:this.type===`radial`&&(s=[`<radialGradient `,c,` cx="`,u?r.x1:r.x2,`" cy="`,u?r.y1:r.y2,`" r="`,u?r.r1:r.r2,`" fx="`,u?r.x2:r.x1,`" fy="`,u?r.y2:r.y1,`">
`]),this.type===`radial`){if(u)for(l=l.concat(),l.reverse(),a=0,o=l.length;a<o;a++)l[a].offset=1-l[a].offset;var g=Math.min(r.r1,r.r2);if(g>0){var _=g/Math.max(r.r1,r.r2);for(a=0,o=l.length;a<o;a++)l[a].offset+=_*(1-l[a].offset)}}for(a=0,o=l.length;a<o;a++){var v=l[a];s.push(`<stop `,`offset="`,v.offset*100+`%`,`" style="stop-color:`,v.color,v.opacity===void 0?`;`:`;stop-opacity: `+v.opacity,`"/>
`)}return s.push(this.type===`linear`?`</linearGradient>
`:`</radialGradient>
`),s.join(``)},toLive:function(e){var n,r=t.util.object.clone(this.coords),i,a;if(this.type){for(this.type===`linear`?n=e.createLinearGradient(r.x1,r.y1,r.x2,r.y2):this.type===`radial`&&(n=e.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,a=this.colorStops.length;i<a;i++){var o=this.colorStops[i].color,s=this.colorStops[i].opacity,c=this.colorStops[i].offset;s!==void 0&&(o=new t.Color(o).setAlpha(s).toRgba()),n.addColorStop(c,o)}return n}}}),t.util.object.extend(t.Gradient,{fromElement:function(i,o,s,c){var l=parseFloat(s)/(/%$/.test(s)?100:1);l=l<0?0:l>1?1:l,isNaN(l)&&(l=1);var u=i.getElementsByTagName(`stop`),d,f=i.getAttribute(`gradientUnits`)===`userSpaceOnUse`?`pixels`:`percentage`,p=i.getAttribute(`gradientTransform`)||``,m=[],h,g,_=0,v=0,y;for(i.nodeName===`linearGradient`||i.nodeName===`LINEARGRADIENT`?(d=`linear`,h=n(i)):(d=`radial`,h=r(i)),g=u.length;g--;)m.push(e(u[g],l));return y=t.parseTransformAttribute(p),a(o,h,c,f),f===`pixels`&&(_=-o.left,v=-o.top),new t.Gradient({id:i.getAttribute(`id`),type:d,coords:h,colorStops:m,gradientUnits:f,gradientTransform:y,offsetX:_,offsetY:v})}});function a(e,t,n,r){var i,a;Object.keys(t).forEach(function(e){i=t[e],i===`Infinity`?a=1:i===`-Infinity`?a=0:(a=parseFloat(t[e],10),typeof i==`string`&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(a*=.01,r===`pixels`&&((e===`x1`||e===`x2`||e===`r2`)&&(a*=n.viewBoxWidth||n.width),(e===`y1`||e===`y2`)&&(a*=n.viewBoxHeight||n.height)))),t[e]=a})}})(),(function(){var e=t.util.toFixed;t.Pattern=t.util.createClass({repeat:`repeat`,offsetX:0,offsetY:0,crossOrigin:``,patternTransform:null,initialize:function(e,n){if(e||={},this.id=t.Object.__uid++,this.setOptions(e),!e.source||e.source&&typeof e.source!=`string`){n&&n(this);return}else{var r=this;this.source=t.util.createImage(),t.util.loadImage(e.source,function(e,t){r.source=e,n&&n(r,t)},null,this.crossOrigin)}},toObject:function(n){var r=t.Object.NUM_FRACTION_DIGITS,i,a;return typeof this.source.src==`string`?i=this.source.src:typeof this.source==`object`&&this.source.toDataURL&&(i=this.source.toDataURL()),a={type:`pattern`,source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,r),offsetY:e(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,a,n),a},toSVG:function(e){var t=typeof this.source==`function`?this.source():this.source,n=t.width/e.width,r=t.height/e.height,i=this.offsetX/e.width,a=this.offsetY/e.height,o=``;return(this.repeat===`repeat-x`||this.repeat===`no-repeat`)&&(r=1,a&&(r+=Math.abs(a))),(this.repeat===`repeat-y`||this.repeat===`no-repeat`)&&(n=1,i&&(n+=Math.abs(i))),t.src?o=t.src:t.toDataURL&&(o=t.toDataURL()),`<pattern id="SVGID_`+this.id+`" x="`+i+`" y="`+a+`" width="`+n+`" height="`+r+`">
<image x="0" y="0" width="`+t.width+`" height="`+t.height+`" xlink:href="`+o+`"></image>
</pattern>
`},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||t.src!==void 0&&(!t.complete||t.naturalWidth===0||t.naturalHeight===0)?``:e.createPattern(t,this.repeat)}})})(),(function(e){var t=e.fabric||={},n=t.util.toFixed;if(t.Shadow){t.warn(`fabric.Shadow is already defined.`);return}t.Shadow=t.util.createClass({color:`rgb(0,0,0)`,blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in typeof e==`string`&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),r=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,``)||`rgb(0,0,0)`).trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join(`px `)},toSVG:function(e){var r=40,i=40,a=t.Object.NUM_FRACTION_DIGITS,o=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=20,c=new t.Color(this.color);return e.width&&e.height&&(r=n((Math.abs(o.x)+this.blur)/e.width,a)*100+s,i=n((Math.abs(o.y)+this.blur)/e.height,a)*100+s),e.flipX&&(o.x*=-1),e.flipY&&(o.y*=-1),`<filter id="SVGID_`+this.id+`" y="-`+i+`%" height="`+(100+2*i)+`%" x="-`+r+`%" width="`+(100+2*r)+`%" >
<feGaussianBlur in="SourceAlpha" stdDeviation="`+n(this.blur?this.blur/2:0,a)+`"></feGaussianBlur>
<feOffset dx="`+n(o.x,a)+`" dy="`+n(o.y,a)+`" result="oBlur" ></feOffset>
<feFlood flood-color="`+c.toRgb()+`" flood-opacity="`+c.getAlpha()+`"/>
<feComposite in2="oBlur" operator="in" />
<feMerge>
<feMergeNode></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},n=t.Shadow.prototype;return[`color`,`blur`,`offsetX`,`offsetY`,`affectStroke`,`nonScaling`].forEach(function(t){this[t]!==n[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/})(e),(function(){if(t.StaticCanvas){t.warn(`fabric.StaticCanvas is already defined.`);return}var e=t.util.object.extend,n=t.util.getElementOffset,r=t.util.removeFromArray,i=t.util.toFixed,a=t.util.transformPoint,o=t.util.invertTransform,s=t.util.getNodeCanvas,c=t.util.createCanvasElement,l=Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(e,t){t||={},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:``,backgroundImage:null,overlayColor:``,overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,t.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=t.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute(`width`,this.width*e),t.setAttribute(`height`,this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=n(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage(`overlayImage`,e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage(`backgroundImage`,e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor(`overlayColor`,e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor(`backgroundColor`,e,t)},__setBgOverlayImage:function(e,n,r,i){return typeof n==`string`?t.util.loadImage(n,function(n,a){if(n){var o=new t.Image(n,i);this[e]=o,o.canvas=this}r&&r(n,a)},this,i&&i.crossOrigin):(i&&n.setOptions(i),this[e]=n,n&&(n.canvas=this),r&&r(n,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=c();if(!e||(e.style||={},e.getContext===void 0))throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+`px`,t.style.height=this.height+`px`,this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=t.util.getById(e)||this._createCanvasElement(),t.util.addClass(this.lowerCanvasEl,`lower-canvas`),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext(`2d`)},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var r in t||={},e)n=e[r],t.cssOnly||(this._setBackstoreDimension(r,e[r]),n+=`px`,this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(r,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t=this._activeObject,n=this.backgroundImage,r=this.overlayImage,i,a,o;for(this.viewportTransform=e,a=0,o=this._objects.length;a<o;a++)i=this._objects[a],i.group||i.setCoords(!0);return t&&t.setCoords(),n&&n.setCoords(!0),r&&r.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var n=e,r=this.viewportTransform.slice(0);e=a(e,o(this.viewportTransform)),r[0]=t,r[3]=t;var i=a(e,r);return r[4]+=n.x-i.x,r[5]+=n.y-i.y,this.setViewportTransform(r)},setZoom:function(e){return this.zoomToPoint(new t.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new t.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set(`canvas`,this),e.setCoords(),this.fire(`object:added`,{target:e}),e.fire(`added`)},_onObjectRemoved:function(e){this.fire(`object:removed`,{target:e}),e.fire(`removed`),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor=``,this.overlayColor=``,this._hasITextHandlers&&=(this.off(`mouse:up`,this._mouseUpITextHandler),this._iTextInstances=null,!1),this.clearContext(this.contextContainer),this.fire(`canvas:cleared`),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||=t.util.requestAnimFrame(this.renderAndResetBound),this},calcViewportBoundaries:function(){var e={},n=this.width,r=this.height,i=o(this.viewportTransform);return e.tl=a({x:0,y:0},i),e.br=a({x:n,y:r},i),e.tr=new t.Point(e.br.x,e.tl.y),e.bl=new t.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&=(t.util.cancelAnimFrame(this.isRendering),0)},renderCanvas:function(e,n){var r=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),t.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire(`before:render`,{ctx:e}),this._renderBackground(e),e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(e,n),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire(`after:render`,{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,n=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation=`destination-in`,n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)t[n]&&t[n].render(e)},_renderBackgroundOrOverlay:function(e,t){var n=this[t+`Color`],r=this[t+`Image`],i=this.viewportTransform,a=this[t+`Vpt`];if(!(!n&&!r)){if(n){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=n.toLive?n.toLive(e,this):n,a&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,n.offsetX||0,n.offsetY||0);var o=n.gradientTransform||n.patternTransform;o&&e.transform(o[0],o[1],o[2],o[3],o[4],o[5]),e.fill(),e.restore()}if(r){e.save();var s=this.skipOffscreen;this.skipOffscreen=a,a&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),r.render(e),this.skipOffscreen=s,e.restore()}}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,`background`)},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,`overlay`)},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new t.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new t.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new t.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(n.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(e.getCenterPoint().x,n.y))},getVpCenter:function(){return a(this.getCenterPoint(),o(this.viewportTransform))},_centerObject:function(e,t){return e.setPositionByOrigin(t,`center`,`center`),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod(`toObject`,e)},toDatalessObject:function(e){return this._toObjectMethod(`toDatalessObject`,e)},_toObjectMethod:function(n,r){var i=this.clipPath,a={version:t.version,objects:this._toObjects(n,r)};return i&&!i.excludeFromExport&&(a.clipPath=this._toObject(this.clipPath,n,r)),e(a,this.__serializeBgOverlay(n,r)),t.util.populateWithProperties(this,a,r),a},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(n){return this._toObject(n,e,t)},this)},_toObject:function(e,t,n){var r;this.includeDefaultValues||(r=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](n);return this.includeDefaultValues||(e.includeDefaultValues=r),i},__serializeBgOverlay:function(e,t){var n={},r=this.backgroundImage,i=this.overlayImage,a=this.backgroundColor,o=this.overlayColor;return a&&a.toObject?a.excludeFromExport||(n.background=a.toObject(t)):a&&(n.background=a),o&&o.toObject?o.excludeFromExport||(n.overlay=o.toObject(t)):o&&(n.overlay=o),r&&!r.excludeFromExport&&(n.backgroundImage=this._toObject(r,e,t)),i&&!i.excludeFromExport&&(n.overlayImage=this._toObject(i,e,t)),n},svgViewportTransformation:!0,toSVG:function(e,t){e||={},e.reviver=t;var n=[];return this._setSVGPreamble(n,e),this._setSVGHeader(n,e),this.clipPath&&n.push(`<g clip-path="url(#`+this.clipPath.clipPathId+`)" >
`),this._setSVGBgOverlayColor(n,`background`),this._setSVGBgOverlayImage(n,`backgroundImage`,t),this._setSVGObjects(n,t),this.clipPath&&n.push(`</g>
`),this._setSVGBgOverlayColor(n,`overlay`),this._setSVGBgOverlayImage(n,`overlayImage`,t),n.push(`</svg>`),n.join(``)},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push(`<?xml version="1.0" encoding="`,t.encoding||`UTF-8`,`" standalone="no" ?>
`,`<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" `,`"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
`)},_setSVGHeader:function(e,n){var r=n.width||this.width,a=n.height||this.height,o,s=`viewBox="0 0 `+this.width+` `+this.height+`" `,c=t.Object.NUM_FRACTION_DIGITS;n.viewBox?s=`viewBox="`+n.viewBox.x+` `+n.viewBox.y+` `+n.viewBox.width+` `+n.viewBox.height+`" `:this.svgViewportTransformation&&(o=this.viewportTransform,s=`viewBox="`+i(-o[4]/o[0],c)+` `+i(-o[5]/o[3],c)+` `+i(this.width/o[0],c)+` `+i(this.height/o[3],c)+`" `),e.push(`<svg `,`xmlns="http://www.w3.org/2000/svg" `,`xmlns:xlink="http://www.w3.org/1999/xlink" `,`version="1.1" `,`width="`,r,`" `,`height="`,a,`" `,s,`xml:space="preserve">
`,`<desc>Created with Fabric.js `,t.version,`</desc>
`,`<defs>
`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(n),`</defs>
`)},createSVGClipPathMarkup:function(e){var n=this.clipPath;return n?(n.clipPathId=`CLIPPATH_`+ t.Object.__uid++,`<clipPath id="`+n.clipPathId+`" >
`+this.clipPath.toClipPathSVG(e.reviver)+`</clipPath>
`):``},createSVGRefElementsMarkup:function(){var e=this;return[`background`,`overlay`].map(function(n){var r=e[n+`Color`];if(r&&r.toLive){var i=e[n+`Vpt`],a=e.viewportTransform,o={width:e.width/(i?a[0]:1),height:e.height/(i?a[3]:1)};return r.toSVG(o,{additionalTransform:i?t.util.matrixToSVG(a):``})}}).join(``)},createSVGFontFacesMarkup:function(){var e=``,n={},r,i,a,o,s,c,l,u,d,f=t.fontPaths,p=[];for(this._objects.forEach(function e(t){p.push(t),t._objects&&t._objects.forEach(e)}),u=0,d=p.length;u<d;u++)if(r=p[u],i=r.fontFamily,!(r.type.indexOf(`text`)===-1||n[i]||!f[i])&&(n[i]=!0,r.styles))for(s in a=r.styles,a)for(l in o=a[s],o)c=o[l],i=c.fontFamily,!n[i]&&f[i]&&(n[i]=!0);for(var m in n)e+=[` @font-face {
`,` font-family: '`,m,`';
`,` src: url('`,f[m],`');
`,` }
`].join(``);return e&&=[` <style type="text/css">`,`<![CDATA[
`,e,`]]>`,`</style>
`].join(``),e},_setSVGObjects:function(e,t){var n,r,i,a=this._objects;for(r=0,i=a.length;r<i;r++)n=a[r],!n.excludeFromExport&&this._setSVGObject(e,n,t)},_setSVGObject:function(e,t,n){e.push(t.toSVG(n))},_setSVGBgOverlayImage:function(e,t,n){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(n))},_setSVGBgOverlayColor:function(e,n){var r=this[n+`Color`],i=this.viewportTransform,a=this.width,o=this.height;if(r)if(r.toLive){var s=r.repeat,c=t.util.invertTransform(i),l=this[n+`Vpt`]?t.util.matrixToSVG(c):``;e.push(`<rect transform="`+l+` translate(`,a/2,`,`,o/2,`)"`,` x="`,r.offsetX-a/2,`" y="`,r.offsetY-o/2,`" `,`width="`,s===`repeat-y`||s===`no-repeat`?r.source.width:a,`" height="`,s===`repeat-x`||s===`no-repeat`?r.source.height:o,`" fill="url(#SVGID_`+r.id+`)"`,`></rect>
`)}else e.push(`<rect x="0" y="0" width="100%" height="100%" `,`fill="`,r,`"`,`></rect>
`)},sendToBack:function(e){if(!e)return this;var t=this._activeObject,n,i,a;if(e===t&&e.type===`activeSelection`)for(a=t._objects,n=a.length;n--;)i=a[n],r(this._objects,i),this._objects.unshift(i);else r(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t=this._activeObject,n,i,a;if(e===t&&e.type===`activeSelection`)for(a=t._objects,n=0;n<a.length;n++)i=a[n],r(this._objects,i),this._objects.push(i);else r(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n=this._activeObject,i,a,o,s,c,l=0;if(e===n&&e.type===`activeSelection`)for(c=n._objects,i=0;i<c.length;i++)a=c[i],o=this._objects.indexOf(a),o>0+l&&(s=o-1,r(this._objects,a),this._objects.splice(s,0,a)),l++;else o=this._objects.indexOf(e),o!==0&&(s=this._findNewLowerIndex(e,o,t),r(this._objects,e),this._objects.splice(s,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var r,i;if(n){for(r=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t-1;return r},bringForward:function(e,t){if(!e)return this;var n=this._activeObject,i,a,o,s,c,l=0;if(e===n&&e.type===`activeSelection`)for(c=n._objects,i=c.length;i--;)a=c[i],o=this._objects.indexOf(a),o<this._objects.length-1-l&&(s=o+1,r(this._objects,a),this._objects.splice(s,0,a)),l++;else o=this._objects.indexOf(e),o!==this._objects.length-1&&(s=this._findNewUpperIndex(e,o,t),r(this._objects,e),this._objects.splice(s,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,n){var r,i,a;if(n){for(r=t,i=t+1,a=this._objects.length;i<a;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t+1;return r},moveTo:function(e,t){return r(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&=(t.util.cancelAnimFrame(this.isRendering),0),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove(`lower-canvas`),t.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute(`width`,this.width),this.lowerCanvasEl.setAttribute(`height`,this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return`#<fabric.Canvas (`+this.complexity()+`): { objects: `+this._objects.length+` }>`}}),e(t.StaticCanvas.prototype,t.Observable),e(t.StaticCanvas.prototype,t.Collection),e(t.StaticCanvas.prototype,t.DataURLExporter),e(t.StaticCanvas,{EMPTY_JSON:`{"objects": [], "background": "white"}`,supports:function(e){var t=c();if(!t||!t.getContext)return null;var n=t.getContext(`2d`);if(!n)return null;switch(e){case`setLineDash`:return n.setLineDash!==void 0;default:return null}}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})})(),t.BaseBrush=t.util.createClass({color:`rgb(0, 0, 0)`,width:1,shadow:null,strokeLineCap:`round`,strokeLineJoin:`round`,strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,n=this.shadow,r=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=t.devicePixelRatio),r.shadowColor=n.color,r.shadowBlur=n.blur*i,r.shadowOffsetX=n.offsetX*i,r.shadowOffsetY=n.offsetY*i}},needsFullRender:function(){return new t.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor=``,e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),(function(){t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:`shiftKey`,initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper(`needsFullRender`)||this._hasStraightLine},_drawSegment:function(e,t,n){var r=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,r.x,r.y),r},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,r=n.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,n[r-2],n[r-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return this.canvas._isMainEvent(e.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(e){var n=new t.Point(e.x,e.y);this._reset(),this._addPoint(n),this.canvas.contextTop.moveTo(n.x,n.y)},_addPoint:function(e){return this._points.length>1&&e.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var n=new t.Point(e.x,e.y);return this._addPoint(n)},_render:function(e){var n,r,i=this._points[0],a=this._points[1];if(e||=this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),this._points.length===2&&i.x===a.x&&i.y===a.y){var o=this.width/1e3;i=new t.Point(i.x,i.y),a=new t.Point(a.x,a.y),i.x-=o,a.x+=o}for(e.moveTo(i.x,i.y),n=1,r=this._points.length;n<r;n++)this._drawSegment(e,i,a),i=this._points[n],a=this._points[n+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var n=this.width/1e3;return t.util.getSmoothPathFromPoints(e,n)},_isEmptySVGPath:function(e){return t.util.joinPath(e)===`M 0 0 Q 0 0 0 0 L 0 0`},createPath:function(e){var n=new t.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,n.shadow=new t.Shadow(this.shadow)),n},decimatePoints:function(e,t){if(e.length<=2)return e;var n=(t/this.canvas.getZoom())**2,r,i=e.length-1,a=e[0],o=[a],s;for(r=1;r<i-1;r++)s=(a.x-e[r].x)**2+(a.y-e[r].y)**2,s>=n&&(a=e[r],o.push(a));return o.push(e[i]),o},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e)){this.canvas.requestRenderAll();return}var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire(`before:path:created`,{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire(`path:created`,{path:t})}})})(),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,Math.PI*2,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e=this.canvas.contextTop,t,n,r=this.points;for(this._saveAndTransform(e),t=0,n=r.length;t<n;t++)this.dot(e,r[t]);e.restore()},onMouseMove:function(e){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove,n,r;this.canvas.renderOnAddRemove=!1;var i=[];for(n=0,r=this.points.length;n<r;n++){var a=this.points[n],o=new t.Circle({radius:a.radius,left:a.x,top:a.y,originX:`center`,originY:`center`,fill:a.fill});this.shadow&&(o.shadow=new t.Shadow(this.shadow)),i.push(o)}var s=new t.Group(i);s.canvas=this.canvas,this.canvas.fire(`before:path:created`,{path:s}),this.canvas.add(s),this.canvas.fire(`path:created`,{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},addPoint:function(e){var n=new t.Point(e.x,e.y),r=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return n.radius=r,n.fill=i,this.points.push(n),n}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var n=[],r=0,i=this.sprayChunks.length;r<i;r++)for(var a=this.sprayChunks[r],o=0,s=a.length;o<s;o++){var c=new t.Rect({width:a[o].width,height:a[o].width,left:a[o].x+1,top:a[o].y+1,originX:`center`,originY:`center`,fill:this.color});n.push(c)}this.optimizeOverlapping&&(n=this._getOptimizedRects(n));var l=new t.Group(n);this.shadow&&l.set(`shadow`,new t.Shadow(this.shadow)),this.canvas.fire(`before:path:created`,{path:l}),this.canvas.add(l),this.canvas.fire(`path:created`,{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t={},n,r,i;for(r=0,i=e.length;r<i;r++)n=e[r].left+``+e[r].top,t[n]||(t[n]=e[r]);var a=[];for(n in t)a.push(t[n]);return a},render:function(e){var t=this.canvas.contextTop,n,r;for(t.fillStyle=this.color,this._saveAndTransform(t),n=0,r=e.length;n<r;n++){var i=e[n];i.opacity!==void 0&&(t.globalAlpha=i.opacity),t.fillRect(i.x,i.y,i.width,i.width)}t.restore()},_render:function(){var e=this.canvas.contextTop,t,n;for(e.fillStyle=this.color,this._saveAndTransform(e),t=0,n=this.sprayChunks.length;t<n;t++)this.render(this.sprayChunks[t]);e.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var n,r,i,a=this.width/2,o;for(o=0;o<this.density;o++){n=t.util.getRandomInt(e.x-a,e.x+a),r=t.util.getRandomInt(e.y-a,e.y+a),i=this.dotWidthVariance?t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new t.Point(n,r);s.width=i,this.randomOpacity&&(s.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var e=20,n=5,r=t.util.createCanvasElement(),i=r.getContext(`2d`);return r.width=r.height=e+n,i.fillStyle=this.color,i.beginPath(),i.arc(e/2,e/2,e/2,0,Math.PI*2,!1),i.closePath(),i.fill(),r},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace(`this.color`,`"`+this.color+`"`)},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),`repeat`)},_setBrushStyles:function(e){this.callSuper(`_setBrushStyles`,e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var n=this.callSuper(`createPath`,e),r=n._getLeftTopCoords().scalarAdd(n.strokeWidth/2);return n.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-r.x,offsetY:-r.y}),n}}),(function(){var e=t.util.getPointer,n=t.util.degreesToRadians,r=t.util.isTouchEvent;for(var i in t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(e,t){t||={},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:`shiftKey`,centeredScaling:!1,centeredRotation:!1,centeredKey:`altKey`,altActionKey:`shiftKey`,interactive:!0,selection:!0,selectionKey:`shiftKey`,altSelectionKey:null,selectionColor:`rgba(100, 100, 255, 0.3)`,selectionDashArray:[],selectionBorderColor:`rgba(255, 255, 255, 0.3)`,selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:`move`,moveCursor:`move`,defaultCursor:`default`,freeDrawingCursor:`crosshair`,notAllowedCursor:`not-allowed`,containerClass:`canvas-container`,perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e=this.getActiveObjects(),t,n,r;if(e.length>0&&!this.preserveObjectStacking){n=[],r=[];for(var i=0,a=this._objects.length;i<a;i++)t=this._objects[i],e.indexOf(t)===-1?n.push(t):r.push(t);e.length>1&&(this._activeObject._objects=r),n.push.apply(n,r)}else n=this._objects;return n},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&=(this.renderTopLayer(this.contextTop),!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire(`after:render`),this},_normalizePointer:function(e,n){var r=e.calcTransformMatrix(),i=t.util.invertTransform(r),a=this.restorePointerVpt(n);return t.util.transformPoint(a,i)},isTargetTransparent:function(e,n,r){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:n,y:r}),a=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),o=Math.max(e.cacheTranslationY+i.y*e.zoomY,0),s=t.util.isTransparent(e._cacheContext,Math.round(a),Math.round(o),this.targetFindTolerance);return s}var c=this.contextCache,l=e.selectionBackgroundColor,u=this.viewportTransform;e.selectionBackgroundColor=``,this.clearContext(c),c.save(),c.transform(u[0],u[1],u[2],u[3],u[4],u[5]),e.render(c),c.restore(),e.selectionBackgroundColor=l;var s=t.util.isTransparent(c,n,r,this.targetFindTolerance);return s},_isSelectionKeyPressed:function(e){var t=!1;return t=Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return e[t]===!0}):e[this.selectionKey],t},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),r=this._activeObject;return!t||t&&r&&n.length>1&&n.indexOf(t)===-1&&r!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&r&&r!==t},_shouldCenterTransform:function(e,t,n){if(e){var r;return t===`scale`||t===`scaleX`||t===`scaleY`||t===`resizing`?r=this.centeredScaling||e.centeredScaling:t===`rotate`&&(r=this.centeredRotation||e.centeredRotation),r?!n:n}},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return t===`ml`||t===`tl`||t===`bl`?n.x=`right`:(t===`mr`||t===`tr`||t===`br`)&&(n.x=`left`),t===`tl`||t===`mt`||t===`tr`?n.y=`bottom`:(t===`bl`||t===`mb`||t===`br`)&&(n.y=`top`),n},_getActionFromCorner:function(e,t,n,r){if(!t||!e)return`drag`;var i=r.controls[t];return i.getActionName(n,i,r)},_setupCurrentTransform:function(e,r,i){if(r){var a=this.getPointer(e),o=r.__corner,s=r.controls[o],c=i&&o?s.getActionHandler(e,r,s):t.controlsUtils.dragHandler,l=this._getActionFromCorner(i,o,e,r),u=this._getOriginFromCorner(r,o),d=e[this.centeredKey],f={target:r,action:l,actionHandler:c,corner:o,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:a.x-r.left,offsetY:a.y-r.top,originX:u.x,originY:u.y,ex:a.x,ey:a.y,lastX:a.x,lastY:a.y,theta:n(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:d,original:t.util.saveObjectTransform(r)};this._shouldCenterTransform(r,l,d)&&(f.originX=`center`,f.originY=`center`),f.original.originX=u.x,f.original.originY=u.y,this._currentTransform=f,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var n=this._groupSelector,r=new t.Point(n.ex,n.ey),i=t.util.transformPoint(r,this.viewportTransform),a=new t.Point(n.ex+n.left,n.ey+n.top),o=t.util.transformPoint(a,this.viewportTransform),s=Math.min(i.x,o.x),c=Math.min(i.y,o.y),l=Math.max(i.x,o.x),u=Math.max(i.y,o.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,c,l-s,u-c)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,c+=d,l-=d,u-=d,t.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,c,l-s,u-c))},findTarget:function(e,t){if(!this.skipTargetFind){var n=this.getPointer(e,!0),i=this._activeObject,a=this.getActiveObjects(),o,s,c=r(e),l=a.length>1&&!t||a.length===1;if(this.targets=[],l&&i._findTargetCorner(n,c)||a.length>1&&!t&&i===this._searchPossibleTargets([i],n))return i;if(a.length===1&&i===this._searchPossibleTargets([i],n))if(this.preserveObjectStacking)o=i,s=this.targets,this.targets=[];else return i;var u=this._searchPossibleTargets(this._objects,n);return e[this.altSelectionKey]&&u&&o&&u!==o&&(u=o,this.targets=s),u}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e))if((this.perPixelTargetFind||t.perPixelTargetFind)&&!t.isEditing){if(!this.isTargetTransparent(t,n.x,n.y))return!0}else return!0},_searchPossibleTargets:function(e,n){for(var r,i=e.length,a;i--;){var o=e[i],s=o.group?this._normalizePointer(o.group,n):n;if(this._checkTarget(s,o,n)){r=e[i],r.subTargetCheck&&r instanceof t.Group&&(a=this._searchPossibleTargets(r._objects,n),a&&this.targets.push(a));break}}return r},restorePointerVpt:function(e){return t.util.transformPoint(e,t.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var r=e(t),i=this.upperCanvasEl,a=i.getBoundingClientRect(),o=a.width||0,s=a.height||0,c;(!o||!s)&&(`top`in a&&`bottom`in a&&(s=Math.abs(a.top-a.bottom)),`right`in a&&`left`in a&&(o=Math.abs(a.right-a.left))),this.calcOffset(),r.x-=this._offset.left,r.y-=this._offset.top,n||(r=this.restorePointerVpt(r));var l=this.getRetinaScaling();return l!==1&&(r.x/=l,r.y/=l),c=o===0||s===0?{width:1,height:1}:{width:i.width/o,height:i.height/s},{x:r.x*c.width,y:r.y*c.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,``),n=this.lowerCanvasEl,r=this.upperCanvasEl;r?r.className=``:(r=this._createCanvasElement(),this.upperCanvasEl=r),t.util.addClass(r,`upper-canvas `+e),this.wrapperEl.appendChild(r),this._copyCanvasStyle(n,r),this._applyCanvasStyle(r),this.contextTop=r.getContext(`2d`)},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute(`width`,this.width),this.cacheCanvasEl.setAttribute(`height`,this.height),this.contextCache=this.cacheCanvasEl.getContext(`2d`)},_initWrapperElement:function(){this.wrapperEl=t.util.wrapElement(this.lowerCanvasEl,`div`,{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+`px`,height:this.height+`px`,position:`relative`}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var n=this.width||e.width,r=this.height||e.height;t.util.setStyle(e,{position:`absolute`,width:n+`px`,height:r+`px`,left:0,top:0,"touch-action":this.allowTouchScrolling?`manipulation`:`none`,"-ms-touch-action":this.allowTouchScrolling?`manipulation`:`none`}),e.width=n,e.height=r,t.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type===`activeSelection`&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire(`before:selection:cleared`,{target:e}),this._discardActiveObject(),this.fire(`selection:cleared`,{target:e}),e.fire(`deselected`)),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper(`_onObjectRemoved`,e)},_fireSelectionEvents:function(e,t){var n=!1,r=this.getActiveObjects(),i=[],a=[];e.forEach(function(e){r.indexOf(e)===-1&&(n=!0,e.fire(`deselected`,{e:t,target:e}),a.push(e))}),r.forEach(function(r){e.indexOf(r)===-1&&(n=!0,r.fire(`selected`,{e:t,target:r}),i.push(r))}),e.length>0&&r.length>0?n&&this.fire(`selection:updated`,{e:t,selected:i,deselected:a}):r.length>0?this.fire(`selection:created`,{e:t,selected:i}):e.length>0&&this.fire(`selection:cleared`,{e:t,deselected:a})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t})?!1:(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire(`before:selection:cleared`,{target:n,e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,[`upperCanvasEl`,`cacheCanvasEl`].forEach((function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}).bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper(`clear`)},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(e),i=this.callSuper(`_toObject`,e,t,n);return this._unwindGroupTransformOnObject(e,r),i},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type===`activeSelection`&&this._activeObject===e.group){var n=[`angle`,`flipX`,`flipY`,`left`,`scaleX`,`scaleY`,`skewX`,`skewY`,`top`],r={};return n.forEach(function(t){r[t]=e[t]}),t.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),r}else return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(t);this.callSuper(`_setSVGObject`,e,t,n),this._unwindGroupTransformOnObject(t,r)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),t.StaticCanvas)i!==`prototype`&&(t.Canvas[i]=t.StaticCanvas[i])})(),(function(){var e=t.util.addListener,n=t.util.removeListener,r=3,i=2,a=1,o={passive:!1};function s(e,t){return e.button&&e.button===t-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,`add`)},_getEventPrefix:function(){return this.enablePointerEvents?`pointer`:`mouse`},addOrRemove:function(e,n){var r=this.upperCanvasEl,i=this._getEventPrefix();e(t.window,`resize`,this._onResize),e(r,i+`down`,this._onMouseDown),e(r,i+`move`,this._onMouseMove,o),e(r,i+`out`,this._onMouseOut),e(r,i+`enter`,this._onMouseEnter),e(r,`wheel`,this._onMouseWheel),e(r,`contextmenu`,this._onContextMenu),e(r,`dblclick`,this._onDoubleClick),e(r,`dragover`,this._onDragOver),e(r,`dragenter`,this._onDragEnter),e(r,`dragleave`,this._onDragLeave),e(r,`drop`,this._onDrop),this.enablePointerEvents||e(r,`touchstart`,this._onTouchStart,o),typeof eventjs<`u`&&n in eventjs&&(eventjs[n](r,`gesture`,this._onGesture),eventjs[n](r,`drag`,this._onDrag),eventjs[n](r,`orientation`,this._onOrientationChange),eventjs[n](r,`shake`,this._onShake),eventjs[n](r,`longpress`,this._onLongPress))},removeListeners:function(){this.addOrRemove(n,`remove`);var e=this._getEventPrefix();n(t.document,e+`up`,this._onMouseUp),n(t.document,`touchend`,this._onTouchEnd,o),n(t.document,e+`move`,this._onMouseMove,o),n(t.document,`touchmove`,this._onMouseMove,o)},_bindEvents:function(){this.eventsBound||=(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,`dragenter`),this._onDragLeave=this._simpleEventHandler.bind(this,`dragleave`),this._onDrop=this._onDrop.bind(this),!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire(`mouse:out`,{target:t,e}),this._hoveredTarget=null,t&&t.fire(`mouseout`,{e});var n=this;this._hoveredTargets.forEach(function(t){n.fire(`mouse:out`,{target:t,e}),t&&t.fire(`mouseout`,{e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire(`mouse:over`,{target:null,e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler(`dragover`,e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler(`drop:before`,e),this._simpleEventHandler(`drop`,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`dblclick`),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return e.isPrimary===!0?!0:e.isPrimary===!1?!1:e.type===`touchend`&&e.touches.length===0?!0:e.changedTouches?e.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(r){r.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(r)),this.__onMouseDown(r),this._resetTransformEventData();var i=this.upperCanvasEl,a=this._getEventPrefix();e(t.document,`touchend`,this._onTouchEnd,o),e(t.document,`touchmove`,this._onMouseMove,o),n(i,a+`down`,this._onMouseDown)},_onMouseDown:function(r){this.__onMouseDown(r),this._resetTransformEventData();var i=this.upperCanvasEl,a=this._getEventPrefix();n(i,a+`move`,this._onMouseMove,o),e(t.document,a+`up`,this._onMouseUp),e(t.document,a+`move`,this._onMouseMove,o)},_onTouchEnd:function(r){if(!(r.touches.length>0)){this.__onMouseUp(r),this._resetTransformEventData(),this.mainTouchId=null;var i=this._getEventPrefix();n(t.document,`touchend`,this._onTouchEnd,o),n(t.document,`touchmove`,this._onMouseMove,o);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(a.upperCanvasEl,i+`down`,a._onMouseDown),a._willAddMouseDown=0},400)}},_onMouseUp:function(r){this.__onMouseUp(r),this._resetTransformEventData();var i=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(r)&&(n(t.document,a+`up`,this._onMouseUp),n(t.document,a+`move`,this._onMouseMove,o),e(i,a+`move`,this._onMouseMove,o))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!t!=!!e||t&&e&&t!==e?!0:(t&&t.isEditing,!1)},__onMouseUp:function(e){var n,o=this._currentTransform,c=this._groupSelector,l=!1,u=!c||c.left===0&&c.top===0;if(this._cacheTransformEventData(e),n=this._target,this._handleEvent(e,`up:before`),s(e,r)){this.fireRightClick&&this._handleEvent(e,`up`,r,u);return}if(s(e,i)){this.fireMiddleClick&&this._handleEvent(e,`up`,i,u),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(e);return}if(this._isMainEvent(e)){if(o&&(this._finalizeCurrentTransform(e),l=o.actionPerformed),!u){var d=n===this._activeObject;this._maybeGroupObjects(e),l||=this._shouldRender(n)||!d&&n===this._activeObject}var f,p;if(n){if(f=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e)),n.selectable&&n!==this._activeObject&&n.activeOn===`up`)this.setActiveObject(n,e),l=!0;else{var m=n.controls[f],h=m&&m.getMouseUpHandler(e,n,m);h&&(p=this.getPointer(e),h(e,o,p.x,p.y))}n.isMoving=!1}if(o&&(o.target!==n||o.corner!==f)){var g=o.target&&o.target.controls[o.corner],_=g&&g.getMouseUpHandler(e,n,m);p||=this.getPointer(e),_&&_(e,o,p.x,p.y)}this._setCursorFromEvent(e,n),this._handleEvent(e,`up`,a,u),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=0),l?this.requestRenderAll():u||this.renderTop()}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),r=this.targets,i={e:t,target:n,subTargets:r};if(this.fire(e,i),n&&n.fire(e,i),!r)return n;for(var a=0;a<r.length;a++)r[a].fire(e,i);return n},_handleEvent:function(e,t,n,r){var i=this._target,o=this.targets||[],s={e,target:i,subTargets:o,button:n||a,isClick:r||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};t===`up`&&(s.currentTarget=this.findTarget(e),s.currentSubTargets=this.targets),this.fire(`mouse:`+t,s),i&&i.fire(`mouse`+t,s);for(var c=0;c<o.length;c++)o[c].fire(`mouse`+t,s)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,n=t.target,r={e,target:n,transform:t,action:t.action};n._scaling&&=!1,n.setCoords(),(t.actionPerformed||this.stateful&&n.hasStateChanged())&&this._fire(`modified`,r)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e,pointer:t}),this._handleEvent(e,`down`)},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,`move`)},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e,pointer:t}),this._handleEvent(e,`up`)},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`down:before`);var n=this._target;if(s(e,r)){this.fireRightClick&&this._handleEvent(e,`down`,r);return}if(s(e,i)){this.fireMiddleClick&&this._handleEvent(e,`down`,i);return}if(this.isDrawingMode){this._onMouseDownInDrawingMode(e);return}if(this._isMainEvent(e)&&!this._currentTransform){var a=this._pointer;this._previousPointer=a;var o=this._shouldRender(n),c=this._shouldGroup(e,n);if(this._shouldClearSelection(e,n)?this.discardActiveObject(e):c&&(this._handleGrouping(e,n),n=this._activeObject),this.selection&&(!n||!n.selectable&&!n.isEditing&&n!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),n){var l=n===this._activeObject;n.selectable&&n.activeOn===`down`&&this.setActiveObject(n,e);var u=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e));if(n.__corner=u,n===this._activeObject&&(u||!c)){this._setupCurrentTransform(e,n,l);var d=n.controls[u],a=this.getPointer(e),f=d&&d.getMouseDownHandler(e,n,d);f&&f(e,this._currentTransform,a.x,a.y)}}this._handleEvent(e,`down`),(o||c)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire(`before:transform`,{e,transform:t})},__onMouseMove:function(e){this._handleEvent(e,`move:before`),this._cacheTransformEventData(e);var t,n;if(this.isDrawingMode){this._onMouseMoveInDrawingMode(e);return}if(this._isMainEvent(e)){var r=this._groupSelector;r?(n=this._absolutePointer,r.left=n.x-r.ex,r.top=n.y-r.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,`move`),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var n=this._hoveredTarget,r=this._hoveredTargets,i=this.targets,a=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:`mouseout`,canvasEvtOut:`mouse:out`,evtIn:`mouseover`,canvasEvtIn:`mouse:over`});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(i[o],t,{oldTarget:r[o],evtOut:`mouseout`,evtIn:`mouseover`});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var n=this._draggedoverTarget,r=this._hoveredTargets,i=this.targets,a=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:`dragleave`,evtIn:`dragenter`});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(i[o],t,{oldTarget:r[o],evtOut:`dragleave`,evtIn:`dragenter`});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,n){var r,i,a=n.oldTarget,o,s,c=a!==e,l=n.canvasEvtIn,u=n.canvasEvtOut;c&&(r={e:t,target:e,previousTarget:a},i={e:t,target:a,nextTarget:e}),s=e&&c,o=a&&c,o&&(u&&this.fire(u,i),a.fire(n.evtOut,i)),s&&(l&&this.fire(l,r),e.fire(n.evtIn,r))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`wheel`),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),n=this._currentTransform;n.reset=!1,n.shiftKey=e.shiftKey,n.altKey=e[this.centeredKey],this._performTransformAction(e,n,t),n.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,n){var r=n.x,i=n.y,a=t.action,o=!1,s=t.actionHandler;s&&(o=s(e,t,r,i)),a===`drag`&&o&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||o},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var n=t.hoverCursor||this.hoverCursor,r=this._activeObject&&this._activeObject.type===`activeSelection`?this._activeObject:null,i=(!r||!r.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){n=e.hoverCursor||n}),this.setCursor(n))},getCornerCursor:function(e,t,n){var r=t.controls[e];return r.cursorStyleHandler(n,r,t)}})})(),(function(){var e=Math.min,n=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(e,t){var n=this._activeObject;return n&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(n!==t||n.type===`activeSelection`)&&!t.onSelect({e})},_handleGrouping:function(e,t){var n=this._activeObject;n.__corner||t===n&&(t=this.findTarget(e,!0),!t||!t.selectable)||(n&&n.type===`activeSelection`?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var n=this._activeObject,r=n._objects.slice(0);n.contains(e)?(n.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),n.size()===1&&this._setActiveObject(n.item(0),t)):(n.addWithUpdate(e),this._hoveredTarget=n,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(r,t)},_createActiveSelection:function(e,t){var n=this.getActiveObjects(),r=this._createGroup(e);this._hoveredTarget=r,this._setActiveObject(r,t),this._fireSelectionEvents(n,t)},_createGroup:function(e){var n=this._objects,r=n.indexOf(this._activeObject)<n.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(r,{canvas:this})},_groupSelectedObjects:function(e){var n=this._collectObjects(e),r;n.length===1?this.setActiveObject(n[0],e):n.length>1&&(r=new t.ActiveSelection(n.reverse(),{canvas:this}),this.setActiveObject(r,e))},_collectObjects:function(r){for(var i=[],a,o=this._groupSelector.ex,s=this._groupSelector.ey,c=o+this._groupSelector.left,l=s+this._groupSelector.top,u=new t.Point(e(o,c),e(s,l)),d=new t.Point(n(o,c),n(s,l)),f=!this.selectionFullyContained,p=o===c&&s===l,m=this._objects.length;m--&&(a=this._objects[m],!(!(!a||!a.selectable||!a.visible)&&(f&&a.intersectsWithRect(u,d,!0)||a.isContainedWithinRect(u,d,!0)||f&&a.containsPoint(u,null,!0)||f&&a.containsPoint(d,null,!0))&&(i.push(a),p))););return i.length>1&&(i=i.filter(function(e){return!e.onSelect({e:r})})),i},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})})(),(function(){t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(e){e||={};var n=e.format||`png`,r=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),a=this.toCanvasElement(i,e);return t.util.toDataURL(a,n,r)},toCanvasElement:function(e,n){e||=1,n||={};var r=(n.width||this.width)*e,i=(n.height||this.height)*e,a=this.getZoom(),o=this.width,s=this.height,c=a*e,l=this.viewportTransform,u=(l[4]-(n.left||0))*e,d=(l[5]-(n.top||0))*e,f=this.interactive,p=[c,0,0,c,u,d],m=this.enableRetinaScaling,h=t.util.createCanvasElement(),g=this.contextTop;return h.width=r,h.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=p,this.width=r,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(h.getContext(`2d`),this._objects),this.viewportTransform=l,this.width=o,this.height=s,this.calcViewportBoundaries(),this.interactive=f,this.enableRetinaScaling=m,this.contextTop=g,h}})})(),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(e,n,r){if(e){var i=typeof e==`string`?JSON.parse(e):t.util.object.clone(e),a=this,o=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){a.clear(),a._setBgOverlay(i,function(){o?a._enlivenObjects([o],function(t){a.clipPath=t[0],a.__setupCanvas.call(a,i,e,s,n)}):a.__setupCanvas.call(a,i,e,s,n)})},r),this}},__setupCanvas:function(e,t,n,r){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),r&&r()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!e.backgroundImage&&!e.overlayImage&&!e.background&&!e.overlay){t&&t();return}var r=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay(`backgroundImage`,e.backgroundImage,n,r),this.__setBgOverlay(`overlayImage`,e.overlayImage,n,r),this.__setBgOverlay(`backgroundColor`,e.background,n,r),this.__setBgOverlay(`overlayColor`,e.overlay,n,r)},__setBgOverlay:function(e,n,r,i){var a=this;if(!n){r[e]=!0,i&&i();return}e===`backgroundImage`||e===`overlayImage`?t.util.enlivenObjects([n],function(t){a[e]=t[0],r[e]=!0,i&&i()}):this[`set`+t.util.string.capitalize(e,!0)](n,function(){r[e]=!0,i&&i()})},_enlivenObjects:function(e,n,r){if(!e||e.length===0){n&&n([]);return}t.util.enlivenObjects(e,function(e){n&&n(e)},null,r)},_toDataURL:function(e,t){this.clone(function(n){t(n.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,n){this.clone(function(r){n(r.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(n,function(){e&&e(t)})})},cloneWithoutData:function(e){var n=t.util.createCanvasElement();n.width=this.width,n.height=this.height;var r=new t.Canvas(n);this.backgroundImage?(r.setBackgroundImage(this.backgroundImage.src,function(){r.renderAll(),e&&e(r)}),r.backgroundImageOpacity=this.backgroundImageOpacity,r.backgroundImageStretch=this.backgroundImageStretch):e&&e(r)}}),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,a=t.util.string.capitalize,o=t.util.degreesToRadians,s=!t.isLikelyNode,c=2;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:`object`,originX:`left`,originY:`top`,top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:`rgb(178,204,255)`,borderDashArray:null,cornerColor:`rgb(178,204,255)`,cornerStrokeColor:null,cornerStyle:`rect`,cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:`rgb(0,0,0)`,fillRule:`nonzero`,globalCompositeOperation:`source-over`,backgroundColor:``,selectionBackgroundColor:``,stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:`butt`,strokeLineJoin:`miter`,strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:`fill`,activeOn:`down`,stateProperties:`top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform`.split(` `),cacheProperties:`fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath`.split(` `),colorProperties:`fill stroke backgroundColor`.split(` `),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext(`2d`),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,r=e.width,i=e.height,a=t.maxCacheSideLimit,o=t.minCacheSideLimit;if(r<=a&&i<=a&&r*i<=n)return r<o&&(e.width=o),i<o&&(e.height=o),e;var s=r/i,c=t.util.limitDimsByArea(s,n),l=t.util.capValue,u=l(o,c.x,a),d=l(o,c.y,a);return r>u&&(e.zoomX/=r/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,r=t.y*e.scaleY/this.scaleY;return{width:Math.ceil(n+c),height:Math.ceil(r+c),zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:r}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var t=e._currentTransform.target,n=e._currentTransform.action;if(this===t&&n.slice&&n.slice(0,5)===`scale`)return!1}var r=this._cacheCanvas,i=this._limitCacheSize(this._getCacheCanvasDimensions()),a=i.width,o=i.height,s,c,l=i.zoomX,u=i.zoomY,d=a!==this.cacheWidth||o!==this.cacheHeight,f=this.zoomX!==l||this.zoomY!==u;return d||f?(d?(r.width=a,r.height=o):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,r.width,r.height)),s=i.x/2,c=i.y/2,this.cacheTranslationX=Math.round(r.width/2-s)+s,this.cacheTranslationY=Math.round(r.height/2-c)+c,this.cacheWidth=a,this.cacheHeight=o,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(l,u),this.zoomX=l,this.zoomY=u,!0):!1},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,`fill`),this._initGradient(e.stroke,`stroke`),this._initPattern(e.fill,`fill`),this._initPattern(e.stroke,`stroke`)},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,r={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,n),top:i(this.top,n),width:i(this.width,n),height:i(this.height,n),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,n),scaleX:i(this.scaleX,n),scaleY:i(this.scaleY,n),angle:i(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,n),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,n),skewY:i(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(r.clipPath=this.clipPath.toObject(e),r.clipPath.inverted=this.clipPath.inverted,r.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,r,e),this.includeDefaultValues||(r=this._removeDefaultValues(r)),r},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach(function(t){t===`left`||t===`top`||(e[t]===n[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(n[t])&&e[t].length===0&&n[t].length===0&&delete e[t])}),e},toString:function(){return`#<fabric.`+a(this.type)+`>`},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var r=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=r*i,n*=r*i}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var r=e===`scaleX`||e===`scaleY`,i=this[e]!==n,a=!1;return r&&(n=this._constrainScale(n)),e===`scaleX`&&n<0?(this.flipX=!this.flipX,n*=-1):e===`scaleY`&&n<0?(this.flipY=!this.flipY,n*=-1):e===`shadow`&&n&&!(n instanceof t.Shadow)?n=new t.Shadow(n):e===`dirty`&&this.group&&this.group.set(`dirty`,n),this[e]=n,i&&(a=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,a&&this.group.set(`dirty`,!0)):a&&this.stateProperties.indexOf(e)>-1&&this.group.set(`dirty`,!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:`cacheProperties`})),e.restore())},renderCache:function(e){e||={},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:`cacheProperties`}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!==`transparent`&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!==`transparent`},needsItsOwnCache:function(){return!!(this.paintFirst===`stroke`&&this.hasFill()&&this.hasStroke()&&typeof this.shadow==`object`||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(e,n){if(e.save(),n.inverted?e.globalCompositeOperation=`destination-out`:e.globalCompositeOperation=`destination-in`,n.absolutePositioned){var r=t.util.invertTransform(this.calcTransformMatrix());e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,r=this.stroke;t?(this.fill=`black`,this.stroke=``,this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=n,this.stroke=r},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged(`cacheProperties`)){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?n.gradientUnits===`percentage`||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle=`transparent`,e.fillStyle=`#000000`},_setLineDash:function(e,t){!t||t.length===0||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var r=this.getViewportTransform(),i=this.calcTransformMatrix(),a,s,c;n||={},s=n.hasBorders===void 0?this.hasBorders:n.hasBorders,c=n.hasControls===void 0?this.hasControls:n.hasControls,i=t.util.multiplyTransformMatrices(r,i),a=t.util.qrDecompose(i),e.save(),e.translate(a.translateX,a.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(a.angle-=180),e.rotate(o(this.group?a.angle:this.angle)),n.forActiveSelection||this.group?s&&this.drawBordersInGroup(e,a,n):s&&this.drawBorders(e,n),c&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n=this.shadow,r=this.canvas,i,a=r&&r.viewportTransform[0]||1,o=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(a*=t.devicePixelRatio,o*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(a+o)*(i.scaleX+i.scaleY)/4,e.shadowOffsetX=n.offsetX*a*i.scaleX,e.shadowOffsetY=n.offsetY*o*i.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor=``,e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,r=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return t.gradientUnits===`percentage`?e.transform(this.width,0,0,this.height,r,i):e.transform(1,0,0,1,r,i),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:r,offsetY:i}},_renderPaintInOrder:function(e){this.paintFirst===`stroke`?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),this.fillRule===`evenodd`?e.fill(`evenodd`):e.fill(),e.restore())},_renderStroke:function(e){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var r=this._limitCacheSize(this._getCacheCanvasDimensions()),i=t.util.createCanvasElement(),a,o=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/o,c=r.y/this.scaleY/o;i.width=Math.ceil(s),i.height=Math.ceil(c),a=i.getContext(`2d`),a.beginPath(),a.moveTo(0,0),a.lineTo(s,0),a.lineTo(s,c),a.lineTo(0,c),a.closePath(),a.translate(s/2,c/2),a.scale(r.zoomX/this.scaleX/o,r.zoomY/this.scaleY/o),this._applyPatternGradientTransform(a,n),a.fillStyle=n.toLive(e),a.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(o*this.scaleX/r.zoomX,o*this.scaleY/r.zoomY),e.strokeStyle=a.createPattern(i,`no-repeat`)},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set(`scaleX`,e.scaleX),this.set(`scaleY`,e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,`center`,`center`)},clone:function(e,n){var r=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(r,e):t.Object._fromObject(`Object`,r,e)},cloneAsImage:function(e,n){var r=this.toCanvasElement(n);return e&&e(new t.Image(r)),this},toCanvasElement:function(e){e||={};var n=t.util,r=n.saveObjectTransform(this),i=this.group,a=this.shadow,o=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var c=t.util.createCanvasElement(),l=this.getBoundingRect(!0,!0),u=this.shadow,d,f={x:0,y:0},p,m,h;u&&(p=u.blur,d=u.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),f.x=2*Math.round(o(u.offsetX)+p)*o(d.scaleX),f.y=2*Math.round(o(u.offsetY)+p)*o(d.scaleY)),m=l.width+f.x,h=l.height+f.y,c.width=Math.ceil(m),c.height=Math.ceil(h);var g=new t.StaticCanvas(c,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});e.format===`jpeg`&&(g.backgroundColor=`#fff`),this.setPositionByOrigin(new t.Point(g.width/2,g.height/2),`center`,`center`);var _=this.canvas;g.add(this);var v=g.toCanvasElement(s||1,e);return this.shadow=a,this.set(`canvas`,_),i&&(this.group=i),this.set(r).setCoords(),g._objects=[],g.dispose(),g=null,v},toDataURL:function(e){return e||={},t.util.toDataURL(this.toCanvasElement(e),e.format||`png`,e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=(this.originX!==`center`||this.originY!==`center`)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set(`angle`,e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,n){n||=this.canvas.getPointer(e);var r=new t.Point(n.x,n.y),i=this._getLeftTopCoords();return this.angle&&(r=t.util.rotatePoint(r,i,o(-this.angle))),{x:r.x-i.x,y:r.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=[`clipPath`],t.Object._fromObject=function(e,n,i,a){var o=t[e];n=r(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],function(e){e[0]!==void 0&&(n.fill=e[0]),e[1]!==void 0&&(n.stroke=e[1]),t.util.enlivenObjectEnlivables(n,n,function(){var e=a?new o(n[a],n):new o(n);i&&i(e)})})},t.Object.__uid=0)})(e),(function(){var e=t.util.degreesToRadians,n={left:-.5,center:0,right:.5},r={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(e,i,a,o,s){var c=e.x,l=e.y,u,d,f;return typeof i==`string`?i=n[i]:i-=.5,typeof o==`string`?o=n[o]:o-=.5,u=o-i,typeof a==`string`?a=r[a]:a-=.5,typeof s==`string`?s=r[s]:s-=.5,d=s-a,(u||d)&&(f=this._getTransformedDimensions(),c=e.x+u*f.x,l=e.y+d*f.y),new t.Point(c,l)},translateToCenterPoint:function(n,r,i){var a=this.translateToGivenOrigin(n,r,i,`center`,`center`);return this.angle?t.util.rotatePoint(a,n,e(this.angle)):a},translateToOriginPoint:function(n,r,i){var a=this.translateToGivenOrigin(n,`center`,`center`,r,i);return this.angle?t.util.rotatePoint(a,n,e(this.angle)):a},getCenterPoint:function(){var e=new t.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(n,r,i){var a=this.getCenterPoint(),o=r!==void 0&&i!==void 0?this.translateToGivenOrigin(a,`center`,`center`,r,i):new t.Point(this.left,this.top),s=new t.Point(n.x,n.y);return this.angle&&(s=t.util.rotatePoint(s,a,-e(this.angle))),s.subtractEquals(o)},setPositionByOrigin:function(e,t,n){var r=this.translateToCenterPoint(e,t,n),i=this.translateToOriginPoint(r,this.originX,this.originY);this.set(`left`,i.x),this.set(`top`,i.y)},adjustPosition:function(r){var i=e(this.angle),a=this.getScaledWidth(),o=t.util.cos(i)*a,s=t.util.sin(i)*a,c=typeof this.originX==`string`?n[this.originX]:this.originX-.5,l=typeof r==`string`?n[r]:r-.5;this.left+=o*(l-c),this.top+=s*(l-c),this.setCoords(),this.originX=r},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX=`center`,this.originY=`center`,this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),`left`,`top`)}})})(),(function(){function e(e){return[new t.Point(e.tl.x,e.tl.y),new t.Point(e.tr.x,e.tr.y),new t.Point(e.br.x,e.br.y),new t.Point(e.bl.x,e.bl.y)]}var n=t.util,r=n.degreesToRadians,i=n.multiplyTransformMatrices,a=n.transformPoint;n.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(t,n){return e(this._getCoords(t,n))},intersectsWithRect:function(e,n,r,i){var a=this.getCoords(r,i);return t.Intersection.intersectPolygonRectangle(a,e,n).status===`Intersection`},intersectsWithObject:function(e,n,r){return t.Intersection.intersectPolygonPolygon(this.getCoords(n,r),e.getCoords(n,r)).status===`Intersection`||e.isContainedWithinObject(this,n,r)||this.isContainedWithinObject(e,n,r)},isContainedWithinObject:function(e,t,n){for(var r=this.getCoords(t,n),i=t?e.aCoords:e.lineCoords,a=0,o=e._getImageLines(i);a<4;a++)if(!e.containsPoint(r[a],o))return!1;return!0},isContainedWithinRect:function(e,t,n,r){var i=this.getBoundingRect(n,r);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,n,r){var i=this._getCoords(n,r),t=t||this._getImageLines(i),a=this._findCrossPoints(e,t);return a!==0&&a%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return this.getCoords(!0,e).some(function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y})||this.intersectsWithRect(t,n,!0,e)?!0:this._containsCenterOfCanvas(t,n,e)},_containsCenterOfCanvas:function(e,t,n){var r={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(r,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return this.intersectsWithRect(t,n,!0,e)?!0:this.getCoords(!0,e).every(function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,r,i,a,o,s=0,c;for(var l in t)if(c=t[l],!(c.o.y<e.y&&c.d.y<e.y)&&!(c.o.y>=e.y&&c.d.y>=e.y)&&(c.o.x===c.d.x&&c.o.x>=e.x?o=c.o.x:(n=0,r=(c.d.y-c.o.y)/(c.d.x-c.o.x),i=e.y-n*e.x,a=c.o.y-r*c.o.x,o=-(i-a)/(n-r)),o>=e.x&&(s+=1),s===2))break;return s},getBoundingRect:function(e,t){var r=this.getCoords(e,t);return n.makeBoundingBoxFromPoints(r)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:e===0?1e-4:e},scale:function(e){return this._set(`scaleX`,e),this._set(`scaleY`,e),this.setCoords()},scaleToWidth:function(e,t){var n=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/n)},scaleToHeight:function(e,t){var n=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/n)},calcLineCoords:function(){var e=this.getViewportTransform(),t=this.padding,i=r(this.angle),o=n.cos(i),s=n.sin(i),c=o*t,l=s*t,u=c+l,d=c-l,f=this.calcACoords(),p={tl:a(f.tl,e),tr:a(f.tr,e),bl:a(f.bl,e),br:a(f.br,e)};return t&&(p.tl.x-=d,p.tl.y-=u,p.tr.x+=u,p.tr.y-=d,p.bl.x-=u,p.bl.y+=d,p.br.x+=d,p.br.y+=u),p},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(i(n,t),e),r=i(r,[1/n[0],0,0,1/n[3],0,0]),a=this._calculateCurrentDimensions(),o={};return this.forEachControl(function(e,t,n){o[t]=e.positionHandler(a,r,n)}),o},calcACoords:function(){var e=this._calcRotateMatrix(),t=i(this._calcTranslateMatrix(),e),n=this._getTransformedDimensions(),r=n.x/2,o=n.y/2;return{tl:a({x:-r,y:-o},t),tr:a({x:r,y:-o},t),bl:a({x:-r,y:o},t),br:a({x:r,y:o},t)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e?this:(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords(),this)},_calcRotateMatrix:function(){return n.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t=`_`,n=``;return!e&&this.group&&(n=this.group.transformMatrixKey(e)+t),n+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),r=this.matrixCache||={};return r.key===n?r.value:(this.group&&(t=i(this.group.calcTransformMatrix(!1),t)),r.key=n,r.value=t,t)},calcOwnMatrix:function(){var e=this.transformMatrixKey(!0),t=this.ownMatrixCache||={};if(t.key===e)return t.value;var r=this._calcTranslateMatrix(),i={angle:this.angle,translateX:r[4],translateY:r[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return t.key=e,t.value=n.composeMatrix(i),t.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(e,t){e===void 0&&(e=this.skewX),t===void 0&&(t=this.skewY);var r,i,a,o=e===0&&t===0;if(this.strokeUniform?(i=this.width,a=this.height):(r=this._getNonTransformedDimensions(),i=r.x,a=r.y),o)return this._finalizeDimensions(i*this.scaleX,a*this.scaleY);var s=n.sizeAfterTransform(i,a,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:e,skewY:t});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform();return a(this._getTransformedDimensions(),e,!0).scalarAdd(2*this.padding)}})})(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&this.group.type!==`activeSelection`?t.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),(function(){function e(e,n){if(!n)return e+`: none; `;if(n.toLive)return e+`: url(#SVGID_`+n.id+`); `;var r=new t.Color(n),i=e+`: `+r.toRgb()+`; `,a=r.getAlpha();return a!==1&&(i+=e+`-opacity: `+a.toString()+`; `),i}var n=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(t){var n=this.fillRule?this.fillRule:`nonzero`,r=this.strokeWidth?this.strokeWidth:`0`,i=this.strokeDashArray?this.strokeDashArray.join(` `):`none`,a=this.strokeDashOffset?this.strokeDashOffset:`0`,o=this.strokeLineCap?this.strokeLineCap:`butt`,s=this.strokeLineJoin?this.strokeLineJoin:`miter`,c=this.strokeMiterLimit?this.strokeMiterLimit:`4`,l=this.opacity===void 0?`1`:this.opacity,u=this.visible?``:` visibility: hidden;`,d=t?``:this.getSvgFilter(),f=e(`fill`,this.fill);return[e(`stroke`,this.stroke),`stroke-width: `,r,`; `,`stroke-dasharray: `,i,`; `,`stroke-linecap: `,o,`; `,`stroke-dashoffset: `,a,`; `,`stroke-linejoin: `,s,`; `,`stroke-miterlimit: `,c,`; `,f,`fill-rule: `,n,`; `,`opacity: `,l,`;`,d,u].join(``)},getSvgSpanStyles:function(t,n){var r=`; `,i=t.fontFamily?`font-family: `+(t.fontFamily.indexOf(`'`)===-1&&t.fontFamily.indexOf(`"`)===-1?`'`+t.fontFamily+`'`:t.fontFamily)+r:``,a=t.strokeWidth?`stroke-width: `+t.strokeWidth+r:``,i=i,o=t.fontSize?`font-size: `+t.fontSize+`px`+r:``,s=t.fontStyle?`font-style: `+t.fontStyle+r:``,c=t.fontWeight?`font-weight: `+t.fontWeight+r:``,l=t.fill?e(`fill`,t.fill):``,u=t.stroke?e(`stroke`,t.stroke):``,d=this.getSvgTextDecoration(t),f=t.deltaY?`baseline-shift: `+-t.deltaY+`; `:``;return d&&=`text-decoration: `+d+r,[u,a,i,o,s,c,d,l,f,n?`white-space: pre; `:``].join(``)},getSvgTextDecoration:function(e){return[`overline`,`underline`,`line-through`].filter(function(t){return e[t.replace(`-`,``)]}).join(` `)},getSvgFilter:function(){return this.shadow?`filter: url(#SVGID_`+this.shadow.id+`);`:``},getSvgCommons:function(){return[this.id?`id="`+this.id+`" `:``,this.clipPath?`clip-path="url(#`+this.clipPath.clipPathId+`)" `:``].join(``)},getSvgTransform:function(e,n){var r=e?this.calcTransformMatrix():this.calcOwnMatrix();return`transform="`+t.util.matrixToSVG(r)+(n||``)+`" `},_setSVGBg:function(e){if(this.backgroundColor){var r=t.Object.NUM_FRACTION_DIGITS;e.push(` <rect `,this._getFillAttributes(this.backgroundColor),` x="`,n(-this.width/2,r),`" y="`,n(-this.height/2,r),`" width="`,n(this.width,r),`" height="`,n(this.height,r),`"></rect>
`)}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return` `+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){t||={};var n=t.reviver,r=t.additionalTransform||``,i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(``),a=e.indexOf(`COMMON_PARTS`);return e[a]=i,n?n(e.join(``)):e.join(``)},_createBaseSVGMarkup:function(e,n){n||={};var r=n.noStyle,i=n.reviver,a=r?``:`style="`+this.getSvgStyles()+`" `,o=n.withShadow?`style="`+this.getSvgFilter()+`" `:``,s=this.clipPath,c=this.strokeUniform?`vector-effect="non-scaling-stroke" `:``,l=s&&s.absolutePositioned,u=this.stroke,d=this.fill,f=this.shadow,p,m=[],h,g=e.indexOf(`COMMON_PARTS`),_=n.additionalTransform;return s&&(s.clipPathId=`CLIPPATH_`+ t.Object.__uid++,h=`<clipPath id="`+s.clipPathId+`" >
`+s.toClipPathSVG(i)+`</clipPath>
`),l&&m.push(`<g `,o,this.getSvgCommons(),` >
`),m.push(`<g `,this.getSvgTransform(!1),l?``:o+this.getSvgCommons(),` >
`),p=[a,c,r?``:this.addPaintOrder(),` `,_?`transform="`+_+`" `:``].join(``),e[g]=p,d&&d.toLive&&m.push(d.toSVG(this)),u&&u.toLive&&m.push(u.toSVG(this)),f&&m.push(f.toSVG(this)),s&&m.push(h),m.push(e.join(``)),m.push(`</g>
`),l&&m.push(`</g>
`),i?i(m.join(``)):m.join(``)},addPaintOrder:function(){return this.paintFirst===`fill`?``:` paint-order="`+this.paintFirst+`" `}})})(),(function(){var e=t.util.object.extend,n=`stateProperties`;function r(t,n,r){var i={};r.forEach(function(e){i[e]=t[e]}),e(t[n],i,!0)}function i(e,t,n){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0,a=e.length;r<a;r++)if(!i(e[r],t[r]))return!1;return!0}else if(e&&typeof e==`object`){var o=Object.keys(e),s;if(!t||typeof t!=`object`||!n&&o.length!==Object.keys(t).length)return!1;for(var r=0,a=o.length;r<a;r++)if(s=o[r],!(s===`canvas`||s===`group`)&&!i(e[s],t[s]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(e){e||=n;var t=`_`+e;return Object.keys(this[t]).length<this[e].length?!0:!i(this[t],this,!0)},saveState:function(e){var t=e&&e.propertySet||n,i=`_`+t;return this[i]?(r(this,i,this[t]),e&&e.stateProperties&&r(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){e||={};var t=e.propertySet||n;return e.propertySet=t,this[`_`+t]={},this.saveState(e),this}})})(),(function(){var e=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var n=e.x,r=e.y,i,a,o=Object.keys(this.oCoords),s=o.length-1,c;for(this.__corner=0;s>=0;s--)if(c=o[s],this.isControlVisible(c)&&(a=this._getImageLines(t?this.oCoords[c].touchCorner:this.oCoords[c].corner),i=this._findCrossPoints({x:n,y:r},a),i!==0&&i%2==1))return this.__corner=c,c;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),r=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore(),this},drawBorders:function(e,t){t||={};var n=this._calculateCurrentDimensions(),r=this.borderScaleFactor,i=n.x+r,a=n.y+r,o=t.hasControls===void 0?this.hasControls:t.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-a/2,i,a),o&&(e.beginPath(),this.forEachControl(function(t,n,r){t.withConnection&&t.getVisibility(r,n)&&(s=!0,e.moveTo(t.x*i,t.y*a),e.lineTo(t.x*i+t.offsetX,t.y*a+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,n,r){r||={};var i=t.util.sizeAfterTransform(this.width,this.height,n),a=this.strokeWidth,o=this.strokeUniform,s=this.borderScaleFactor,c=i.x+a*(o?this.canvas.getZoom():n.scaleX)+s,l=i.y+a*(o?this.canvas.getZoom():n.scaleY)+s;return e.save(),this._setLineDash(e,r.borderDashArray||this.borderDashArray),e.strokeStyle=r.borderColor||this.borderColor,e.strokeRect(-c/2,-l/2,c,l),e.restore(),this},drawControls:function(e,n){n||={},e.save();var r=1,i,a;return this.canvas&&(r=this.canvas.getRetinaScaling()),e.setTransform(r,0,0,r,0,0),e.strokeStyle=e.fillStyle=n.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=n.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,n.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl(function(r,o,s){a=s.oCoords[o],r.getVisibility(s,o)&&(i&&(a=t.util.transformPoint(a,i)),r.render(e,a.x,a.y,n,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||={},this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||={},e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})})(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,n){n||={};var r=function(){},i=n.onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set(`left`,t),o.requestRenderAll(),a()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,n){n||={};var r=function(){},i=n.onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set(`top`,t),o.requestRenderAll(),a()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,n){n||={};var r=function(){},i=n.onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set(`opacity`,t),o.requestRenderAll(),a()},onComplete:function(){o.remove(e),i()}})}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]==`object`){var e=[],t,n,r=[];for(t in arguments[0])e.push(t);for(var i=0,a=e.length;i<a;i++)t=e[i],n=i!==a-1,r.push(this._animate(t,arguments[0][t],arguments[1],n));return r}else return this._animate.apply(this,arguments)},_animate:function(e,n,r,i){var a=this,o;n=n.toString(),r=r?t.util.object.clone(r):{},~e.indexOf(`.`)&&(o=e.split(`.`));var s=a.colorProperties.indexOf(e)>-1||o&&a.colorProperties.indexOf(o[1])>-1,c=o?this.get(o[0])[o[1]]:this.get(e);`from`in r||(r.from=c),s||(n=~n.indexOf(`=`)?c+parseFloat(n.replace(`=`,``)):parseFloat(n));var l={target:this,startValue:r.from,endValue:n,byValue:r.by,easing:r.easing,duration:r.duration,abort:r.abort&&function(e,t,n){return r.abort.call(a,e,t,n)},onChange:function(t,n,s){o?a[o[0]][o[1]]=t:a.set(e,t),!i&&r.onChange&&r.onChange(t,n,s)},onComplete:function(e,t,n){i||(a.setCoords(),r.onComplete&&r.onComplete(e,t,n))}};return s?t.util.animateColor(l.startValue,l.endValue,l.duration,l):t.util.animate(l)}}),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};if(t.Line){t.warn(`fabric.Line is already defined`);return}t.Line=t.util.createClass(t.Object,{type:`line`,x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`x1`,`x2`,`y1`,`y2`),initialize:function(e,t){e||=[0,0,0,0],this.callSuper(`initialize`,t),this.set(`x1`,e[0]),this.set(`y1`,e[1]),this.set(`x2`,e[2]),this.set(`y2`,e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||={},this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left=`left`in e?e.left:this._getLeftToOriginX(),this.top=`top`in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper(`_set`,e,t),i[e]!==void 0&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:`originX`,axis1:`x1`,axis2:`x2`,dimension:`width`},{nearest:`left`,center:`center`,farthest:`right`}),_getTopToOriginY:a({origin:`originY`,axis1:`y1`,axis2:`y2`,dimension:`height`},{nearest:`top`,center:`center`,farthest:`bottom`}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper(`toObject`,e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper(`_getNonTransformedDimensions`);return this.strokeLineCap===`butt`&&(this.width===0&&(e.y-=this.strokeWidth),this.height===0&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,r=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:r,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return[`<line `,`COMMON_PARTS`,`x1="`,e.x1,`" y1="`,e.y1,`" x2="`,e.x2,`" y2="`,e.y2,`" />
`]}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x1 y1 x2 y2`.split(` `)),t.Line.fromElement=function(e,r,i){i||={};var a=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),o=[a.x1||0,a.y1||0,a.x2||0,a.y2||0];r(new t.Line(o,n(a,i)))},t.Line.fromObject=function(e,n){function i(e){delete e.points,n&&n(e)}var a=r(e,!0);a.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject(`Line`,a,i,`points`)};function a(e,t){var n=e.origin,r=e.axis1,i=e.axis2,a=e.dimension,o=t.nearest,s=t.center,c=t.farthest;return function(){switch(this.get(n)){case o:return Math.min(this.get(r),this.get(i));case s:return Math.min(this.get(r),this.get(i))+.5*this.get(a);case c:return Math.max(this.get(r),this.get(i))}}}})(e),(function(e){var t=e.fabric||={},n=t.util.degreesToRadians;if(t.Circle){t.warn(`fabric.Circle is already defined.`);return}t.Circle=t.util.createClass(t.Object,{type:`circle`,radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat(`radius`,`startAngle`,`endAngle`),_set:function(e,t){return this.callSuper(`_set`,e,t),e===`radius`&&this.setRadius(t),this},toObject:function(e){return this.callSuper(`toObject`,[`radius`,`startAngle`,`endAngle`].concat(e))},_toSVG:function(){var e,r=0,i=0,a=(this.endAngle-this.startAngle)%360;if(a===0)e=[`<circle `,`COMMON_PARTS`,`cx="`+r+`" cy="`+i+`" `,`r="`,this.radius,`" />
`];else{var o=n(this.startAngle),s=n(this.endAngle),c=this.radius,l=t.util.cos(o)*c,u=t.util.sin(o)*c,d=t.util.cos(s)*c,f=t.util.sin(s)*c,p=a>180?`1`:`0`;e=[`<path d="M `+l+` `+u,` A `+c+` `+c,` 0 `,+p+` 1`,` `+d+` `+f,`" `,`COMMON_PARTS`,` />
`]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,n(this.startAngle),n(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get(`radius`)*this.get(`scaleX`)},getRadiusY:function(){return this.get(`radius`)*this.get(`scaleY`)},setRadius:function(e){return this.radius=e,this.set(`width`,e*2).set(`height`,e*2)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`cx cy r`.split(` `)),t.Circle.fromElement=function(e,n){var i=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!r(i))throw Error("value of `r` attribute is required and can not be negative");i.left=(i.left||0)-i.radius,i.top=(i.top||0)-i.radius,n(new t.Circle(i))};function r(e){return`radius`in e&&e.radius>=0}t.Circle.fromObject=function(e,n){t.Object._fromObject(`Circle`,e,n)}})(e),(function(e){var t=e.fabric||={};if(t.Triangle){t.warn(`fabric.Triangle is already defined`);return}t.Triangle=t.util.createClass(t.Object,{type:`triangle`,width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return[`<polygon `,`COMMON_PARTS`,`points="`,[-e+` `+t,`0 `+-t,e+` `+t].join(`,`),`" />`]}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject(`Triangle`,e,n)}})(e),(function(e){var t=e.fabric||={},n=Math.PI*2;if(t.Ellipse){t.warn(`fabric.Ellipse is already defined.`);return}t.Ellipse=t.util.createClass(t.Object,{type:`ellipse`,rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`rx`,`ry`),initialize:function(e){this.callSuper(`initialize`,e),this.set(`rx`,e&&e.rx||0),this.set(`ry`,e&&e.ry||0)},_set:function(e,t){switch(this.callSuper(`_set`,e,t),e){case`rx`:this.rx=t,this.set(`width`,t*2);break;case`ry`:this.ry=t,this.set(`height`,t*2);break}return this},getRx:function(){return this.get(`rx`)*this.get(`scaleX`)},getRy:function(){return this.get(`ry`)*this.get(`scaleY`)},toObject:function(e){return this.callSuper(`toObject`,[`rx`,`ry`].concat(e))},_toSVG:function(){return[`<ellipse `,`COMMON_PARTS`,`cx="0" cy="0" `,`rx="`,this.rx,`" ry="`,this.ry,`" />
`]},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`cx cy rx ry`.split(` `)),t.Ellipse.fromElement=function(e,n){var r=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,n(new t.Ellipse(r))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject(`Ellipse`,e,n)}})(e),(function(e){var t=e.fabric||={},n=t.util.object.extend;if(t.Rect){t.warn(`fabric.Rect is already defined`);return}t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat(`rx`,`ry`),type:`rect`,rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`rx`,`ry`),initialize:function(e){this.callSuper(`initialize`,e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,i=this.height,a=-this.width/2,o=-this.height/2,s=t!==0||n!==0,c=.4477152502;e.beginPath(),e.moveTo(a+t,o),e.lineTo(a+r-t,o),s&&e.bezierCurveTo(a+r-c*t,o,a+r,o+c*n,a+r,o+n),e.lineTo(a+r,o+i-n),s&&e.bezierCurveTo(a+r,o+i-c*n,a+r-c*t,o+i,a+r-t,o+i),e.lineTo(a+t,o+i),s&&e.bezierCurveTo(a+c*t,o+i,a,o+i-c*n,a,o+i-n),e.lineTo(a,o+n),s&&e.bezierCurveTo(a,o+c*n,a+c*t,o,a+t,o),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper(`toObject`,[`rx`,`ry`].concat(e))},_toSVG:function(){return[`<rect `,`COMMON_PARTS`,`x="`,-this.width/2,`" y="`,-this.height/2,`" rx="`,this.rx,`" ry="`,this.ry,`" width="`,this.width,`" height="`,this.height,`" />
`]}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y rx ry width height`.split(` `)),t.Rect.fromElement=function(e,r,i){if(!e)return r(null);i||={};var a=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);a.left=a.left||0,a.top=a.top||0,a.height=a.height||0,a.width=a.width||0;var o=new t.Rect(n(i?t.util.object.clone(i):{},a));o.visible=o.visible&&o.width>0&&o.height>0,r(o)},t.Rect.fromObject=function(e,n){return t.Object._fromObject(`Rect`,e,n)}})(e),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,a=t.util.toFixed,o=t.util.projectStrokeOnPoints;if(t.Polyline){t.warn(`fabric.Polyline is already defined`);return}t.Polyline=t.util.createClass(t.Object,{type:`polyline`,points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat(`points`),initialize:function(e,t){t||={},this.points=e||[],this.callSuper(`initialize`,t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return o(this.points,this,!0)},_setPositionDimensions:function(e){var t=this._calcDimensions(e),n,r=this.exactBoundingBox?this.strokeWidth:0;this.width=t.width-r,this.height=t.height-r,e.fromSVG||(n=this.translateToGivenOrigin({x:t.left-this.strokeWidth/2+r/2,y:t.top-this.strokeWidth/2+r/2},`left`,`top`,this.originX,this.originY)),e.left===void 0&&(this.left=e.fromSVG?t.left:n.x),e.top===void 0&&(this.top=e.fromSVG?t.top:n.y),this.pathOffset={x:t.left+this.width/2+r/2,y:t.top+this.height/2+r/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=r(e,`x`)||0,n=r(e,`y`)||0,a=i(e,`x`)||0,o=i(e,`y`)||0;return{left:t,top:n,width:a-t,height:o-n}},toObject:function(e){return n(this.callSuper(`toObject`,e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,r=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,o=0,s=this.points.length;o<s;o++)e.push(a(this.points[o].x-n,i),`,`,a(this.points[o].y-r,i),` `);return[`<`+this.type+` `,`COMMON_PARTS`,`points="`,e.join(``),`" />
`]},commonRender:function(e){var t,n=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-r,this.points[0].y-i);for(var a=0;a<n;a++)t=this.points[a],e.lineTo(t.x-r,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get(`points`).length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(r,i,a){if(!r)return i(null);a||={};var o=t.parsePointsAttribute(r.getAttribute(`points`)),s=t.parseAttributes(r,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](o,n(s,a)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator(`Polyline`),t.Polyline.fromObject=function(e,n){return t.Object._fromObject(`Polyline`,e,n,`points`)}})(e),(function(e){var t=e.fabric||={},n=t.util.projectStrokeOnPoints;if(t.Polygon){t.warn(`fabric.Polygon is already defined`);return}t.Polygon=t.util.createClass(t.Polyline,{type:`polygon`,_projectStrokeOnPoints:function(){return n(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator(`Polygon`),t.Polygon.fromObject=function(e,n){t.Object._fromObject(`Polygon`,e,n,`points`)}})(e),(function(e){var t=e.fabric||={},n=t.util.array.min,r=t.util.array.max,i=t.util.object.extend,a=t.util.object.clone,o=t.util.toFixed;if(t.Path){t.warn(`fabric.Path is already defined`);return}t.Path=t.util.createClass(t.Object,{type:`path`,path:null,cacheProperties:t.Object.prototype.cacheProperties.concat(`path`,`fillRule`),stateProperties:t.Object.prototype.stateProperties.concat(`path`),initialize:function(e,t){t=a(t||{}),delete t.path,this.callSuper(`initialize`,t),this._setPath(e||[],t)},_setPath:function(e,n){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,n||{})},_renderPathCommands:function(e){var t,n=0,r=0,i=0,a=0,o=0,s=0,c=-this.pathOffset.x,l=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case`L`:i=t[1],a=t[2],e.lineTo(i+c,a+l);break;case`M`:i=t[1],a=t[2],n=i,r=a,e.moveTo(i+c,a+l);break;case`C`:i=t[5],a=t[6],o=t[3],s=t[4],e.bezierCurveTo(t[1]+c,t[2]+l,o+c,s+l,i+c,a+l);break;case`Q`:e.quadraticCurveTo(t[1]+c,t[2]+l,t[3]+c,t[4]+l),i=t[3],a=t[4],o=t[1],s=t[2];break;case`z`:case`Z`:i=n,a=r,e.closePath();break}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return`#<fabric.Path (`+this.complexity()+`): { "top": `+this.top+`, "left": `+this.left+` }>`},toObject:function(e){return i(this.callSuper(`toObject`,e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject([`sourcePath`].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return[`<path `,`COMMON_PARTS`,`d="`,t.util.joinPath(this.path),`" stroke-linecap="round" `,`/>
`]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return` translate(`+o(-this.pathOffset.x,e)+`, `+o(-this.pathOffset.y,e)+`)`},toClipPathSVG:function(e){var t=this._getOffsetTransform();return` `+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e=[],i=[],a,o=0,s=0,c=0,l=0,u,d=0,f=this.path.length;d<f;++d){switch(a=this.path[d],a[0]){case`L`:c=a[1],l=a[2],u=[];break;case`M`:c=a[1],l=a[2],o=c,s=l,u=[];break;case`C`:u=t.util.getBoundsOfCurve(c,l,a[1],a[2],a[3],a[4],a[5],a[6]),c=a[5],l=a[6];break;case`Q`:u=t.util.getBoundsOfCurve(c,l,a[1],a[2],a[1],a[2],a[3],a[4]),c=a[3],l=a[4];break;case`z`:case`Z`:c=o,l=s;break}u.forEach(function(t){e.push(t.x),i.push(t.y)}),e.push(c),i.push(l)}var p=n(e)||0,m=n(i)||0,h=r(e)||0,g=r(i)||0;return{left:p,top:m,width:h-p,height:g-m}}}),t.Path.fromObject=function(e,n){if(typeof e.sourcePath==`string`){var r=e.sourcePath;t.loadSVGFromURL(r,function(r){var i=r[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],n&&n(i)}):n&&n(i)})}else t.Object._fromObject(`Path`,e,n,`path`)},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat([`d`]),t.Path.fromElement=function(e,n,r){var a=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);a.fromSVG=!0,n(new t.Path(a.d,i(a,r)))}})(e),(function(e){var t=e.fabric||={},n=t.util.array.min,r=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:`group`,strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,n){t||={},this._objects=[],n&&this.callSuper(`initialize`,t),this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;if(n)this._updateObjectsACoords();else{var i=t&&t.centerPoint;t.originX!==void 0&&(this.originX=t.originX),t.originY!==void 0&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper(`initialize`,t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=!0,t=this._objects.length;t--;)this._objects[t].setCoords(e)},_updateObjectsCoords:function(e){for(var e=e||this.getCenterPoint(),t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var n=e.left,r=e.top;e.set({left:n-t.x,top:r-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return`#<fabric.Group: (`+this.complexity()+`)>`},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set(`canvas`,this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set(`canvas`,this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var r=this._objects.length;if(this.useSetOnGroup)for(;r--;)this._objects[r].setOnGroup(e,n);if(e===`canvas`)for(;r--;)this._objects[r]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,r=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(e);return t.includeDefaultValues=r,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=r,i},toDatalessObject:function(e){var n,r=this.sourcePath;if(r)n=r;else{var i=this.includeDefaultValues;n=this._objects.map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toDatalessObject(e);return t.includeDefaultValues=n,r})}var a=t.Object.prototype.toDatalessObject.call(this,e);return a.objects=n,a},render:function(e){this._transformDone=!0,this.callSuper(`render`,e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e){for(var n=0,r=this._objects.length;n<r;n++)if(this._objects[n].willDrawShadow())return this.ownCaching=!1,!1}return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,n=this._objects.length;e<n;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,n=this._objects.length;t<n;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper(`isCacheDirty`,e))return!0;if(!this.statefullCache)return!1;for(var t=0,n=this._objects.length;t<n;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var r=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-r/2,-i/2,r,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(n){t.util.addTransformToObject(n,e),delete n.group,n.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set(`dirty`,!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper(`dispose`),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,n=this.canvas;this._objects=[];var r=this.toObject();delete r.objects;var i=new t.ActiveSelection([]);return i.set(r),i.type=`activeSelection`,n.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,n.add(e)}),i.canvas=n,i._objects=e,n._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){var e=!0;return this.forEachObject(function(t){t.setCoords(e)}),this},_calcBounds:function(e){for(var t=[],n=[],r,i,a,o=[`tr`,`br`,`bl`,`tl`],s=0,c=this._objects.length,l,u=o.length;s<c;++s){for(r=this._objects[s],a=r.calcACoords(),l=0;l<u;l++)i=o[l],t.push(a[i].x),n.push(a[i].y);r.aCoords=a}this._getBounds(t,n,e)},_getBounds:function(e,i,a){var o=new t.Point(n(e),n(i)),s=new t.Point(r(e),r(i)),c=o.y||0,l=o.x||0,u=s.x-o.x||0,d=s.y-o.y||0;this.width=u,this.height=d,a||this.setPositionByOrigin({x:l,y:c},`left`,`top`)},_toSVG:function(e){for(var t=[`<g `,`COMMON_PARTS`,` >
`],n=0,r=this._objects.length;n<r;n++)t.push(` `,this._objects[n].toSVG(e));return t.push(`</g>
`),t},getSvgStyles:function(){var e=this.opacity!==void 0&&this.opacity!==1?`opacity: `+this.opacity+`;`:``,t=this.visible?``:` visibility: hidden;`;return[e,this.getSvgFilter(),t].join(``)},toClipPathSVG:function(e){for(var t=[],n=0,r=this._objects.length;n<r;n++)t.push(` `,this._objects[n].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,n){var r=e.objects,i=t.util.object.clone(e,!0);if(delete i.objects,typeof r==`string`){t.loadSVGFromURL(r,function(a){var o=t.util.groupSVGElements(a,e,r),s=i.clipPath;delete i.clipPath,o.set(i),s?t.util.enlivenObjects([s],function(e){o.clipPath=e[0],n&&n(o)}):n&&n(o)});return}t.util.enlivenObjects(r,function(r){t.util.enlivenObjectEnlivables(e,i,function(){n&&n(new t.Group(r,i,!0))})})})})(e),(function(e){var t=e.fabric||={};t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:`activeSelection`,initialize:function(e,n){n||={},this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;n.originX&&(this.originX=n.originX),n.originY&&(this.originY=n.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,n),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var n=t.Object.prototype.toObject.call(this),r=new t.Group([]);if(delete n.type,r.set(n),e.forEach(function(e){e.canvas.remove(e),e.group=r}),r._objects=e,!this.canvas)return r;var i=this.canvas;return i.add(r),i._activeObject=r,r.setCoords(),r},onDeselect:function(){return this.destroy(),!1},toString:function(){return`#<fabric.ActiveSelection: (`+this.complexity()+`)>`},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,n||={},n.hasControls===void 0&&(n.hasControls=!1),n.forActiveSelection=!0;for(var r=0,i=this._objects.length;r<i;r++)this._objects[r]._renderControls(e,n);this.callSuper(`_renderControls`,e,t),e.restore()}}),t.ActiveSelection.fromObject=function(e,n){t.util.enlivenObjects(e.objects,function(r){delete e.objects,n&&n(new t.ActiveSelection(r,e,!0))})})})(e),(function(e){var n=t.util.object.extend;if(e.fabric||={},e.fabric.Image){t.warn(`fabric.Image is already defined.`);return}t.Image=t.util.createClass(t.Object,{type:`image`,strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat(`cropX`,`cropY`),cacheProperties:t.Object.prototype.cacheProperties.concat(`cropX`,`cropY`),cacheKey:``,cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,n){n||={},this.filters=[],this.cacheKey=`texture`+ t.Object.__uid++,this.callSuper(`initialize`,n),this._initElement(e,n)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+`_filtered`),this._element=e,this._originalElement=e,this._initConfig(t),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var n=t.filterBackend;n&&n.evictCachesForKey&&n.evictCachesForKey(e)},dispose:function(){this.callSuper(`dispose`),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+`_filtered`),this._cacheContext=void 0,[`_originalElement`,`_element`,`_filteredEl`,`_cacheCanvas`].forEach((function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}).bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(!(!this.stroke||this.strokeWidth===0)){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,-n),e.lineTo(t,-n),e.lineTo(t,n),e.lineTo(-t,n),e.lineTo(-t,-n),e.closePath()}},toObject:function(e){var t=[];this.filters.forEach(function(e){e&&t.push(e.toObject())});var r=n(this.callSuper(`toObject`,[`cropX`,`cropY`].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:t});return this.resizeFilter&&(r.resizeFilter=this.resizeFilter.toObject()),r},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e=[],n=[],r,i=this._element,a=-this.width/2,o=-this.height/2,s=``,c=``;if(!i)return[];if(this.hasCrop()){var l=t.Object.__uid++;e.push(`<clipPath id="imageCrop_`+l+`">
`,` <rect x="`+a+`" y="`+o+`" width="`+this.width+`" height="`+this.height+`" />
`,`</clipPath>
`),s=` clip-path="url(#imageCrop_`+l+`)" `}if(this.imageSmoothing||(c=`" image-rendering="optimizeSpeed`),n.push(` <image `,`COMMON_PARTS`,`xlink:href="`,this.getSvgSrc(!0),`" x="`,a-this.cropX,`" y="`,o-this.cropY,`" width="`,i.width||i.naturalWidth,`" height="`,i.height||i.height,c,`"`,s,`></image>
`),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,r=[` <rect `,`x="`,a,`" y="`,o,`" width="`,this.width,`" height="`,this.height,`" style="`,this.getSvgStyles(),`"/>
`],this.fill=u}return e=this.paintFirst===`fill`?e.concat(n,r):e.concat(r,n),e},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute(`src`):t.src:this.src||``},setSrc:function(e,n,r){return t.util.loadImage(e,function(e,t){this.setElement(e,r),this._setWidthHeight(),n&&n(this,t)},this,r&&r.crossOrigin),this},toString:function(){return`#<fabric.Image: { src: "`+this.getSrc()+`" }>`},applyResizeFilters:function(){var e=this.resizeFilter,n=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.scaleX,a=r.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set(`dirty`,!0),!e||i>n&&a>n){this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,this._lastScaleY=a;return}t.filterBackend||=t.initFilterBackend();var s=t.util.createCanvasElement(),c=this._filteredEl?this.cacheKey+`_filtered`:this.cacheKey,l=o.width,u=o.height;s.width=l,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=a,t.filterBackend.applyFilters([e],o,l,u,this._element,c),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=e||this.filters||[],e=e.filter(function(e){return e&&!e.isNeutralState()}),this.set(`dirty`,!0),this.removeTexture(this.cacheKey+`_filtered`),e.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var n=this._originalElement,r=n.naturalWidth||n.width,i=n.naturalHeight||n.height;if(this._element===this._originalElement){var a=t.util.createCanvasElement();a.width=r,a.height=i,this._element=a,this._filteredEl=a}else this._element=this._filteredEl,this._filteredEl.getContext(`2d`).clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||=t.initFilterBackend(),t.filterBackend.applyFilters(e,this._originalElement,r,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,r=this._filterScalingY,i=this.width,a=this.height,o=Math.min,s=Math.max,c=s(this.cropX,0),l=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,f=c*n,p=l*r,m=o(i*n,u-f),h=o(a*r,d-p),g=-i/2,_=-a/2,v=o(i,u/n-c),y=o(a,d/r-l);t&&e.drawImage(t,f,p,m,h,g,_,v,y)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,n){this.setElement(t.util.getById(e),n),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(e){e||={},this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,n){e&&e.length?t.util.enlivenObjects(e,function(e){n&&n(e)},`fabric.Image.filters`):n&&n()},_setWidthHeight:function(e){e||={};var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||``),n=this._element.width,r=this._element.height,i=1,a=1,o=0,s=0,c=0,l=0,u,d=this.width,f=this.height,p={width:d,height:f};return e&&(e.alignX!==`none`||e.alignY!==`none`)?(e.meetOrSlice===`meet`&&(i=a=t.util.findScaleToFit(this._element,p),u=(d-n*i)/2,e.alignX===`Min`&&(o=-u),e.alignX===`Max`&&(o=u),u=(f-r*a)/2,e.alignY===`Min`&&(s=-u),e.alignY===`Max`&&(s=u)),e.meetOrSlice===`slice`&&(i=a=t.util.findScaleToCover(this._element,p),u=n-d/i,e.alignX===`Mid`&&(c=u/2),e.alignX===`Max`&&(c=u),u=r-f/a,e.alignY===`Mid`&&(l=u/2),e.alignY===`Max`&&(l=u),n=d/i,r=f/a)):(i=d/n,a=f/r),{width:n,height:r,scaleX:i,scaleY:a,offsetLeft:o,offsetTop:s,cropX:c,cropY:l}}}),t.Image.CSS_CANVAS=`canvas-img`,t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(e,n){var r=t.util.object.clone(e);t.util.loadImage(r.src,function(e,i){if(i){n&&n(null,!0);return}t.Image.prototype._initFilters.call(r,r.filters,function(i){r.filters=i||[],t.Image.prototype._initFilters.call(r,[r.resizeFilter],function(i){r.resizeFilter=i[0],t.util.enlivenObjectEnlivables(r,r,function(){n(new t.Image(e,r),!1)})})})},null,r.crossOrigin)},t.Image.fromURL=function(e,n,r){t.util.loadImage(e,function(e,i){n&&n(new t.Image(e,r),i)},null,r&&r.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y width height preserveAspectRatio xlink:href crossOrigin image-rendering`.split(` `)),t.Image.fromElement=function(e,r,i){var a=t.parseAttributes(e,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(a[`xlink:href`],r,n(i?t.util.object.clone(i):{},a))}})(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?Math.round((e-1)/90)*90:Math.round(e/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){e||={};var n=function(){},r=e.onComplete||n,i=e.onChange||n,a=this;return t.util.animate({target:this,startValue:this.get(`angle`),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){a.rotate(e),i()},onComplete:function(){a.setCoords(),r()}})}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),(function(){function e(e,t){var n=`precision `+t+` float;
void main(){}`,r=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS)}t.isWebglSupported=function(n){if(t.isLikelyNode)return!1;n||=t.WebglFilterBackend.prototype.tileSize;var r=document.createElement(`canvas`),i=r.getContext(`webgl`)||r.getContext(`experimental-webgl`),a=!1;if(i){t.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),a=t.maxTextureSize>=n;for(var o=[`highp`,`mediump`,`lowp`],s=0;s<3;s++)if(e(i,o[s])){t.webGlPrecision=o[s];break}}return this.isSupported=a,a},t.WebglFilterBackend=n;function n(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}n.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,n){var r=window.performance!==void 0,o;try{new ImageData(1,1),o=!0}catch{o=!1}if(r&&o&&typeof ArrayBuffer<`u`&&typeof Uint8ClampedArray<`u`){var s=t.util.createCanvasElement(),c=new ArrayBuffer(e*n*4);if(t.forceGLPutImageData){this.imageBuffer=c,this.copyGLTo2D=a;return}var l={imageBuffer:c,destinationWidth:e,destinationHeight:n,targetCanvas:s},u,d,f;s.width=e,s.height=n,u=window.performance.now(),i.call(l,this.gl,l),d=window.performance.now()-u,u=window.performance.now(),a.call(l,this.gl,l),f=window.performance.now()-u,d>f?(this.imageBuffer=c,this.copyGLTo2D=a):this.copyGLTo2D=i}},createWebGLCanvas:function(e,n){var r=t.util.createCanvasElement();r.width=e,r.height=n;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},a=r.getContext(`webgl`,i);a||=r.getContext(`experimental-webgl`,i),a&&(a.clearColor(0,0,0,0),this.canvas=r,this.gl=a)},applyFilters:function(e,t,n,i,a,o){var s=this.gl,c;o&&(c=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:i,destinationWidth:n,destinationHeight:i,context:s,sourceTexture:this.createTexture(s,n,i,!c&&t),targetTexture:this.createTexture(s,n,i),originalTexture:c||this.createTexture(s,n,i,!c&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:a},u=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,u),e.forEach(function(e){e&&e.applyTo(l)}),r(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(u),a.getContext(`2d`).setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,r,i){var a=e.createTexture();return e.bindTexture(e.TEXTURE_2D,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),a},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:i,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:``,vendor:``};if(!e)return t;var n=e.getExtension(`WEBGL_debug_renderer_info`);if(n){var r=e.getParameter(n.UNMASKED_RENDERER_WEBGL),i=e.getParameter(n.UNMASKED_VENDOR_WEBGL);r&&(t.renderer=r.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}})();function r(e){var t=e.targetCanvas,n=t.width,r=t.height,i=e.destinationWidth,a=e.destinationHeight;(n!==i||r!==a)&&(t.width=i,t.height=a)}function i(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext(`2d`);i.translate(0,r.height),i.scale(1,-1);var a=n.height-r.height;i.drawImage(n,0,a,r.width,r.height,0,0,r.width,r.height)}function a(e,t){var n=t.targetCanvas.getContext(`2d`),r=t.destinationWidth,i=t.destinationHeight,a=r*i*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,o);var c=new ImageData(s,r,i);n.putImageData(c,0,0)}(function(){var e=function(){};t.Canvas2dFilterBackend=n;function n(){}n.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,r,i){var a=i.getContext(`2d`);a.drawImage(t,0,0,n,r);var o={sourceWidth:n,sourceHeight:r,imageData:a.getImageData(0,0,n,r),originalEl:t,originalImageData:a.getImageData(0,0,n,r),canvasEl:i,ctx:a,filterBackend:this};return e.forEach(function(e){e.applyTo(o)}),(o.imageData.width!==n||o.imageData.height!==r)&&(i.width=o.imageData.width,i.height=o.imageData.height),a.putImageData(o.imageData,0,0),o}}})(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:`BaseFilter`,vertexSource:`attribute vec2 aPosition;
varying vec2 vTexCoord;
void main() {
vTexCoord = aPosition;
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
}`,fragmentSource:`precision highp float;
varying vec2 vTexCoord;
uniform sampler2D uTexture;
void main() {
gl_FragColor = texture2D(uTexture, vTexCoord);
}`,initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,n,r){n||=this.fragmentSource,r||=this.vertexSource,t.webGlPrecision!==`highp`&&(n=n.replace(/precision highp float/g,`precision `+t.webGlPrecision+` float`));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw Error(`Vertex shader compile error for `+this.type+`: `+e.getShaderInfoLog(i));var a=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(a,n),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS))throw Error(`Fragment shader compile error for `+this.type+`: `+e.getShaderInfoLog(a));var o=e.createProgram();if(e.attachShader(o,i),e.attachShader(o,a),e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS))throw Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(o));var s=this.getAttributeLocations(e,o),c=this.getUniformLocations(e,o)||{};return c.uStepW=e.getUniformLocation(o,`uStepW`),c.uStepH=e.getUniformLocation(o,`uStepH`),{program:o,attributeLocations:s,uniformLocations:c}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,`aPosition`)}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var r=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t=e.context,n,r;e.passes>1?(n=e.destinationWidth,r=e.destinationHeight,(e.sourceWidth!==n||e.sourceHeight!==r)&&(t.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(t,n,r)),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e.targetTexture,0)):(t.bindFramebuffer(t.FRAMEBUFFER,null),t.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,n=t.Image.filters[this.type].prototype;if(e)if(Array.isArray(n[e])){for(var r=n[e].length;r--;)if(this[e][r]!==n[e][r])return!1;return!0}else return n[e]===this[e];else return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);e.pass===0&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement(`canvas`);t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(e,n){var r=new t.Image.filters[e.type](e);return n&&n(r),r},(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.ColorMatrix=r(n.BaseFilter,{type:`ColorMatrix`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
varying vec2 vTexCoord;
uniform mat4 uColorMatrix;
uniform vec4 uConstants;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color *= uColorMatrix;
color += uConstants;
gl_FragColor = color;
}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:`matrix`,colorsOnly:!0,initialize:function(e){this.callSuper(`initialize`,e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t=e.imageData.data,n=t.length,r=this.matrix,i,a,o,s,c,l=this.colorsOnly;for(c=0;c<n;c+=4)i=t[c],a=t[c+1],o=t[c+2],l?(t[c]=i*r[0]+a*r[1]+o*r[2]+r[4]*255,t[c+1]=i*r[5]+a*r[6]+o*r[7]+r[9]*255,t[c+2]=i*r[10]+a*r[11]+o*r[12]+r[14]*255):(s=t[c+3],t[c]=i*r[0]+a*r[1]+o*r[2]+s*r[3]+r[4]*255,t[c+1]=i*r[5]+a*r[6]+o*r[7]+s*r[8]+r[9]*255,t[c+2]=i*r[10]+a*r[11]+o*r[12]+s*r[13]+r[14]*255,t[c+3]=i*r[15]+a*r[16]+o*r[17]+s*r[18]+r[19]*255)},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,`uColorMatrix`),uConstants:e.getUniformLocation(t,`uConstants`)}},sendUniformData:function(e,t){var n=this.matrix,r=[n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]],i=[n[4],n[9],n[14],n[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,r),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Brightness=r(n.BaseFilter,{type:`Brightness`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uBrightness;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color.rgb += uBrightness;
gl_FragColor = color;
}`,brightness:0,mainParameter:`brightness`,applyTo2d:function(e){if(this.brightness!==0){var t=e.imageData.data,n,r=t.length,i=Math.round(this.brightness*255);for(n=0;n<r;n+=4)t[n]=t[n]+i,t[n+1]=t[n+1]+i,t[n+2]=t[n+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,`uBrightness`)}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Convolute=i(r.BaseFilter,{type:`Convolute`,opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[9];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 3.0; h+=1.0) {
for (float w = 0.0; w < 3.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_3_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[9];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 3.0; h+=1.0) {
for (float w = 0.0; w < 3.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_5_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[25];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 5.0; h+=1.0) {
for (float w = 0.0; w < 5.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_5_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[25];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 5.0; h+=1.0) {
for (float w = 0.0; w < 5.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_7_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[49];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 7.0; h+=1.0) {
for (float w = 0.0; w < 7.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_7_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[49];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 7.0; h+=1.0) {
for (float w = 0.0; w < 7.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_9_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[81];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 9.0; h+=1.0) {
for (float w = 0.0; w < 9.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_9_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[81];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 9.0; h+=1.0) {
for (float w = 0.0; w < 9.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),n=this.type+`_`+t+`_`+ +!!this.opaque,r=this.fragmentSource[n];return e.programCache.hasOwnProperty(n)||(e.programCache[n]=this.createProgram(e.context,r)),e.programCache[n]},applyTo2d:function(e){var t=e.imageData,n=t.data,r=this.matrix,i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=t.width,s=t.height,c=e.ctx.createImageData(o,s),l=c.data,u=+!!this.opaque,d,f,p,m,h,g,_,v,y,b,x,S,C;for(x=0;x<s;x++)for(b=0;b<o;b++){for(h=(x*o+b)*4,d=0,f=0,p=0,m=0,C=0;C<i;C++)for(S=0;S<i;S++)_=x+C-a,g=b+S-a,!(_<0||_>=s||g<0||g>=o)&&(v=(_*o+g)*4,y=r[C*i+S],d+=n[v]*y,f+=n[v+1]*y,p+=n[v+2]*y,u||(m+=n[v+3]*y));l[h]=d,l[h+1]=f,l[h+2]=p,u?l[h+3]=n[h+3]:l[h+3]=m}e.imageData=c},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,`uMatrix`),uOpaque:e.getUniformLocation(t,`uOpaque`),uHalfSize:e.getUniformLocation(t,`uHalfSize`),uSize:e.getUniformLocation(t,`uSize`)}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper(`toObject`),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Grayscale=r(n.BaseFilter,{type:`Grayscale`,fragmentSource:{average:`precision highp float;
uniform sampler2D uTexture;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float average = (color.r + color.b + color.g) / 3.0;
gl_FragColor = vec4(average, average, average, color.a);
}`,lightness:`precision highp float;
uniform sampler2D uTexture;
uniform int uMode;
varying vec2 vTexCoord;
void main() {
vec4 col = texture2D(uTexture, vTexCoord);
float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;
gl_FragColor = vec4(average, average, average, col.a);
}`,luminosity:`precision highp float;
uniform sampler2D uTexture;
uniform int uMode;
varying vec2 vTexCoord;
void main() {
vec4 col = texture2D(uTexture, vTexCoord);
float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;
gl_FragColor = vec4(average, average, average, col.a);
}`},mode:`average`,mainParameter:`mode`,applyTo2d:function(e){var t=e.imageData.data,n,r=t.length,i,a=this.mode;for(n=0;n<r;n+=4)a===`average`?i=(t[n]+t[n+1]+t[n+2])/3:a===`lightness`?i=(Math.min(t[n],t[n+1],t[n+2])+Math.max(t[n],t[n+1],t[n+2]))/2:a===`luminosity`&&(i=.21*t[n]+.72*t[n+1]+.07*t[n+2]),t[n]=i,t[n+1]=i,t[n+2]=i},retrieveShader:function(e){var t=this.type+`_`+this.mode;if(!e.programCache.hasOwnProperty(t)){var n=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,n)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,`uMode`)}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Invert=r(n.BaseFilter,{type:`Invert`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform int uInvert;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
if (uInvert == 1) {
gl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);
} else {
gl_FragColor = color;
}
}`,invert:!0,mainParameter:`invert`,applyTo2d:function(e){var t=e.imageData.data,n,r=t.length;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,`uInvert`)}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Noise=i(r.BaseFilter,{type:`Noise`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uStepH;
uniform float uNoise;
uniform float uSeed;
varying vec2 vTexCoord;
float rand(vec2 co, float seed, float vScale) {
return fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);
}
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;
gl_FragColor = color;
}`,mainParameter:`noise`,noise:0,applyTo2d:function(e){if(this.noise!==0){var t=e.imageData.data,n,r=t.length,i=this.noise,a;for(n=0,r=t.length;n<r;n+=4)a=(.5-Math.random())*i,t[n]+=a,t[n+1]+=a,t[n+2]+=a}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,`uNoise`),uSeed:e.getUniformLocation(t,`uSeed`)}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return n(this.callSuper(`toObject`),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Pixelate=r(n.BaseFilter,{type:`Pixelate`,blocksize:4,mainParameter:`blocksize`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uBlocksize;
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
float blockW = uBlocksize * uStepW;
float blockH = uBlocksize * uStepW;
int posX = int(vTexCoord.x / blockW);
int posY = int(vTexCoord.y / blockH);
float fposX = float(posX);
float fposY = float(posY);
vec2 squareCoords = vec2(fposX * blockW, fposY * blockH);
vec4 color = texture2D(uTexture, squareCoords);
gl_FragColor = color;
}`,applyTo2d:function(e){var t=e.imageData,n=t.data,r=t.height,i=t.width,a,o,s,c,l,u,d,f,p,m,h;for(o=0;o<r;o+=this.blocksize)for(s=0;s<i;s+=this.blocksize)for(a=o*4*i+s*4,c=n[a],l=n[a+1],u=n[a+2],d=n[a+3],m=Math.min(o+this.blocksize,r),h=Math.min(s+this.blocksize,i),f=o;f<m;f++)for(p=s;p<h;p++)a=f*4*i+p*4,n[a]=c,n[a+1]=l,n[a+2]=u,n[a+3]=d},isNeutralState:function(){return this.blocksize===1},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,`uBlocksize`),uStepW:e.getUniformLocation(t,`uStepW`),uStepH:e.getUniformLocation(t,`uStepH`)}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.RemoveColor=i(r.BaseFilter,{type:`RemoveColor`,color:`#FFFFFF`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec4 uLow;
uniform vec4 uHigh;
varying vec2 vTexCoord;
void main() {
gl_FragColor = texture2D(uTexture, vTexCoord);
if(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {
gl_FragColor.a = 0.0;
}
}`,distance:.02,useAlpha:!1,applyTo2d:function(e){var n=e.imageData.data,r,i=this.distance*255,a,o,s,c=new t.Color(this.color).getSource(),l=[c[0]-i,c[1]-i,c[2]-i],u=[c[0]+i,c[1]+i,c[2]+i];for(r=0;r<n.length;r+=4)a=n[r],o=n[r+1],s=n[r+2],a>l[0]&&o>l[1]&&s>l[2]&&a<u[0]&&o<u[1]&&s<u[2]&&(n[r+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,`uLow`),uHigh:e.getUniformLocation(t,`uHigh`)}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource(),i=parseFloat(this.distance),a=[0+r[0]/255-i,0+r[1]/255-i,0+r[2]/255-i,1],o=[r[0]/255+i,r[1]/255+i,r[2]/255+i,1];e.uniform4fv(n.uLow,a),e.uniform4fv(n.uHigh,o)},toObject:function(){return n(this.callSuper(`toObject`),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in i)n[a]=r(n.ColorMatrix,{type:a,matrix:i[a],mainParameter:!1,colorsOnly:!0}),t.Image.filters[a].fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendColor=r(n.BaseFilter,{type:`BlendColor`,color:`#F95C63`,mode:`multiply`,alpha:1,fragmentSource:{multiply:`gl_FragColor.rgb *= uColor.rgb;
`,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
`,add:`gl_FragColor.rgb += uColor.rgb;
`,diff:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
`,subtract:`gl_FragColor.rgb -= uColor.rgb;
`,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);
`,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);
`,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);
`,overlay:`if (uColor.r < 0.5) {
gl_FragColor.r *= 2.0 * uColor.r;
} else {
gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);
}
if (uColor.g < 0.5) {
gl_FragColor.g *= 2.0 * uColor.g;
} else {
gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);
}
if (uColor.b < 0.5) {
gl_FragColor.b *= 2.0 * uColor.b;
} else {
gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);
}
`,tint:`gl_FragColor.rgb *= (1.0 - uColor.a);
gl_FragColor.rgb += uColor.rgb;
`},buildSource:function(e){return`precision highp float;
uniform sampler2D uTexture;
uniform vec4 uColor;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
gl_FragColor = color;
if (color.a > 0.0) {
`+this.fragmentSource[e]+`}
}`},retrieveShader:function(e){var t=this.type+`_`+this.mode,n;return e.programCache.hasOwnProperty(t)||(n=this.buildSource(this.mode),e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyTo2d:function(e){var n=e.imageData.data,r=n.length,i,a,o,s,c,l,u,d=1-this.alpha;u=new t.Color(this.color).getSource(),i=u[0]*this.alpha,a=u[1]*this.alpha,o=u[2]*this.alpha;for(var f=0;f<r;f+=4)switch(s=n[f],c=n[f+1],l=n[f+2],this.mode){case`multiply`:n[f]=s*i/255,n[f+1]=c*a/255,n[f+2]=l*o/255;break;case`screen`:n[f]=255-(255-s)*(255-i)/255,n[f+1]=255-(255-c)*(255-a)/255,n[f+2]=255-(255-l)*(255-o)/255;break;case`add`:n[f]=s+i,n[f+1]=c+a,n[f+2]=l+o;break;case`diff`:case`difference`:n[f]=Math.abs(s-i),n[f+1]=Math.abs(c-a),n[f+2]=Math.abs(l-o);break;case`subtract`:n[f]=s-i,n[f+1]=c-a,n[f+2]=l-o;break;case`darken`:n[f]=Math.min(s,i),n[f+1]=Math.min(c,a),n[f+2]=Math.min(l,o);break;case`lighten`:n[f]=Math.max(s,i),n[f+1]=Math.max(c,a),n[f+2]=Math.max(l,o);break;case`overlay`:n[f]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255,n[f+1]=a<128?2*c*a/255:255-2*(255-c)*(255-a)/255,n[f+2]=o<128?2*l*o/255:255-2*(255-l)*(255-o)/255;break;case`exclusion`:n[f]=i+s-2*i*s/255,n[f+1]=a+c-2*a*c/255,n[f+2]=o+l-2*o*l/255;break;case`tint`:n[f]=i+s*d,n[f+1]=a+c*d,n[f+2]=o+l*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,`uColor`)}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource();r[0]=this.alpha*r[0]/255,r[1]=this.alpha*r[1]/255,r[2]=this.alpha*r[2]/255,r[3]=this.alpha,e.uniform4fv(n.uColor,r)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendImage=r(n.BaseFilter,{type:`BlendImage`,image:null,mode:`multiply`,alpha:1,vertexSource:`attribute vec2 aPosition;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
uniform mat3 uTransformMatrix;
void main() {
vTexCoord = aPosition;
vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
}`,fragmentSource:{multiply:`precision highp float;
uniform sampler2D uTexture;
uniform sampler2D uImage;
uniform vec4 uColor;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec4 color2 = texture2D(uImage, vTexCoord2);
color.rgba *= color2.rgba;
gl_FragColor = color;
}`,mask:`precision highp float;
uniform sampler2D uTexture;
uniform sampler2D uImage;
uniform vec4 uColor;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec4 color2 = texture2D(uImage, vTexCoord2);
color.a = color2.a;
gl_FragColor = color;
}`},retrieveShader:function(e){var t=this.type+`_`+this.mode,n=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,n=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,n,t.TEXTURE1),this.callSuper(`applyToWebGL`,e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,n=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/n,1]},applyTo2d:function(e){var n=e.imageData,r=e.filterBackend.resources,i=n.data,a=i.length,o=n.width,s=n.height,c,l,u,d,f,p,m,h,g,_,v=this.image,y;r.blendImage||=t.util.createCanvasElement(),g=r.blendImage,_=g.getContext(`2d`),g.width!==o||g.height!==s?(g.width=o,g.height=s):_.clearRect(0,0,o,s),_.setTransform(v.scaleX,0,0,v.scaleY,v.left,v.top),_.drawImage(v._element,0,0,o,s),y=_.getImageData(0,0,o,s).data;for(var b=0;b<a;b+=4)switch(f=i[b],p=i[b+1],m=i[b+2],h=i[b+3],c=y[b],l=y[b+1],u=y[b+2],d=y[b+3],this.mode){case`multiply`:i[b]=f*c/255,i[b+1]=p*l/255,i[b+2]=m*u/255,i[b+3]=h*d/255;break;case`mask`:i[b+3]=d;break}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,`uTransformMatrix`),uImage:e.getUniformLocation(t,`uImage`)}},sendUniformData:function(e,t){var n=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,n){t.Image.fromObject(e.image,function(r){var i=t.util.object.clone(e);i.image=r,n(new t.Image.filters.BlendImage(i))})}})(e),(function(e){var t=e.fabric||={},n=Math.pow,r=Math.floor,i=Math.sqrt,a=Math.abs,o=Math.round,s=Math.sin,c=Math.ceil,l=t.Image.filters,u=t.util.createClass;l.Resize=u(l.BaseFilter,{type:`Resize`,resizeType:`hermite`,scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,`uDelta`),uTaps:e.getUniformLocation(t,`uTaps`)}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),n=this.type+`_`+t;if(!e.programCache.hasOwnProperty(n)){var r=this.generateShader(t);e.programCache[n]=this.createProgram(e.context,r)}return e.programCache[n]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,n=this.getFilterWindow(),r=Array(n),i=1;i<=n;i++)r[i-1]=e(i*t);return r},generateShader:function(e){for(var t=Array(e),n=this.fragmentSourceTOP,e,r=1;r<=e;r++)t[r-1]=r+`.0 * uDelta`;return n+=`uniform float uTaps[`+e+`];
`,n+=`void main() {
`,n+=` vec4 color = texture2D(uTexture, vTexCoord);
`,n+=` float sum = 1.0;
`,t.forEach(function(e,t){n+=` color += texture2D(uTexture, vTexCoord + `+e+`) * uTaps[`+t+`];
`,n+=` color += texture2D(uTexture, vTexCoord - `+e+`) * uTaps[`+t+`];
`,n+=` sum += 2.0 * uTaps[`+t+`];
`}),n+=` gl_FragColor = color / sum;
`,n+=`}`,n},fragmentSourceTOP:`precision highp float;
uniform sampler2D uTexture;
uniform vec2 uDelta;
varying vec2 vTexCoord;
`,applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;t*=Math.PI;var n=t/e;return s(t)/t*s(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,r=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/r;var i=t.width,a=t.height,s=o(i*n),c=o(a*r),l;this.resizeType===`sliceHack`?l=this.sliceByTwo(e,i,a,s,c):this.resizeType===`hermite`?l=this.hermiteFastResize(e,i,a,s,c):this.resizeType===`bilinear`?l=this.bilinearFiltering(e,i,a,s,c):this.resizeType===`lanczos`&&(l=this.lanczosResize(e,i,a,s,c)),e.imageData=l},sliceByTwo:function(e,n,i,a,o){var s=e.imageData,c=.5,l=!1,u=!1,d=n*c,f=i*c,p=t.filterBackend.resources,m,h,g=0,_=0,v=n,y=0;for(p.sliceByTwo||=document.createElement(`canvas`),m=p.sliceByTwo,(m.width<n*1.5||m.height<i)&&(m.width=n*1.5,m.height=i),h=m.getContext(`2d`),h.clearRect(0,0,n*1.5,i),h.putImageData(s,0,0),a=r(a),o=r(o);!l||!u;)n=d,i=f,a<r(d*c)?d=r(d*c):(d=a,l=!0),o<r(f*c)?f=r(f*c):(f=o,u=!0),h.drawImage(m,g,_,n,i,v,y,d,f),g=v,_=y,y+=f;return h.getImageData(g,_,a,o)},lanczosResize:function(e,t,o,s,l){function u(e){var c,w,T,E,D,O,k,A,j,M,N;for(S.x=(e+.5)*h,C.x=r(S.x),c=0;c<l;c++){for(S.y=(c+.5)*g,C.y=r(S.y),D=0,O=0,k=0,A=0,j=0,w=C.x-y;w<=C.x+y;w++)if(!(w<0||w>=t)){M=r(1e3*a(w-S.x)),x[M]||(x[M]={});for(var ee=C.y-b;ee<=C.y+b;ee++)ee<0||ee>=o||(N=r(1e3*a(ee-S.y)),x[M][N]||(x[M][N]=m(i(n(M*_,2)+n(N*v,2))/1e3)),T=x[M][N],T>0&&(E=(ee*t+w)*4,D+=T,O+=T*d[E],k+=T*d[E+1],A+=T*d[E+2],j+=T*d[E+3]))}E=(c*s+e)*4,p[E]=O/D,p[E+1]=k/D,p[E+2]=A/D,p[E+3]=j/D}return++e<s?u(e):f}var d=e.imageData.data,f=e.ctx.createImageData(s,l),p=f.data,m=this.lanczosCreate(this.lanczosLobes),h=this.rcpScaleX,g=this.rcpScaleY,_=2/this.rcpScaleX,v=2/this.rcpScaleY,y=c(h*this.lanczosLobes/2),b=c(g*this.lanczosLobes/2),x={},S={},C={};return u(0)},bilinearFiltering:function(e,t,n,i,a){var o,s,c,l,u,d,f,p,m,h,g,_,v=0,y,b=this.rcpScaleX,x=this.rcpScaleY,S=4*(t-1),C=e.imageData.data,w=e.ctx.createImageData(i,a),T=w.data;for(f=0;f<a;f++)for(p=0;p<i;p++)for(u=r(b*p),d=r(x*f),m=b*p-u,h=x*f-d,y=4*(d*t+u),g=0;g<4;g++)o=C[y+g],s=C[y+4+g],c=C[y+S+g],l=C[y+S+4+g],_=o*(1-m)*(1-h)+s*m*(1-h)+c*h*(1-m)+l*m*h,T[v++]=_;return w},hermiteFastResize:function(e,t,n,o,s){for(var l=this.rcpScaleX,u=this.rcpScaleY,d=c(l/2),f=c(u/2),p=e.imageData.data,m=e.ctx.createImageData(o,s),h=m.data,g=0;g<s;g++)for(var _=0;_<o;_++){for(var v=(_+g*o)*4,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=(g+.5)*u,D=r(g*u);D<(g+1)*u;D++)for(var O=a(E-(D+.5))/f,k=(_+.5)*l,A=O*O,j=r(_*l);j<(_+1)*l;j++){var M=a(k-(j+.5))/d,N=i(A+M*M);N>1&&N<-1||(y=2*N*N*N-3*N*N+1,y>0&&(M=4*(j+D*t),T+=y*p[M+3],x+=y,p[M+3]<255&&(y=y*p[M+3]/250),S+=y*p[M],C+=y*p[M+1],w+=y*p[M+2],b+=y))}h[v]=S/b,h[v+1]=C/b,h[v+2]=w/b,h[v+3]=T/x}return m},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Contrast=r(n.BaseFilter,{type:`Contrast`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uContrast;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));
color.rgb = contrastF * (color.rgb - 0.5) + 0.5;
gl_FragColor = color;
}`,contrast:0,mainParameter:`contrast`,applyTo2d:function(e){if(this.contrast!==0){var t=e.imageData,n,r,i=t.data,r=i.length,a=Math.floor(this.contrast*255),o=259*(a+255)/(255*(259-a));for(n=0;n<r;n+=4)i[n]=o*(i[n]-128)+128,i[n+1]=o*(i[n+1]-128)+128,i[n+2]=o*(i[n+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,`uContrast`)}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Saturation=r(n.BaseFilter,{type:`Saturation`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uSaturation;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float rgMax = max(color.r, color.g);
float rgbMax = max(rgMax, color.b);
color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;
color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;
color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;
gl_FragColor = color;
}`,saturation:0,mainParameter:`saturation`,applyTo2d:function(e){if(this.saturation!==0){var t=e.imageData.data,n=t.length,r=-this.saturation,i,a;for(i=0;i<n;i+=4)a=Math.max(t[i],t[i+1],t[i+2]),t[i]+=a===t[i]?0:(a-t[i])*r,t[i+1]+=a===t[i+1]?0:(a-t[i+1])*r,t[i+2]+=a===t[i+2]?0:(a-t[i+2])*r}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,`uSaturation`)}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Vibrance=r(n.BaseFilter,{type:`Vibrance`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uVibrance;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float max = max(color.r, max(color.g, color.b));
float avg = (color.r + color.g + color.b) / 3.0;
float amt = (abs(max - avg) * 2.0) * uVibrance;
color.r += max != color.r ? (max - color.r) * amt : 0.00;
color.g += max != color.g ? (max - color.g) * amt : 0.00;
color.b += max != color.b ? (max - color.b) * amt : 0.00;
gl_FragColor = color;
}`,vibrance:0,mainParameter:`vibrance`,applyTo2d:function(e){if(this.vibrance!==0){var t=e.imageData.data,n=t.length,r=-this.vibrance,i,a,o,s;for(i=0;i<n;i+=4)a=Math.max(t[i],t[i+1],t[i+2]),o=(t[i]+t[i+1]+t[i+2])/3,s=Math.abs(a-o)*2/255*r,t[i]+=a===t[i]?0:(a-t[i])*s,t[i+1]+=a===t[i+1]?0:(a-t[i+1])*s,t[i+2]+=a===t[i+2]?0:(a-t[i+2])*s}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,`uVibrance`)}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Blur=r(n.BaseFilter,{type:`Blur`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec2 uDelta;
varying vec2 vTexCoord;
const float nSamples = 15.0;
vec3 v3offset = vec3(12.9898, 78.233, 151.7182);
float random(vec3 scale) {
return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);
}
void main() {
vec4 color = vec4(0.0);
float total = 0.0;
float offset = random(v3offset);
for (float t = -nSamples; t <= nSamples; t++) {
float percent = (t + offset - 0.5) / nSamples;
float weight = 1.0 - abs(percent);
color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;
total += weight;
}
gl_FragColor = color / total;
}`,blur:0,mainParameter:`blur`,applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var n=e.filterBackend.resources,r,i,a=e.imageData.width,o=e.imageData.height;n.blurLayer1||(n.blurLayer1=t.util.createCanvasElement(),n.blurLayer2=t.util.createCanvasElement()),r=n.blurLayer1,i=n.blurLayer2,(r.width!==a||r.height!==o)&&(i.width=r.width=a,i.height=r.height=o);var s=r.getContext(`2d`),c=i.getContext(`2d`),l=15,u,d,f,p,m=this.blur*.06*.5;for(s.putImageData(e.imageData,0,0),c.clearRect(0,0,a,o),p=-l;p<=l;p++)u=(Math.random()-.5)/4,d=p/l,f=m*d*a+u,c.globalAlpha=1-Math.abs(d),c.drawImage(r,f,u),s.drawImage(i,0,0),c.globalAlpha=1,c.clearRect(0,0,i.width,i.height);for(p=-l;p<=l;p++)u=(Math.random()-.5)/4,d=p/l,f=m*d*o+u,c.globalAlpha=1-Math.abs(d),c.drawImage(r,u,f),s.drawImage(i,0,0),c.globalAlpha=1,c.clearRect(0,0,i.width,i.height);e.ctx.drawImage(r,0,0);var h=e.ctx.getImageData(0,0,r.width,r.height);return s.globalAlpha=1,s.clearRect(0,0,r.width,r.height),h},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,`uDelta`)}},sendUniformData:function(e,t){var n=this.chooseRightDelta();e.uniform2fv(t.delta,n)},chooseRightDelta:function(){var e=1,t=[0,0],n;return this.horizontal?this.aspectRatio>1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),n=e*this.blur*.12,this.horizontal?t[0]=n:t[1]=n,t}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Gamma=r(n.BaseFilter,{type:`Gamma`,fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec3 uGamma;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec3 correction = (1.0 / uGamma);
color.r = pow(color.r, correction.r);
color.g = pow(color.g, correction.g);
color.b = pow(color.b, correction.b);
gl_FragColor = color;
gl_FragColor.rgb *= color.a;
}`,gamma:[1,1,1],mainParameter:`gamma`,initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t=e.imageData.data,n=this.gamma,r=t.length,i=1/n[0],a=1/n[1],o=1/n[2],s;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),s=0,r=256;s<r;s++)this.rVals[s]=(s/255)**i*255,this.gVals[s]=(s/255)**a*255,this.bVals[s]=(s/255)**o*255;for(s=0,r=t.length;s<r;s+=4)t[s]=this.rVals[t[s]],t[s+1]=this.gVals[t[s+1]],t[s+2]=this.bVals[t[s+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,`uGamma`)}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Composed=r(n.BaseFilter,{type:`Composed`,subFilters:[],initialize:function(e){this.callSuper(`initialize`,e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper(`toObject`),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,n){var r=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:r});return n&&n(i),i}})(e),(function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.HueRotation=r(n.ColorMatrix,{type:`HueRotation`,rotation:0,mainParameter:`rotation`,calculateMatrix:function(){var e=this.rotation*Math.PI,n=t.util.cos(e),r=t.util.sin(e),i=1/3,a=Math.sqrt(i)*r,o=1-n;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=n+o/3,this.matrix[1]=i*o-a,this.matrix[2]=i*o+a,this.matrix[5]=i*o+a,this.matrix[6]=n+i*o,this.matrix[7]=i*o-a,this.matrix[10]=i*o-a,this.matrix[11]=i*o+a,this.matrix[12]=n+i*o},isNeutralState:function(e){return this.calculateMatrix(),n.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),n.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject})(e),(function(e){var t=e.fabric||={},n=t.util.object.clone;if(t.Text){t.warn(`fabric.Text is already defined`);return}var r=`fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign`.split(` `);t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:[`fontSize`,`fontWeight`,`fontFamily`,`fontStyle`,`lineHeight`,`text`,`charSpacing`,`textAlign`,`styles`,`path`,`pathStartOffset`,`pathSide`,`pathAlign`],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:`text`,fontSize:40,fontWeight:`normal`,fontFamily:`Times New Roman`,underline:!1,overline:!1,linethrough:!1,textAlign:`left`,fontStyle:`normal`,lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:``,stateProperties:t.Object.prototype.stateProperties.concat(r),cacheProperties:t.Object.prototype.cacheProperties.concat(r),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:`left`,pathAlign:`baseline`,_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:`ltr`,_styleProperties:[`stroke`,`strokeWidth`,`fill`,`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`underline`,`overline`,`linethrough`,`deltaY`,`textBackgroundColor`],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper(`initialize`,t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:`_dimensionAffectingProps`})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext(`2d`),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){if(!this.__skipDimension){if(this._splitText(),this._clearCache(),this.path){var e=this.getHeightOfLine(0)*1.1;this.width=this.path.width+e,this.height=this.path.height+e}else this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight();this.textAlign.indexOf(`justify`)!==-1&&this.enlargeSpaces(),this.saveState({propertySet:`_dimensionAffectingProps`})}},enlargeSpaces:function(){for(var e,t,n,r,i,a,o,s=0,c=this._textLines.length;s<c;s++)if(!(this.textAlign!==`justify`&&(s===c-1||this.isEndOfWrapping(s)))&&(r=0,i=this._textLines[s],t=this.getLineWidth(s),t<this.width&&(o=this.textLines[s].match(this._reSpacesAndTabs)))){n=o.length,e=(this.width-t)/n;for(var l=0,u=i.length;l<=u;l++)a=this.__charBounds[s][l],this._reSpaceAndTab.test(i[l])?(a.width+=e,a.kernedWidth+=e,a.left+=r,r+=e):a.left+=r}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return`#<fabric.Text (`+this.complexity()+`): { "text": "`+this.text+`", "fontFamily": "`+this.fontFamily+`" }>`},_getCacheCanvasDimensions:function(){var e=this.callSuper(`_getCacheCanvasDimensions`),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,`underline`),this._renderText(e),this._renderTextDecoration(e,`overline`),this._renderTextDecoration(e,`linethrough`)},_renderText:function(e){this.paintFirst===`stroke`?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){if(e.textBaseline=`alphabetic`,this.path)switch(this.pathAlign){case`center`:e.textBaseline=`middle`;break;case`ascender`:e.textBaseline=`top`;break;case`descender`:e.textBaseline=`bottom`;break}e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;t<n;t++){var r=this.getLineWidth(t);r>e&&(e=r)}return e},_renderTextLine:function(e,t,n,r,i,a){this._renderChars(e,t,n,r,i,a)},_renderTextLinesBackground:function(e){if(!(!this.textBackgroundColor&&!this.styleHas(`textBackgroundColor`))){for(var t,n,r=e.fillStyle,i,a,o=this._getLeftOffset(),s=this._getTopOffset(),c=0,l=0,u,d,f=this.path,p,m=0,h=this._textLines.length;m<h;m++){if(t=this.getHeightOfLine(m),!this.textBackgroundColor&&!this.styleHas(`textBackgroundColor`,m)){s+=t;continue}i=this._textLines[m],n=this._getLineLeftOffset(m),l=0,c=0,a=this.getValueOfPropertyAt(m,0,`textBackgroundColor`);for(var g=0,_=i.length;g<_;g++)u=this.__charBounds[m][g],d=this.getValueOfPropertyAt(m,g,`textBackgroundColor`),f?(e.save(),e.translate(u.renderLeft,u.renderTop),e.rotate(u.angle),e.fillStyle=d,d&&e.fillRect(-u.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),u.width,t/this.lineHeight),e.restore()):d===a?l+=u.kernedWidth:(p=o+n+c,this.direction===`rtl`&&(p=this.width-p-l),e.fillStyle=a,a&&e.fillRect(p,s,l,t/this.lineHeight),c=u.left,l=u.width,a=d);d&&!f&&(p=o+n+c,this.direction===`rtl`&&(p=this.width-p-l),e.fillStyle=d,e.fillRect(p,s,l,t/this.lineHeight)),s+=t}e.fillStyle=r,this._removeShadow(e)}},getFontCache:function(e){var n=e.fontFamily.toLowerCase();t.charWidthsCache[n]||(t.charWidthsCache[n]={});var r=t.charWidthsCache[n],i=e.fontStyle.toLowerCase()+`_`+(e.fontWeight+``).toLowerCase();return r[i]||(r[i]={}),r[i]},_measureChar:function(e,t,n,r){var i=this.getFontCache(t),a=this._getFontDeclaration(t),o=this._getFontDeclaration(r),s=n+e,c=a===o,l,u,d,f=t.fontSize/this.CACHE_FONT_SIZE,p;if(n&&i[n]!==void 0&&(d=i[n]),i[e]!==void 0&&(p=l=i[e]),c&&i[s]!==void 0&&(u=i[s],p=u-d),l===void 0||d===void 0||u===void 0){var m=this.getMeasuringContext();this._setTextStyles(m,t,!0)}return l===void 0&&(p=l=m.measureText(e).width,i[e]=l),d===void 0&&c&&n&&(d=m.measureText(n).width,i[n]=d),c&&u===void 0&&(u=m.measureText(s).width,i[s]=u,p=u-d),{width:l*f,kernedWidth:p*f}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,`fontSize`)},measureLine:function(e){var t=this._measureLine(e);return this.charSpacing!==0&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var n=0,r,i,a=this._textLines[e],o,s,c=0,l=Array(a.length),u=0,d,f,p=this.path,m=this.pathSide===`right`;for(this.__charBounds[e]=l,r=0;r<a.length;r++)i=a[r],s=this._getGraphemeBox(i,e,r,o),l[r]=s,n+=s.kernedWidth,o=i;if(l[r]={left:s?s.left+s.width:0,width:0,kernedWidth:0,height:this.fontSize},p){switch(f=p.segmentsInfo[p.segmentsInfo.length-1].length,d=t.util.getPointOnPath(p.path,0,p.segmentsInfo),d.x+=p.pathOffset.x,d.y+=p.pathOffset.y,this.textAlign){case`left`:u=m?f-n:0;break;case`center`:u=(f-n)/2;break;case`right`:u=m?0:f-n;break}for(u+=this.pathStartOffset*(m?-1:1),r=m?a.length-1:0;m?r>=0:r<a.length;m?r--:r++)s=l[r],u>f?u%=f:u<0&&(u+=f),this._setGraphemeOnPath(u,s,d),u+=s.kernedWidth}return{width:n,numOfSpaces:c}},_setGraphemeOnPath:function(e,n,r){var i=e+n.kernedWidth/2,a=this.path,o=t.util.getPointOnPath(a.path,i,a.segmentsInfo);n.renderLeft=o.x-r.x,n.renderTop=o.y-r.y,n.angle=o.angle+(this.pathSide===`right`?Math.PI:0)},_getGraphemeBox:function(e,t,n,r,i){var a=this.getCompleteStyleDeclaration(t,n),o=r?this.getCompleteStyleDeclaration(t,n-1):{},s=this._measureChar(e,a,r,o),c=s.kernedWidth,l=s.width,u;this.charSpacing!==0&&(u=this._getWidthOfCharSpacing(),l+=u,c+=u);var d={width:l,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(n>0&&!i){var f=this.__charBounds[t][n-1];d.left=f.left+f.width+s.kernedWidth-s.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),r=1,i=t.length;r<i;r++)n=Math.max(this.getHeightOfChar(e,r),n);return this.__lineHeights[e]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,n=0,r=this._textLines.length;n<r;n++)e=this.getHeightOfLine(n),t+=n===r-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return this.direction===`ltr`?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var n=0,r=this._getLeftOffset(),i=this._getTopOffset(),a=0,o=this._textLines.length;a<o;a++){var s=this.getHeightOfLine(a),c=s/this.lineHeight,l=this._getLineLeftOffset(a);this._renderTextLine(t,e,this._textLines[a],r+l,i+n+c,a),n+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas(`fill`)||this._renderTextCommon(e,`fillText`)},_renderTextStroke:function(e){(!this.stroke||this.strokeWidth===0)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,`strokeText`),e.closePath(),e.restore())},_renderChars:function(e,n,r,i,a,o){var s=this.getHeightOfLine(o),c=this.textAlign.indexOf(`justify`)!==-1,l,u,d=``,f,p=0,m,h=this.path,g=!c&&this.charSpacing===0&&this.isEmptyStyles(o)&&!h,_=this.direction===`ltr`,v=this.direction===`ltr`?1:-1,y,b=n.canvas.getAttribute(`dir`);if(n.save(),b!==this.direction&&(n.canvas.setAttribute(`dir`,_?`ltr`:`rtl`),n.direction=_?`ltr`:`rtl`,n.textAlign=_?`left`:`right`),a-=s*this._fontSizeFraction/this.lineHeight,g){this._renderChar(e,n,o,0,r.join(``),i,a,s),n.restore();return}for(var x=0,S=r.length-1;x<=S;x++)m=x===S||this.charSpacing||h,d+=r[x],f=this.__charBounds[o][x],p===0?(i+=v*(f.kernedWidth-f.width),p+=f.width):p+=f.kernedWidth,c&&!m&&this._reSpaceAndTab.test(r[x])&&(m=!0),m||=(l||=this.getCompleteStyleDeclaration(o,x),u=this.getCompleteStyleDeclaration(o,x+1),t.util.hasStyleChanged(l,u,!1)),m&&(h?(n.save(),n.translate(f.renderLeft,f.renderTop),n.rotate(f.angle),this._renderChar(e,n,o,x,d,-p/2,0,s),n.restore()):(y=i,this._renderChar(e,n,o,x,d,y,a,s)),d=``,l=u,i+=v*p,p=0);n.restore()},_applyPatternGradientTransformText:function(e){var n=t.util.createCanvasElement(),r,i=this.width+this.strokeWidth,a=this.height+this.strokeWidth;return n.width=i,n.height=a,r=n.getContext(`2d`),r.beginPath(),r.moveTo(0,0),r.lineTo(i,0),r.lineTo(i,a),r.lineTo(0,a),r.closePath(),r.translate(i/2,a/2),r.fillStyle=e.toLive(r),this._applyPatternGradientTransform(r,e),r.fill(),r.createPattern(n,`no-repeat`)},handleFiller:function(e,t,n){var r,i;return n.toLive?n.gradientUnits===`percentage`||n.gradientTransform||n.patternTransform?(r=-this.width/2,i=-this.height/2,e.translate(r,i),e[t]=this._applyPatternGradientTransformText(n),{offsetX:r,offsetY:i}):(e[t]=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):(e[t]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,`strokeStyle`,t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,`fillStyle`,t.fill)},_renderChar:function(e,t,n,r,i,a,o){var s=this._getStyleDeclaration(n,r),c=this.getCompleteStyleDeclaration(n,r),l=e===`fillText`&&c.fill,u=e===`strokeText`&&c.stroke&&c.strokeWidth,d,f;!u&&!l||(t.save(),l&&(d=this._setFillStyles(t,c)),u&&(f=this._setStrokeStyles(t,c)),t.font=this._getFontDeclaration(c),s&&s.textBackgroundColor&&this._removeShadow(t),s&&s.deltaY&&(o+=s.deltaY),l&&t.fillText(i,a-d.offsetX,o-d.offsetY),u&&t.strokeText(i,a-f.offsetX,o-f.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,n){var r=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,`fontSize`),a=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,`deltaY`),o={fontSize:i*n.size,deltaY:a+i*n.baseline};return this.setSelectionStyles(o,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),n=this.width-t,r=this.textAlign,i=this.direction,a,o=0,a=this.isEndOfWrapping(e);return r===`justify`||r===`justify-center`&&!a||r===`justify-right`&&!a||r===`justify-left`&&!a?0:(r===`center`&&(o=n/2),r===`right`&&(o=n),r===`justify-center`&&(o=n/2),r===`justify-right`&&(o=n),i===`rtl`&&(o-=n),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||=this.hasStateChanged(`_dimensionAffectingProps`),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(this.__lineWidths[e]!==void 0)return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return this.charSpacing===0?0:this.fontSize*this.charSpacing/1e3},getValueOfPropertyAt:function(e,t,n){var r=this._getStyleDeclaration(e,t);return r&&r[n]!==void 0?r[n]:this[n]},_renderTextDecoration:function(e,t){if(!(!this[t]&&!this.styleHas(t))){e.save(),(t===`overline`||t===`linethrough`)&&this._removeShadow(e);for(var n,r,i,a,o,s,c,l,u=this._getLeftOffset(),d=this._getTopOffset(),f,p,m,h,g,_,v,y,b=this.path,x=this._getWidthOfCharSpacing(),S=this.offsets[t],C=0,w=this._textLines.length;C<w;C++){if(n=this.getHeightOfLine(C),!this[t]&&!this.styleHas(t,C)){d+=n;continue}c=this._textLines[C],_=n/this.lineHeight,a=this._getLineLeftOffset(C),p=0,m=0,l=this.getValueOfPropertyAt(C,0,t),y=this.getValueOfPropertyAt(C,0,`fill`),f=d+_*(1-this._fontSizeFraction),r=this.getHeightOfChar(C,0),o=this.getValueOfPropertyAt(C,0,`deltaY`);for(var T=0,E=c.length;T<E;T++)if(h=this.__charBounds[C][T],g=this.getValueOfPropertyAt(C,T,t),v=this.getValueOfPropertyAt(C,T,`fill`),i=this.getHeightOfChar(C,T),s=this.getValueOfPropertyAt(C,T,`deltaY`),b&&g&&v)e.save(),e.fillStyle=y,e.translate(h.renderLeft,h.renderTop),e.rotate(h.angle),e.fillRect(-h.kernedWidth/2,S*i+s,h.kernedWidth,this.fontSize/15),e.restore();else if((g!==l||v!==y||i!==r||s!==o)&&m>0){var D=u+a+p;this.direction===`rtl`&&(D=this.width-D-m),l&&y&&(e.fillStyle=y,e.fillRect(D,f+S*r+o,m,this.fontSize/15)),p=h.left,m=h.width,l=g,y=v,r=i,o=s}else m+=h.kernedWidth;var D=u+a+p;this.direction===`rtl`&&(D=this.width-D-m),e.fillStyle=v,g&&v&&e.fillRect(D,f+S*r+o,m-x,this.fontSize/15),d+=n}e.restore()}},_getFontDeclaration:function(e,n){var r=e||this,i=this.fontFamily,a=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,o=i===void 0||i.indexOf(`'`)>-1||i.indexOf(`,`)>-1||i.indexOf(`"`)>-1||a?r.fontFamily:`"`+r.fontFamily+`"`;return[t.isLikelyNode?r.fontWeight:r.fontStyle,t.isLikelyNode?r.fontStyle:r.fontWeight,n?this.CACHE_FONT_SIZE+`px`:r.fontSize+`px`,o].join(` `)},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper(`render`,e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),r=Array(n.length),i=[`
`],a=[],o=0;o<n.length;o++)r[o]=t.util.string.graphemeSplit(n[o]),a=a.concat(r[o],i);return a.pop(),{_unwrappedLines:r,lines:n,graphemeText:a,graphemeLines:r}},toObject:function(e){var n=r.concat(e),i=this.callSuper(`toObject`,n);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&=this.path.toObject(),i},set:function(e,t){this.callSuper(`set`,e,t);var n=!1,r=!1;if(typeof e==`object`)for(var i in e)i===`path`&&this.setPathInfo(),n||=this._dimensionAffectingProps.indexOf(i)!==-1,r||=i===`path`;else n=this._dimensionAffectingProps.indexOf(e)!==-1,r=e===`path`;return r&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor`.split(` `)),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,r,i){if(!e)return r(null);var a=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),o=a.textAnchor||`left`;if(i=t.util.object.extend(i?n(i):{},a),i.top=i.top||0,i.left=i.left||0,a.textDecoration){var s=a.textDecoration;s.indexOf(`underline`)!==-1&&(i.underline=!0),s.indexOf(`overline`)!==-1&&(i.overline=!0),s.indexOf(`line-through`)!==-1&&(i.linethrough=!0),delete i.textDecoration}`dx`in a&&(i.left+=a.dx),`dy`in a&&(i.top+=a.dy),`fontSize`in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var c=``;`textContent`in e?c=e.textContent:`firstChild`in e&&e.firstChild!==null&&`data`in e.firstChild&&e.firstChild.data!==null&&(c=e.firstChild.data),c=c.replace(/^\s+|\s+$|\n+/g,``).replace(/\s+/g,` `);var l=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(c,i),d=u.getScaledHeight()/u.height,f=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,p=u.getScaledHeight()+f,m=0;o===`center`&&(m=u.getScaledWidth()/2),o===`right`&&(m=u.getScaledWidth()),u.set({left:u.left-m,top:u.top-(p-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:l===void 0?1:l}),r(u)},t.Text.fromObject=function(e,r){var i=n(e),a=e.path;return delete i.path,t.Object._fromObject(`Text`,i,function(n){n.styles=t.util.stylesFromArray(e.styles,e.text),a?t.Object._fromObject(`Path`,a,function(e){n.set(`path`,e),r(n)},`path`):r(n)},`text`)},t.Text.genericFonts=[`sans-serif`,`serif`,`cursive`,`fantasy`,`monospace`],t.util.createAccessors&&t.util.createAccessors(t.Text)})(e),(function(){t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||e!==void 0&&!this.styles[e])return!0;var t=e===void 0?this.styles:{line:this.styles[e]};for(var n in t)for(var r in t[n])for(var i in t[n][r])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||e===``||t!==void 0&&!this.styles[t])return!1;var n=t===void 0?this.styles:{0:this.styles[t]};for(var r in n)for(var i in n[r])if(n[r][i][e]!==void 0)return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||e===``)return!1;var t=this.styles,n=0,r,i,a=!0,o=0,s;for(var c in t){for(var l in r=0,t[c]){var s=t[c][l],u=s.hasOwnProperty(e);n++,u?(i?s[e]!==i&&(a=!1):i=s[e],s[e]===this[e]&&delete s[e]):a=!1,Object.keys(s).length===0?delete t[c][l]:r++}r===0&&delete t[c]}for(var d=0;d<this._textLines.length;d++)o+=this._textLines[d].length;a&&n===o&&(this[e]=i,this.removeStyle(e))},removeStyle:function(e){if(!(!this.styles||!e||e===``)){var t=this.styles,n,r,i;for(r in t){for(i in n=t[r],n)delete n[i][e],Object.keys(n[i]).length===0&&delete n[i];Object.keys(n).length===0&&delete t[r]}}},_extendStyles:function(e,n){var r=this.get2DCursorLocation(e);this._getLineStyle(r.lineIndex)||this._setLineStyle(r.lineIndex),this._getStyleDeclaration(r.lineIndex,r.charIndex)||this._setStyleDeclaration(r.lineIndex,r.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(r.lineIndex,r.charIndex),n)},get2DCursorLocation:function(e,t){e===void 0&&(e=this.selectionStart);for(var n=t?this._unwrappedTextLines:this._textLines,r=n.length,i=0;i<r;i++){if(e<=n[i].length)return{lineIndex:i,charIndex:e};e-=n[i].length+this.missingNewlineOffset(i,t)}return{lineIndex:i-1,charIndex:n[i-1].length<e?n[i-1].length:e}},getSelectionStyles:function(e,t,n){e===void 0&&(e=this.selectionStart||0),t===void 0&&(t=this.selectionEnd||e);for(var r=[],i=e;i<t;i++)r.push(this.getStyleAtPosition(i,n));return r},getStyleAtPosition:function(e,t){var n=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(n.lineIndex,n.charIndex):this._getStyleDeclaration(n.lineIndex,n.charIndex))||{}},setSelectionStyles:function(e,t,n){t===void 0&&(t=this.selectionStart||0),n===void 0&&(n=this.selectionEnd||t);for(var r=t;r<n;r++)this._extendStyles(r,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var n=this.styles&&this.styles[e];return n?n[t]:null},getCompleteStyleDeclaration:function(e,t){for(var n=this._getStyleDeclaration(e,t)||{},r={},i,a=0;a<this._styleProperties.length;a++)i=this._styleProperties[a],r[i]=n[i]===void 0?this[i]:n[i];return r},_setStyleDeclaration:function(e,t,n){this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}})})(),(function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf(`underline`)>-1&&(e.underline=!0),e.textDecoration.indexOf(`line-through`)>-1&&(e.linethrough=!0),e.textDecoration.indexOf(`overline`)>-1&&(e.overline=!0),delete e.textDecoration)}t.IText=t.util.createClass(t.Text,t.Observable,{type:`i-text`,selectionStart:0,selectionEnd:0,selectionColor:`rgba(17,119,255,0.3)`,isEditing:!1,editable:!0,editingBorderColor:`rgba(102,153,255,0.25)`,cursorWidth:2,cursorColor:``,cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper(`initialize`,e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire(`selectionStart`,e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire(`selectionEnd`,e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire(`selection:changed`),this.canvas&&this.canvas.fire(`text:selection:changed`,{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper(`initDimensions`)},render:function(e){this.clearContextTop(),this.callSuper(`render`,e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper(`_render`,e)},clearContextTop:function(e){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){e===void 0&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),r=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&`top`in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,r,i=0,a=0,o,s=this.get2DCursorLocation(e);r=s.charIndex,n=s.lineIndex;for(var c=0;c<n;c++)i+=this.getHeightOfLine(c);t=this._getLineLeftOffset(n);var l=this.__charBounds[n][r];return l&&(a=l.left),this.charSpacing!==0&&r===this._textLines[n].length&&(a-=this._getWidthOfCharSpacing()),o={top:i,left:t+(a>0?a:0)},this.direction===`rtl`&&(o.left*=-1),this.cursorOffsetCache=o,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),r=n.lineIndex,i=n.charIndex>0?n.charIndex-1:0,a=this.getValueOfPropertyAt(r,i,`fontSize`),o=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/o,c=e.topOffset,l=this.getValueOfPropertyAt(r,i,`deltaY`);c+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-a*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,i,`fill`),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,c+e.top+l,s,a)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=this.textAlign.indexOf(`justify`)!==-1,a=this.get2DCursorLocation(n),o=this.get2DCursorLocation(r),s=a.lineIndex,c=o.lineIndex,l=a.charIndex<0?0:a.charIndex,u=o.charIndex<0?0:o.charIndex,d=s;d<=c;d++){var f=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),m=0,h=0,g=0;if(d===s&&(h=this.__charBounds[s][l].left),d>=s&&d<c)g=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===c)if(u===0)g=this.__charBounds[c][u].left;else{var _=this._getWidthOfCharSpacing();g=this.__charBounds[c][u-1].left+this.__charBounds[c][u-1].width-_}m=p,(this.lineHeight<1||d===c&&this.lineHeight>1)&&(p/=this.lineHeight);var v=e.left+f+h,y=g-h,b=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||`black`,b=1,x=p):t.fillStyle=this.selectionColor,this.direction===`rtl`&&(v=this.width-v-y),t.fillRect(v,e.top+e.topOffset+x,y,b),e.topOffset+=m}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,`fontSize`)},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,`fill`)},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),t.IText.fromObject=function(n,r){var i=t.util.stylesFromArray(n.styles,n.text),a=Object.assign({},n,{styles:i});if(delete a.path,e(a),a.styles)for(var o in a.styles)for(var s in a.styles[o])e(a.styles[o][s]);t.Object._fromObject(`IText`,a,function(e){n.path?t.Object._fromObject(`Path`,n.path,function(t){e.set(`path`,t),r(e)},`path`):r(e)},`text`)}})(),(function(){var e=t.util.object.clone;t.util.object.extend(t.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on(`added`,function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on(`removed`,function(){var n=e.canvas;n&&(n._iTextInstances=n._iTextInstances||[],t.util.removeFromArray(n._iTextInstances,e),n._iTextInstances.length===0&&(n._hasITextHandlers=!1,e._removeCanvasHandlers(n)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on(`mouse:up`,e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off(`mouse:up`,e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,`_onTickComplete`)},_animateCursor:function(e,t,n,r){var i={isAborted:!1,abort:function(){this.isAborted=!0}};return e.animate(`_currentCursorOpacity`,t,{duration:n,onComplete:function(){i.isAborted||e[r]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,`_tick`)},100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join(``)},findWordBoundaryLeft:function(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,n=e-1;!/\n/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},searchWordBoundary:function(e,n){for(var r=this._text,i=this._reSpace.test(r[e])?e-1:e,a=r[i],o=t.reNonWord;!o.test(a)&&i>0&&i<r.length;)i+=n,a=r[i];return o.test(a)&&(i+=n===1?0:1),i},selectWord:function(e){e||=this.selectionStart;var t=this.searchWordBoundary(e,-1),n=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e||=this.selectionStart;var t=this.findLineBoundaryLeft(e),n=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!(this.isEditing||!this.editable))return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire(`editing:entered`),this._fireSelectionChanged(),this.canvas?(this.canvas.fire(`text:editing:entered`,{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on(`mouse:move`,this.mouseMoveHandler)},mouseMoveHandler:function(e){if(!(!this.__isMousedown||!this.isEditing)){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),n=this.selectionStart,r=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||n===r)&&(n===t||r===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==n||this.selectionEnd!==r)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor=`text`,this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor=`text`),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,n,r){var i=r.slice(0,e),a=t.util.string.graphemeSplit(i).length;if(e===n)return{selectionStart:a,selectionEnd:a};var o=r.slice(e,n);return{selectionStart:a,selectionEnd:a+t.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(e,t,n){var r=n.slice(0,e).join(``).length;return e===t?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+n.slice(e,t).join(``).length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,n=this._getCursorBoundaries(e),r=this.get2DCursorLocation(e),i=r.lineIndex,a=r.charIndex,o=this.getValueOfPropertyAt(i,a,`fontSize`)*this.lineHeight,s=n.leftOffset,c=this.calcTransformMatrix(),l={x:n.left+s,y:n.top+n.topOffset+o},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,f=d.width/u,p=d.height/u,m=f-o,h=p-o,g=d.clientWidth/f,_=d.clientHeight/p;return l=t.util.transformPoint(l,c),l=t.util.transformPoint(l,this.canvas.viewportTransform),l.x*=g,l.y*=_,l.x<0&&(l.x=0),l.x>m&&(l.x=m),l.y<0&&(l.y=0),l.y>h&&(l.y=h),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+`px`,top:l.y+`px`,fontSize:o+`px`,charHeight:o}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire(`editing:exited`),e&&this.fire(`modified`),this.canvas&&(this.canvas.off(`mouse:move`,this.mouseMoveHandler),this.canvas.fire(`text:editing:exited`,{target:this}),e&&this.canvas.fire(`object:modified`,{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n=this.get2DCursorLocation(e,!0),r=this.get2DCursorLocation(t,!0),i=n.lineIndex,a=n.charIndex,o=r.lineIndex,s=r.charIndex,c,l;if(i!==o){if(this.styles[i])for(c=a;c<this._unwrappedTextLines[i].length;c++)delete this.styles[i][c];if(this.styles[o])for(c=s;c<this._unwrappedTextLines[o].length;c++)l=this.styles[o][c],l&&(this.styles[i]||(this.styles[i]={}),this.styles[i][a+c-s]=l);for(c=i+1;c<=o;c++)delete this.styles[c];this.shiftLineStyles(o,i-o)}else if(this.styles[i]){l=this.styles[i];var u=s-a,d,f;for(c=a;c<s;c++)delete l[c];for(f in this.styles[i])d=parseInt(f,10),d>=s&&(l[d-u]=l[f],delete l[f])}},shiftLineStyles:function(t,n){var r=e(this.styles);for(var i in this.styles){var a=parseInt(i,10);a>t&&(this.styles[a+n]=r[a],r[a-n]||delete this.styles[a])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,n,r,i){var a,o={},s=!1,c=this._unwrappedTextLines[t].length,l=c===n;for(var u in r||=1,this.shiftLineStyles(t,r),this.styles[t]&&(a=this.styles[t][n===0?n:n-1]),this.styles[t]){var d=parseInt(u,10);d>=n&&(s=!0,o[d-n]=this.styles[t][u],l&&n===0||delete this.styles[t][u])}var f=!1;for(s&&!l&&(this.styles[t+r]=o,f=!0),(f||c>n)&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:e(i[r-1])}:a?this.styles[t+r]={0:e(a)}:delete this.styles[t+r],r--;this._forceClearCache=!0},insertCharStyleObject:function(t,n,r,i){this.styles||={};var a=this.styles[t],o=a?e(a):{};for(var s in r||=1,o){var c=parseInt(s,10);c>=n&&(a[c+r]=o[c],o[c-r]||delete a[c])}if(this._forceClearCache=!0,i){for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][n+r]=e(i[r]));return}if(a)for(var l=a[n?n-1:1];l&&r--;)this.styles[t][n+r]=e(l)},insertNewStyleBlock:function(e,t,n){for(var r=this.get2DCursorLocation(t,!0),i=[0],a=0,o=0;o<e.length;o++)e[o]===`
`?(a++,i[a]=0):i[a]++;i[0]>0&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,i[0],n),n&&=n.slice(i[0]+1)),a&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+i[0],a);for(var o=1;o<a;o++)i[o]>0?this.insertCharStyleObject(r.lineIndex+o,0,i[o],n):n&&this.styles[r.lineIndex+o]&&n[0]&&(this.styles[r.lineIndex+o][0]=n[0]),n&&=n.slice(i[o]+1);i[o]>0&&this.insertCharStyleObject(r.lineIndex+o,0,i[o],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection=`left`:this._selectionDirection===`right`&&(this._selectionDirection=`left`,this.selectionEnd=e),this.selectionStart=n):n>e&&n<t?this._selectionDirection===`right`?this.selectionEnd=n:this.selectionStart=n:(t===e?this._selectionDirection=`right`:this._selectionDirection===`left`&&(this._selectionDirection=`right`,this.selectionStart=t),this.selectionEnd=n)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})})(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on(`mousedown`,this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire(`tripleclick`,e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on(`mousedblclick`,this.doubleClickHandler),this.on(`tripleclick`,this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&e.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&e.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on(`mousedown`,this._mouseDownHandler),this.on(`mousedown:before`,this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on(`mouseup`,this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&e.e.button!==1)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,r=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,r,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t=this.getLocalPointer(e),n=0,r=0,i=0,a=0,o=0,s,c,l=0,u=this._textLines.length;l<u&&i<=t.y;l++)i+=this.getHeightOfLine(l)*this.scaleY,o=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));s=this._getLineLeftOffset(o),r=s*this.scaleX,c=this._textLines[o],this.direction===`rtl`&&(t.x=this.width*this.scaleX-t.x+r);for(var d=0,f=c.length;d<f&&(n=r,r+=this.__charBounds[o][d].kernedWidth*this.scaleX,r<=t.x);d++)a++;return this._getNewSelectionStartFromOffset(t,n,r,a,f)},_getNewSelectionStartFromOffset:function(e,t,n,r,i){var a=e.x-t,o=n-e.x,s=r+(o>a||o<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.document.createElement(`textarea`),this.hiddenTextarea.setAttribute(`autocapitalize`,`off`),this.hiddenTextarea.setAttribute(`autocorrect`,`off`),this.hiddenTextarea.setAttribute(`autocomplete`,`off`),this.hiddenTextarea.setAttribute(`spellcheck`,`false`),this.hiddenTextarea.setAttribute(`data-fabric-hiddentextarea`,``),this.hiddenTextarea.setAttribute(`wrap`,`off`);var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText=`position: absolute; top: `+e.top+`; left: `+e.left+`; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: `+e.fontSize+`;`,this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,`keydown`,this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,`keyup`,this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,`input`,this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,`copy`,this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,`cut`,this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,`paste`,this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionstart`,this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionupdate`,this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionend`,this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.util.addListener(this.canvas.upperCanvasEl,`click`,this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:`exitEditing`,27:`exitEditing`,33:`moveCursorUp`,34:`moveCursorDown`,35:`moveCursorRight`,36:`moveCursorLeft`,37:`moveCursorLeft`,38:`moveCursorUp`,39:`moveCursorRight`,40:`moveCursorDown`},keysMapRtl:{9:`exitEditing`,27:`exitEditing`,33:`moveCursorUp`,34:`moveCursorDown`,35:`moveCursorLeft`,36:`moveCursorRight`,37:`moveCursorRight`,38:`moveCursorUp`,39:`moveCursorLeft`,40:`moveCursorDown`},ctrlKeysMapUp:{67:`copy`,88:`cut`},ctrlKeysMapDown:{65:`selectAll`},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t=this.direction===`rtl`?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else if(e.keyCode in this.ctrlKeysMapDown&&(e.ctrlKey||e.metaKey))this[this.ctrlKeysMapDown[e.keyCode]](e);else return;e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey))this[this.ctrlKeysMapUp[e.keyCode]](e);else return;e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(e){var n=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var r=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,i=this._text.length,a=r.length,o,s,c=a-i,l=this.selectionStart,u=this.selectionEnd,d=l!==u,f,p,m;if(this.hiddenTextarea.value===``){this.styles={},this.updateFromTextArea(),this.fire(`changed`),this.canvas&&(this.canvas.fire(`text:changed`,{target:this}),this.canvas.requestRenderAll());return}var h=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=l>h.selectionStart;d?(o=this._text.slice(l,u),c+=u-l):a<i&&(o=g?this._text.slice(u+c,u):this._text.slice(l,l-c)),s=r.slice(h.selectionEnd-c,h.selectionEnd),o&&o.length&&(s.length&&(f=this.getSelectionStyles(l,l+1,!1),f=s.map(function(){return f[0]})),d?(p=l,m=u):g?(p=u-o.length,m=u):(p=u,m=u+o.length),this.removeStyleFromTo(p,m)),s.length&&(n&&s.join(``)===t.copiedText&&!t.disableStyleCopyPaste&&(f=t.copiedTextStyle),this.insertNewStyleBlock(s,l,f)),this.updateFromTextArea(),this.fire(`changed`),this.canvas&&(this.canvas.fire(`text:changed`,{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(e,t){var n=this._getLineLeftOffset(e),r;return t>0&&(r=this.__charBounds[e][t-1],n+=r.left+r.width),n},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===this._textLines.length-1||e.metaKey||e.keyCode===34)return this._text.length-n;var a=r.charIndex,o=this._getWidthBeforeCursor(i,a),s=this._getIndexOnLine(i+1,o);return this._textLines[i].slice(a).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===0||e.metaKey||e.keyCode===33)return-n;var a=r.charIndex,o=this._getWidthBeforeCursor(i,a),s=this._getIndexOnLine(i-1,o),c=this._textLines[i].slice(0,a),l=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-c.length+(1-l)},_getIndexOnLine:function(e,t){for(var n=this._textLines[e],r=this._getLineLeftOffset(e),i=0,a,o,s=0,c=n.length;s<c;s++)if(a=this.__charBounds[e][s].width,r+=a,r>t){o=!0;var l=r-a,u=r,d=Math.abs(l-t);i=Math.abs(u-t)<d?s:s-1;break}return o||(i=n.length-1),i},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown(`Down`,e)},moveCursorUp:function(e){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown(`Up`,e)},_moveCursorUpOrDown:function(e,t){var n=`get`+e+`CursorOffset`,r=this[n](t,this._selectionDirection===`right`);t.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),r!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t=this._selectionDirection===`left`?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),e!==0},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),e!==0},moveCursorLeft:function(e){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight(`Left`,e)},_move:function(e,t,n){var r;if(e.altKey)r=this[`findWordBoundary`+n](this[t]);else if(e.metaKey||e.keyCode===35||e.keyCode===36)r=this[`findLineBoundary`+n](this[t]);else return this[t]+=n===`Left`?-1:1,!0;if(r!==void 0&&this[t]!==r)return this[t]=r,!0},_moveLeft:function(e,t){return this._move(e,t,`Left`)},_moveRight:function(e,t){return this._move(e,t,`Right`)},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection=`left`,this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(t=this._moveLeft(e,`selectionStart`)),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){if(this._selectionDirection===`right`&&this.selectionStart!==this.selectionEnd)return this._moveLeft(e,`selectionEnd`);if(this.selectionStart!==0)return this._selectionDirection=`left`,this._moveLeft(e,`selectionStart`)},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight(`Right`,e)},_moveCursorLeftOrRight:function(e,t){var n=`moveCursor`+e+`With`;this._currentCursorOpacity=1,t.shiftKey?n+=`Shift`:n+=`outShift`,this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){if(this._selectionDirection===`left`&&this.selectionStart!==this.selectionEnd)return this._moveRight(e,`selectionStart`);if(this.selectionEnd!==this._text.length)return this._selectionDirection=`right`,this._moveRight(e,`selectionEnd`)},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection=`right`,this.selectionStart===this.selectionEnd?(t=this._moveRight(e,`selectionStart`),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){t===void 0&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(``),this.set(`dirty`,!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,n,r,i){i===void 0&&(i=r),i>r&&this.removeStyleFromTo(r,i);var a=t.util.string.graphemeSplit(e);this.insertNewStyleBlock(a,r,n),this._text=[].concat(this._text.slice(0,r),a,this._text.slice(i)),this.text=this._text.join(``),this.set(`dirty`,!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),(function(){var e=t.util.toFixed,n=t.util.radiansToDegrees,r=t.util.calcRotateMatrix,i=t.util.transformPoint,a=/ +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){var t=this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0}),n=this.path;return n?t+n._createBaseSVGMarkup(n._toSVG(),{reviver:e,withShadow:!0}):t},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=!0,n=this.getSvgTextDecoration(this);return[e.textBgRects.join(``),` <text xml:space="preserve" `,this.fontFamily?`font-family="`+this.fontFamily.replace(/"/g,`'`)+`" `:``,this.fontSize?`font-size="`+this.fontSize+`" `:``,this.fontStyle?`font-style="`+this.fontStyle+`" `:``,this.fontWeight?`font-weight="`+this.fontWeight+`" `:``,n?`text-decoration="`+n+`" `:``,`style="`,this.getSvgStyles(t),`"`,this.addPaintOrder(),` >`,e.textSpans.join(``),`</text>
`]},_getSVGTextAndBg:function(e,t){var n=[],r=[],i=e,a;this._setSVGBg(r);for(var o=0,s=this._textLines.length;o<s;o++)a=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas(`textBackgroundColor`,o))&&this._setSVGTextLineBg(r,o,t+a,i),this._setSVGTextLineText(n,o,t+a,i),i+=this.getHeightOfLine(o);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(o,s,c,l,u){var d=o!==o.trim()||o.match(a),f=this.getSvgSpanStyles(s,d),p=f?`style="`+f+`"`:``,m=s.deltaY,h=``,g=t.Object.NUM_FRACTION_DIGITS,_=``;if(m&&(h=` dy="`+e(m,g)+`" `),u.renderLeft!==void 0){var v=u.angle;_=` rotate="`+e(n(v),t.Object.NUM_FRACTION_DIGITS)+`" `;var y=u.width/2,b=r({angle:n(v)});b[4]=u.renderLeft,b[5]=u.renderTop;var x=i({x:-y,y:0},b);c=x.x,l=x.y}return[`<tspan x="`,e(c,g),`" y="`,e(l,g),`" `,h,p,_,`>`,t.util.string.escapeXml(o),`</tspan>`].join(``)},_setSVGTextLineText:function(e,n,r,i){var a=this.getHeightOfLine(n),o=this.textAlign.indexOf(`justify`)!==-1,s,c,l=``,u,d,f=0,p=this._textLines[n],m;i+=a*(1-this._fontSizeFraction)/this.lineHeight;for(var h=0,g=p.length-1;h<=g;h++)m=h===g||this.charSpacing||this.path,l+=p[h],u=this.__charBounds[n][h],f===0?(r+=u.kernedWidth-u.width,f+=u.width):f+=u.kernedWidth,o&&!m&&this._reSpaceAndTab.test(p[h])&&(m=!0),m||=(s||=this.getCompleteStyleDeclaration(n,h),c=this.getCompleteStyleDeclaration(n,h+1),t.util.hasStyleChanged(s,c,!0)),m&&(d=this._getStyleDeclaration(n,h)||{},e.push(this._createTextCharSpan(l,d,r,i,u)),l=``,s=c,r+=f,f=0)},_pushTextBgRect:function(n,r,i,a,o,s){var c=t.Object.NUM_FRACTION_DIGITS;n.push(` <rect `,this._getFillAttributes(r),` x="`,e(i,c),`" y="`,e(a,c),`" width="`,e(o,c),`" height="`,e(s,c),`"></rect>
`)},_setSVGTextLineBg:function(e,t,n,r){for(var i=this._textLines[t],a=this.getHeightOfLine(t)/this.lineHeight,o=0,s=0,c,l,u=this.getValueOfPropertyAt(t,0,`textBackgroundColor`),d=0,f=i.length;d<f;d++)c=this.__charBounds[t][d],l=this.getValueOfPropertyAt(t,d,`textBackgroundColor`),l===u?o+=c.kernedWidth:(u&&this._pushTextBgRect(e,u,n+s,r,o,a),s=c.left,o=c.width,u=l);l&&this._pushTextBgRect(e,l,n+s,r,o,a)},_getFillAttributes:function(e){var n=e&&typeof e==`string`?new t.Color(e):``;return!n||!n.getSource()||n.getAlpha()===1?`fill="`+e+`"`:`opacity="`+n.getAlpha()+`" fill="`+n.setAlpha(1).toRgb()+`"`},_getSVGLineTopOffset:function(e){for(var t=0,n=0,r=0;r<e;r++)t+=this.getHeightOfLine(r);return n=this.getHeightOfLine(r),{lineTop:t,offset:(this._fontSizeMult-this._fontSizeFraction)*n/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return t.Object.prototype.getSvgStyles.call(this,e)+` white-space: pre;`}})})(),(function(e){var t=e.fabric||={};t.Textbox=t.util.createClass(t.IText,t.Observable,{type:`textbox`,minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat(`width`),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set(`width`,this.dynamicMinWidth),this.textAlign.indexOf(`justify`)!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:`_dimensionAffectingProps`}))},_generateStyleMap:function(e){for(var t=0,n=0,r=0,i={},a=0;a<e.graphemeLines.length;a++)e.graphemeText[r]===`
`&&a>0?(n=0,r++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[r])&&a>0&&(n++,r++),i[a]={line:t,offset:n},r+=e.graphemeLines[a].length,n+=e.graphemeLines[a].length;return i},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[n];r&&(n=r.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t=0,n=e+1,r,i,a=!1,o=this._styleMap[e],s=this._styleMap[e+1];for(var c in o&&(e=o.line,t=o.offset),s&&(n=s.line,a=n===e,r=s.offset),i=e===void 0?this.styles:{line:this.styles[e]},i)for(var l in i[c])if(l>=t&&(!a||l<r))for(var u in i[c][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[e];if(!n)return null;e=n.line,t=n.offset+t}return this.callSuper(`_getStyleDeclaration`,e,t)},_setStyleDeclaration:function(e,t,n){var r=this._styleMap[e];e=r.line,t=r.offset+t,this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){var n=this._styleMap[e];e=n.line,t=n.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var n=[],r;for(this.isWrapping=!0,r=0;r<e.length;r++)n=n.concat(this._wrapLine(e[r],r,t));return this.isWrapping=!1,n},_measureWord:function(e,t,n){var r=0,i,a=!0;n||=0;for(var o=0,s=e.length;o<s;o++){var c=this._getGraphemeBox(e[o],t,o+n,i,a);r+=c.kernedWidth,i=e[o]}return r},_wrapLine:function(e,n,r,i){var a=0,o=this.splitByGrapheme,s=[],c=[],l=o?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u=``,d=0,f=o?``:` `,p=0,m=0,h=0,g=!0,_=this._getWidthOfCharSpacing(),i=i||0;l.length===0&&l.push([]),r-=i;for(var v=0;v<l.length;v++)u=o?l[v]:t.util.string.graphemeSplit(l[v]),p=this._measureWord(u,n,d),d+=u.length,a+=m+p-_,a>r&&!g?(s.push(c),c=[],a=p,g=!0):a+=_,!g&&!o&&c.push(f),c=c.concat(u),m=o?0:this._measureWord([f],n,d),d++,g=!1,p>h&&(h=p);return v&&s.push(c),h+i>this.dynamicMinWidth&&(this.dynamicMinWidth=h-_+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e,t){return this.splitByGrapheme&&!t?+!!this.isEndOfWrapping(e):1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),r=this._wrapText(n.lines,this.width),i=Array(r.length),a=0;a<r.length;a++)i[a]=r[a].join(``);return n.lines=i,n.graphemeLines=r,n},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper(`toObject`,[`minWidth`,`splitByGrapheme`].concat(e))}}),t.Textbox.fromObject=function(e,n){var r=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:r});return delete i.path,t.Object._fromObject(`Textbox`,i,function(r){e.path?t.Object._fromObject(`Path`,e.path,function(e){r.set(`path`,e),n(r)},`path`):n(r)},`text`)}})(e),(function(){var e=t.controlsUtils,n=e.scaleSkewCursorStyleHandler,r=e.scaleCursorStyleHandler,i=e.scalingEqually,a=e.scalingYOrSkewingX,o=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,c=t.Object.prototype.controls;if(c.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:n,actionHandler:o,getActionName:s}),c.mr=new t.Control({x:.5,y:0,cursorStyleHandler:n,actionHandler:o,getActionName:s}),c.mb=new t.Control({x:0,y:.5,cursorStyleHandler:n,actionHandler:a,getActionName:s}),c.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:n,actionHandler:a,getActionName:s}),c.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),c.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),c.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:r,actionHandler:i}),c.br=new t.Control({x:.5,y:.5,cursorStyleHandler:r,actionHandler:i}),c.mtr=new t.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:`rotate`}),t.Textbox){var l=t.Textbox.prototype.controls={};l.mtr=c.mtr,l.tr=c.tr,l.br=c.br,l.tl=c.tl,l.bl=c.bl,l.mt=c.mt,l.mb=c.mb,l.mr=new t.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:`resizing`}),l.ml=new t.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:`resizing`})}})()}))(),ro=(0,v.forwardRef)(({activeTool:e,setActiveTool:t,onCanvasReady:n},r)=>{let i=(0,v.useRef)(null),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(1),c=(0,v.useRef)(!1),l=(0,v.useRef)(null),u=(0,v.useRef)(null);return(0,v.useImperativeHandle)(r,()=>({getCanvas:()=>a.current,toJSON:()=>a.current?.toJSON(),loadFromJSON:e=>{a.current&&a.current.loadFromJSON(e,a.current.renderAll.bind(a.current))},addSvgObject:e=>{a.current&&no.fabric.loadSVGFromString(e,(e,t)=>{let n=no.fabric.util.groupSVGElements(e,t);n.set({left:100,top:100,scaleX:.5,scaleY:.5}),a.current.add(n),a.current.setActiveObject(n),a.current.renderAll()})},addObjects:e=>{a.current&&(e.forEach(e=>{let t;e.type===`line`?t=new no.fabric.Line([e.x1,e.y1,e.x2,e.y2],{stroke:e.stroke||`#000`,strokeWidth:e.strokeWidth||1}):e.type===`circle`?t=new no.fabric.Circle({left:e.left,top:e.top,radius:e.radius,fill:e.fill||`transparent`,stroke:e.stroke||`#000`,strokeWidth:e.strokeWidth||1}):e.type===`polygon`?t=new no.fabric.Polygon(e.points.map(e=>({x:e.x,y:e.y})),{fill:e.fill||`transparent`,stroke:e.stroke||`#000`,strokeWidth:e.strokeWidth||1}):e.type===`rect`&&(t=new no.fabric.Rect({left:e.left,top:e.top,width:e.width,height:e.height,fill:e.fill||`transparent`,stroke:e.stroke||`#000`,strokeWidth:e.strokeWidth||1})),t&&a.current.add(t)}),a.current.renderAll())}})),(0,v.useEffect)(()=>{if(i.current&&!a.current){a.current=new no.fabric.Canvas(i.current,{width:i.current.parentElement.clientWidth,height:i.current.parentElement.clientHeight,backgroundColor:`#fff`,selection:!0}),n&&n(a.current);let e=()=>{i.current&&a.current&&(a.current.setWidth(i.current.parentElement.clientWidth),a.current.setHeight(i.current.parentElement.clientHeight),a.current.renderAll())};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e),a.current&&=(a.current.dispose(),null)}}},[]),(0,v.useEffect)(()=>{if(!a.current)return;let e=a.current,t=t=>{let n=t.e.deltaY,r=e.getZoom();r*=.999**n,r>20&&(r=20),r<.01&&(r=.01),e.zoomToPoint({x:t.e.offsetX,y:t.e.offsetY},r),t.e.preventDefault(),t.e.stopPropagation(),s(Math.round(r*100)/100)};return e.on(`mouse:wheel`,t),()=>e.off(`mouse:wheel`,t)},[]),(0,v.useEffect)(()=>{if(!a.current)return;let t=a.current;if(t.off(`mouse:down`),t.off(`mouse:move`),t.off(`mouse:up`),e===`select`){t.isDrawingMode=!1,t.selection=!0,t.forEachObject(e=>e.selectable=!0);return}if(t.selection=!1,t.forEachObject(e=>e.selectable=!1),e===`freehand`){t.isDrawingMode=!0,t.freeDrawingBrush.width=2,t.freeDrawingBrush.color=`#000`;return}t.isDrawingMode=!1,t.on(`mouse:down`,n=>{c.current=!0;let r=t.getPointer(n.e);if(l.current={x:r.x,y:r.y},e===`line`)u.current=new no.fabric.Line([r.x,r.y,r.x,r.y],{stroke:`#000`,strokeWidth:2});else if(e===`rect`)u.current=new no.fabric.Rect({left:r.x,top:r.y,width:0,height:0,fill:`transparent`,stroke:`#000`,strokeWidth:2});else if(e===`circle`)u.current=new no.fabric.Circle({left:r.x,top:r.y,radius:0,fill:`transparent`,stroke:`#000`,strokeWidth:2});else if(e===`text`){let e=new no.fabric.IText(`Text`,{left:r.x,top:r.y,fontSize:20,fill:`#000`});t.add(e),t.setActiveObject(e),c.current=!1;return}else if(e===`dimension`){let e=new no.fabric.Line([r.x,r.y,r.x,r.y],{stroke:`#e74c3c`,strokeWidth:1,strokeDashArray:[5,5]}),n=new no.fabric.Line([r.x,r.y,r.x+10,r.y],{stroke:`#e74c3c`,strokeWidth:1}),i=new no.fabric.Line([r.x+10,r.y,r.x+10,r.y+10],{stroke:`#e74c3c`,strokeWidth:1}),a=new no.fabric.Text(`0`,{left:r.x,top:r.y-20,fontSize:12,fill:`#e74c3c`}),o=new no.fabric.Group([e,n,i,a],{selectable:!1,hasControls:!1,hasBorders:!1});u.current={group:o,line:e,text:a,tick1:n,tick2:i,start:{x:r.x,y:r.y}},t.add(o)}u.current&&e!==`dimension`&&t.add(u.current)}),t.on(`mouse:move`,n=>{if(!c.current||!u.current)return;let r=t.getPointer(n.e);if(e===`line`)u.current.set({x2:r.x,y2:r.y});else if(e===`rect`){let e=l.current,t=Math.min(e.x,r.x),n=Math.min(e.y,r.y),i=Math.abs(e.x-r.x),a=Math.abs(e.y-r.y);u.current.set({left:t,top:n,width:i,height:a})}else if(e===`circle`){let e=l.current,t=Math.sqrt((r.x-e.x)**2+(r.y-e.y)**2)/2;u.current.set({left:e.x-t,top:e.y-t,radius:t})}else if(e===`dimension`){let{group:e,line:t,text:n,tick1:i,tick2:a,start:o}=u.current;t.set({x2:r.x,y2:r.y});let s=r.x-o.x,c=r.y-o.y,l=Math.sqrt(s*s+c*c).toFixed(1);n.set({text:l});let d=(o.x+r.x)/2,f=(o.y+r.y)/2;n.set({left:d-15,top:f-20}),i.set({x1:o.x,y1:o.y,x2:o.x+10,y2:o.y}),a.set({x1:r.x,y1:r.y,x2:r.x-10,y2:r.y}),e.addWithUpdate()}t.renderAll()}),t.on(`mouse:up`,()=>{c.current&&e===`dimension`&&u.current&&u.current.group.set({selectable:!0,hasControls:!1,hasBorders:!0}),c.current=!1,u.current=null})},[e]),(0,U.jsxs)(`div`,{style:{width:`100%`,height:`100%`},children:[(0,U.jsx)(`canvas`,{ref:i}),(0,U.jsxs)(`div`,{style:{position:`absolute`,bottom:10,right:10,background:`rgba(255,255,255,0.8)`,padding:`4px 8px`,borderRadius:4,fontSize:12},children:[`Zoom: `,Math.round(o*100),`%`]})]})}),io=[{id:`select`,label:``,title:`Auswahl`},{id:`line`,label:``,title:`Linie`},{id:`rect`,label:``,title:`Rechteck`},{id:`circle`,label:``,title:`Kreis`},{id:`freehand`,label:``,title:`Freihand`},{id:`text`,label:`T`,title:`Text`},{id:`dimension`,label:``,title:`Bemaßung`}],ao=({activeTool:e,setActiveTool:t})=>(0,U.jsx)(U.Fragment,{children:io.map(n=>(0,U.jsx)(`button`,{title:n.title,onClick:()=>t(n.id),style:{width:36,height:36,fontSize:16,background:e===n.id?`#1890ff`:`#34495e`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:n.label},n.id))}),oo=({layers:e,setLayers:t,activeLayer:n,setActiveLayer:r})=>{let[i,a]=(0,v.useState)(``),o=()=>{i.trim()&&(t([...e,{name:i,visible:!0,locked:!1}]),a(``))},s=i=>{e.length<=1||(t(e.filter(e=>e.name!==i)),n===i&&r(e[0].name))},c=n=>{t(e.map(e=>e.name===n?{...e,visible:!e.visible}:e))},l=n=>{t(e.map(e=>e.name===n?{...e,locked:!e.locked}:e))};return(0,U.jsxs)(`div`,{style:{padding:`0 10px 10px`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,gap:5,marginBottom:10},children:[(0,U.jsx)(`input`,{type:`text`,placeholder:`Neuer Layer...`,value:i,onChange:e=>a(e.target.value),style:{flex:1,padding:4,borderRadius:3,border:`1px solid #ccc`}}),(0,U.jsx)(`button`,{onClick:o,style:{padding:`4px 8px`,background:`#1890ff`,color:`white`,border:`none`,borderRadius:3,cursor:`pointer`},children:`+`})]}),e.map((t,i)=>(0,U.jsxs)(`div`,{onClick:()=>r(t.name),style:{padding:`6px 8px`,marginBottom:4,background:n===t.name?`#e6f7ff`:`#fff`,border:n===t.name?`1px solid #1890ff`:`1px solid #ddd`,borderRadius:4,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:13},children:[(0,U.jsx)(`span`,{style:{flex:1},children:t.name}),(0,U.jsxs)(`span`,{style:{display:`flex`,gap:4},children:[(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),c(t.name)},style:{width:24,height:24,fontSize:12,background:t.visible?`#52c41a`:`#d9d9d9`,color:`white`,border:`none`,borderRadius:3,cursor:`pointer`},title:t.visible?`Sichtbar`:`Ausgeblendet`,children:t.visible?`👁`:``}),(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),l(t.name)},style:{width:24,height:24,fontSize:12,background:t.locked?`#faad14`:`#d9d9d9`,color:`white`,border:`none`,borderRadius:3,cursor:`pointer`},title:t.locked?`Gesperrt`:`Entsperrt`,children:t.locked?`🔒`:`🔓`}),(0,U.jsx)(`button`,{onClick:e=>{e.stopPropagation(),s(t.name)},style:{width:24,height:24,fontSize:12,background:`#ff4d4f`,color:`white`,border:`none`,borderRadius:3,cursor:`pointer`,visibility:e.length>1?`visible`:`hidden`},title:`Löschen`,children:``})]})]},i))]})},so=({canvasRef:e})=>{let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(`Alle`),[s,c]=(0,v.useState)(!0);(0,v.useEffect)(()=>{qa.get(`/blocks`).then(e=>{let t=e.data||[];n(t),i([`Alle`,...new Set(t.map(e=>e.category||`Allgemein`))]),c(!1)}).catch(()=>c(!1))},[]);let l=a===`Alle`?t:t.filter(e=>(e.category||`Allgemein`)===a),u=(e,t)=>{e.dataTransfer.setData(`text/plain`,t.svg_data)};return s?(0,U.jsx)(`div`,{style:{padding:10},children:`Lade...`}):(0,U.jsxs)(`div`,{style:{padding:`0 10px 10px`},onDrop:t=>{t.preventDefault();let n=t.dataTransfer.getData(`text/plain`);n&&e.current&&e.current.addSvgObject(n)},onDragOver:e=>{e.preventDefault()},children:[(0,U.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4,marginBottom:8},children:r.map(e=>(0,U.jsx)(`button`,{onClick:()=>o(e),style:{padding:`2px 8px`,fontSize:11,background:a===e?`#1890ff`:`#f0f0f0`,color:a===e?`white`:`#333`,border:`none`,borderRadius:3,cursor:`pointer`},children:e},e))}),(0,U.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:6},children:l.map(e=>(0,U.jsxs)(`div`,{draggable:!0,onDragStart:t=>u(t,e),style:{border:`1px solid #ddd`,borderRadius:4,padding:4,background:`white`,cursor:`grab`,textAlign:`center`},title:e.name,children:[(0,U.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.svg_data},style:{width:`100%`,aspectRatio:`1`,marginBottom:4}}),(0,U.jsx)(`div`,{style:{fontSize:10,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.id))}),l.length===0&&(0,U.jsx)(`p`,{style:{fontSize:12,color:`#999`},children:`Keine Blöcke in dieser Kategorie.`})]})},co={plugins:[],cadApp:null,init(e){this.cadApp=e,this.loadPlugins()},async loadPlugins(){try{let e=await(await fetch(`/api/plugins`)).json();for(let t of e)await this.loadPlugin(t)}catch{console.log(`Plugin system: No plugins found or API unavailable`)}},async loadPlugin(e){try{let t=await C(()=>import(`/api/plugins/${e.id}/code`),[]);typeof t.default==`function`&&(t.default(this.cadApp),this.plugins.push({id:e.id,name:e.name,version:e.version}),console.log(`Plugin loaded: ${e.name}`))}catch(t){console.warn(`Failed to load plugin: ${e.name}`,t)}},getLoadedPlugins(){return this.plugins}},W=()=>{let{id:e}=lt(),t=st(),n=(0,v.useRef)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(`select`),[s,c]=(0,v.useState)([{name:`Layer 0`,visible:!0,locked:!1}]),[l,u]=(0,v.useState)(`Layer 0`),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(!0),[h,g]=(0,v.useState)(``),_=(0,v.useRef)(null);(0,v.useEffect)(()=>{e&&e!==`new`?qa.get(`/drawings/${e}`).then(e=>{if(i(e.data),e.data.canvas_json)try{let t=JSON.parse(e.data.canvas_json);n.current?.loadFromJSON?.(t)}catch{console.warn(`Canvas JSON parse error, starting fresh`)}}).catch(e=>{console.error(e),t(`/dashboard`)}):qa.post(`/drawings`,{name:`Neue Zeichnung`}).then(e=>{i(e.data),t(`/editor/${e.data.id}`,{replace:!0})}).catch(e=>{console.error(e),t(`/dashboard`)})},[e]);let y=e=>{co.init({getCanvas:()=>e,getApi:()=>qa,getDrawing:()=>r,registerTool:(e,t,n,r)=>{console.log(`Plugin registered tool: ${e}`)}})},b=async()=>{if(!(!r||!n.current))try{g(`Speichere...`);let e=n.current.toJSON();await qa.put(`/drawings/${r.id}`,{canvas_json:JSON.stringify(e),name:r.name}),g(`Gespeichert `),setTimeout(()=>g(``),2e3)}catch(e){g(`Fehler `),console.error(e)}},x=async e=>{let t=e.target.files?.[0];if(t)try{let r=new FormData;r.append(`file`,t);let i=await qa.post(`/dxf/import`,r);i.data?.objects&&n.current&&(n.current.addObjects(i.data.objects),g(`DXF importiert `),setTimeout(()=>g(``),2e3)),e.target.value=``}catch(t){console.error(`DXF import error:`,t),g(`DXF-Import Fehler `),setTimeout(()=>g(``),3e3),e.target.value=``}},S=async()=>{if(n.current)try{let e=n.current.toJSON(),t=await qa.post(`/dxf/export`,{objects:e.objects||[]},{responseType:`blob`}),i=new Blob([t.data],{type:`application/dxf`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=(r?.name||`zeichnung`)+`.dxf`,o.click(),URL.revokeObjectURL(a),g(`DXF exportiert `),setTimeout(()=>g(``),2e3)}catch(e){console.error(`DXF export error:`,e),g(`DXF-Export Fehler `),setTimeout(()=>g(``),3e3)}},C=()=>{if(!n.current)return;let e=n.current.getCanvas();if(e)try{let t=e.toSVG(),n=new Blob([t],{type:`image/svg+xml`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=(r?.name||`zeichnung`)+`.svg`,a.click(),URL.revokeObjectURL(i),g(`SVG exportiert `),setTimeout(()=>g(``),2e3)}catch(e){console.error(`SVG export error:`,e)}},w=()=>{if(!confirm(`Ausgewähltes Objekt löschen?`))return;let e=n.current?.getCanvas();if(e){let t=e.getActiveObject();t&&(e.remove(t),e.renderAll())}};return(0,v.useEffect)(()=>{let e=e=>{e.ctrlKey&&e.key===`s`?(e.preventDefault(),b()):e.key===`Delete`||e.key===`Backspace`?w():e.ctrlKey&&e.key};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,U.jsxs)(`div`,{style:{display:`flex`,height:`100vh`,overflow:`hidden`},children:[(0,U.jsxs)(`div`,{style:{width:50,background:`#2c3e50`,color:`white`,display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:10,gap:10,zIndex:20},children:[(0,U.jsx)(ao,{activeTool:a,setActiveTool:o,canvasRef:n}),(0,U.jsx)(`button`,{onClick:w,title:`Löschen`,style:{width:36,height:36,background:`#c0392b`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`,marginTop:`auto`,marginBottom:10},children:`🗑`})]}),(0,U.jsxs)(`div`,{style:{flex:1,position:`relative`,background:`#f0f0f0`},children:[(0,U.jsxs)(`div`,{style:{position:`absolute`,top:10,left:10,zIndex:10,display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,U.jsx)(`button`,{onClick:()=>t(`/dashboard`),style:{padding:`4px 12px`,background:`#1890ff`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:` Zurück`}),(0,U.jsx)(`button`,{onClick:b,style:{padding:`4px 12px`,background:`#52c41a`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`Speichern`}),(0,U.jsx)(`button`,{onClick:()=>_.current?.click(),style:{padding:`4px 12px`,background:`#faad14`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`DXF Import`}),(0,U.jsx)(`button`,{onClick:S,style:{padding:`4px 12px`,background:`#722ed1`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`DXF Export`}),(0,U.jsx)(`button`,{onClick:C,style:{padding:`4px 12px`,background:`#13c2c2`,color:`white`,border:`none`,borderRadius:4,cursor:`pointer`},children:`SVG Export`}),(0,U.jsx)(`span`,{style:{padding:`4px 12px`,background:`white`,borderRadius:4,fontSize:14},children:h})]}),(0,U.jsx)(`input`,{type:`file`,ref:_,onChange:x,accept:`.dxf`,style:{display:`none`}}),(0,U.jsx)(ro,{ref:n,activeTool:a,setActiveTool:o,onCanvasReady:y})]}),(0,U.jsxs)(`div`,{style:{width:250,background:`#fafafa`,borderLeft:`1px solid #ddd`,overflowY:`auto`},children:[(0,U.jsxs)(`div`,{style:{padding:10,borderBottom:`1px solid #ddd`,cursor:`pointer`,fontWeight:`bold`,userSelect:`none`},onClick:()=>f(!d),children:[`Layer `,d?``:``]}),d&&(0,U.jsx)(oo,{layers:s,setLayers:c,activeLayer:l,setActiveLayer:u}),(0,U.jsxs)(`div`,{style:{padding:10,borderBottom:`1px solid #ddd`,cursor:`pointer`,fontWeight:`bold`,userSelect:`none`},onClick:()=>m(!p),children:[`Teilebibliothek `,p?``:``]}),p&&(0,U.jsx)(so,{canvasRef:n})]})]})},G=({children:e})=>{let{user:t,loading:n}=Za();return n?(0,U.jsx)(`div`,{children:`Loading...`}):t?e:(0,U.jsx)(Nt,{to:`/login`})},lo=()=>(0,U.jsx)(wn,{children:(0,U.jsxs)(It,{children:[(0,U.jsx)(Pt,{path:`/login`,element:(0,U.jsx)(Qa,{})}),(0,U.jsx)(Pt,{path:`/register`,element:(0,U.jsx)($a,{})}),(0,U.jsx)(Pt,{path:`/dashboard`,element:(0,U.jsx)(G,{children:(0,U.jsx)(eo,{})})}),(0,U.jsx)(Pt,{path:`/editor/:id`,element:(0,U.jsx)(G,{children:(0,U.jsx)(W,{})})}),(0,U.jsx)(Pt,{path:`/editor/new`,element:(0,U.jsx)(G,{children:(0,U.jsx)(W,{})})}),(0,U.jsx)(Pt,{path:`*`,element:(0,U.jsx)(Nt,{to:`/dashboard`})})]})});y.createRoot(document.getElementById(`root`)).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(()=>(0,U.jsx)(Xa,{children:(0,U.jsx)(lo,{})}),{})}));