@yorab/react-paint 0.7.6 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/App.d.ts +20 -0
- package/dist/components/Canvas.d.ts +38 -0
- package/dist/components/common/Button.d.ts +16 -0
- package/dist/components/common/Loading.d.ts +7 -0
- package/dist/components/common/Modal.d.ts +10 -0
- package/dist/components/common/Panel.d.ts +13 -0
- package/dist/components/common/Snackbar.d.ts +8 -0
- package/dist/components/settings/ColorField.d.ts +15 -0
- package/dist/components/settings/DeleteButton.d.ts +9 -0
- package/dist/components/settings/FontFamilyField.d.ts +12 -0
- package/dist/components/settings/LayoutButton.d.ts +8 -0
- package/dist/components/settings/Layouts.d.ts +19 -0
- package/dist/components/settings/LineArrowField.d.ts +12 -0
- package/dist/components/settings/LineTypeField.d.ts +16 -0
- package/dist/components/settings/PointsNumberField.d.ts +13 -0
- package/dist/components/settings/RangeField.d.ts +18 -0
- package/dist/components/settings/SelectField.d.ts +18 -0
- package/dist/components/settings/SettingsBar.d.ts +19 -0
- package/dist/components/settings/ToggleField.d.ts +12 -0
- package/dist/components/toolbox/EditTextBox.d.ts +14 -0
- package/dist/components/toolbox/LoadFileTool.d.ts +12 -0
- package/dist/components/toolbox/MenuGroup.d.ts +35 -0
- package/dist/components/toolbox/PictureUrlInput.d.ts +8 -0
- package/dist/components/toolbox/Tool.d.ts +12 -0
- package/dist/components/toolbox/Toolbar.d.ts +27 -0
- package/dist/components/toolbox/ToolbarGroup.d.ts +18 -0
- package/dist/constants/app.d.ts +41 -0
- package/dist/constants/icons.d.ts +41 -0
- package/dist/constants/loading.d.ts +1 -0
- package/dist/constants/picture.d.ts +1 -0
- package/dist/constants/shapes.d.ts +8 -0
- package/dist/constants/snackbar.d.ts +7 -0
- package/dist/constants/style.d.ts +17 -0
- package/dist/constants/tools.d.ts +32 -0
- package/dist/hooks/useComponent.d.ts +9 -0
- package/dist/hooks/useDoubleClick.d.ts +5 -0
- package/dist/hooks/useDrag.d.ts +15 -0
- package/dist/hooks/useDrawableCanvas.d.ts +37 -0
- package/dist/hooks/useKeyboard.d.ts +18 -0
- package/dist/hooks/useResizeObserver.d.ts +7 -0
- package/dist/hooks/useShapes.d.ts +22 -0
- package/dist/hooks/useSnackbar.d.ts +10 -0
- package/dist/react-paint.css +1 -0
- package/dist/react-paint.js +9109 -0
- package/dist/react-paint.umd.cjs +53 -0
- package/dist/types/Mode.d.ts +43 -0
- package/dist/types/Shapes.d.ts +112 -0
- package/dist/types/snackbar.d.ts +7 -0
- package/dist/types/tools.d.ts +124 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/utils/canvas.d.ts +10 -0
- package/dist/utils/data.d.ts +225 -0
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/file.d.ts +10 -0
- package/dist/utils/intersect.d.ts +6 -0
- package/dist/utils/migration.d.ts +165 -0
- package/dist/utils/selection.d.ts +7 -0
- package/dist/utils/shapes/brush.d.ts +55 -0
- package/dist/utils/shapes/circle.d.ts +13 -0
- package/dist/utils/shapes/curve.d.ts +11 -0
- package/dist/utils/shapes/default.d.ts +10 -0
- package/dist/utils/shapes/ellipse.d.ts +13 -0
- package/dist/utils/shapes/grid.d.ts +3 -0
- package/dist/utils/shapes/index.d.ts +245 -0
- package/dist/utils/shapes/line.d.ts +23 -0
- package/dist/utils/shapes/picture.d.ts +6 -0
- package/dist/utils/shapes/polygon.d.ts +11 -0
- package/dist/utils/shapes/rectangle.d.ts +26 -0
- package/dist/utils/shapes/text.d.ts +48 -0
- package/dist/utils/shapes/triangle.d.ts +2 -0
- package/dist/utils/string.d.ts +3 -0
- package/dist/utils/style.d.ts +2 -0
- package/dist/utils/toolbar.d.ts +13 -0
- package/dist/utils/transform.d.ts +8 -0
- package/dist/utils/trigo.d.ts +10 -0
- package/package.json +51 -56
- package/dist/components/App.js +0 -496
- package/dist/components/Canvas.js +0 -194
- package/dist/components/common/Button.js +0 -88
- package/dist/components/common/Loading.js +0 -57
- package/dist/components/common/Modal.js +0 -46
- package/dist/components/common/Panel.js +0 -43
- package/dist/components/common/Snackbar.js +0 -68
- package/dist/components/settings/ColorField.js +0 -125
- package/dist/components/settings/DeleteButton.js +0 -37
- package/dist/components/settings/FontFamilyField.js +0 -67
- package/dist/components/settings/LayoutButton.js +0 -39
- package/dist/components/settings/Layouts.js +0 -214
- package/dist/components/settings/LineArrowField.js +0 -67
- package/dist/components/settings/LineTypeField.js +0 -65
- package/dist/components/settings/PointsNumberField.js +0 -45
- package/dist/components/settings/RangeField.js +0 -82
- package/dist/components/settings/SelectField.js +0 -81
- package/dist/components/settings/SettingsBar.js +0 -383
- package/dist/components/settings/ToggleField.js +0 -49
- package/dist/components/toolbox/EditTextBox.js +0 -138
- package/dist/components/toolbox/LoadFileTool.js +0 -58
- package/dist/components/toolbox/MenuGroup.js +0 -173
- package/dist/components/toolbox/PictureUrlInput.js +0 -68
- package/dist/components/toolbox/Tool.js +0 -41
- package/dist/components/toolbox/Toolbar.js +0 -203
- package/dist/components/toolbox/ToolbarGroup.js +0 -134
- package/dist/constants/app.js +0 -51
- package/dist/constants/icons.js +0 -88
- package/dist/constants/loading.js +0 -8
- package/dist/constants/picture.js +0 -8
- package/dist/constants/shapes.js +0 -20
- package/dist/constants/snackbar.js +0 -15
- package/dist/constants/style.js +0 -35
- package/dist/constants/tools.js +0 -424
- package/dist/hooks/useComponent.js +0 -47
- package/dist/hooks/useDoubleClick.js +0 -46
- package/dist/hooks/useDrag.js +0 -92
- package/dist/hooks/useDrawableCanvas.js +0 -230
- package/dist/hooks/useKeyboard.js +0 -142
- package/dist/hooks/useResizeObserver.js +0 -42
- package/dist/hooks/useShapes.js +0 -184
- package/dist/hooks/useSnackbar.js +0 -56
- package/dist/styles.css +0 -91
- package/dist/types/Mode.js +0 -5
- package/dist/types/Shapes.js +0 -5
- package/dist/types/snackbar.js +0 -5
- package/dist/types/tools.js +0 -5
- package/dist/types/utils.js +0 -5
- package/dist/utils/canvas.js +0 -49
- package/dist/utils/data.js +0 -49
- package/dist/utils/dom.js +0 -12
- package/dist/utils/file.js +0 -177
- package/dist/utils/intersect.js +0 -122
- package/dist/utils/migration.js +0 -59
- package/dist/utils/selection.js +0 -86
- package/dist/utils/shapes/brush.js +0 -135
- package/dist/utils/shapes/circle.js +0 -93
- package/dist/utils/shapes/curve.js +0 -55
- package/dist/utils/shapes/default.js +0 -73
- package/dist/utils/shapes/ellipse.js +0 -101
- package/dist/utils/shapes/grid.js +0 -36
- package/dist/utils/shapes/index.js +0 -341
- package/dist/utils/shapes/line.js +0 -179
- package/dist/utils/shapes/picture.js +0 -109
- package/dist/utils/shapes/polygon.js +0 -69
- package/dist/utils/shapes/rectangle.js +0 -100
- package/dist/utils/shapes/text.js +0 -128
- package/dist/utils/shapes/triangle.js +0 -24
- package/dist/utils/string.js +0 -36
- package/dist/utils/style.js +0 -46
- package/dist/utils/toolbar.js +0 -78
- package/dist/utils/transform.js +0 -109
- package/dist/utils/trigo.js +0 -42
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
(function(A,jt){typeof exports=="object"&&typeof module!="undefined"?module.exports=jt(require("react")):typeof define=="function"&&define.amd?define(["react"],jt):(A=typeof globalThis!="undefined"?globalThis:A||self,A["react-paint"]=jt(A.require$$0))})(this,function(A){"use strict";var ah=Object.defineProperty,uh=Object.defineProperties;var sh=Object.getOwnPropertyDescriptors;var ti=Object.getOwnPropertySymbols;var pc=Object.prototype.hasOwnProperty,hc=Object.prototype.propertyIsEnumerable;var dc=(A,jt,Yt)=>jt in A?ah(A,jt,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):A[jt]=Yt,it=(A,jt)=>{for(var Yt in jt||(jt={}))pc.call(jt,Yt)&&dc(A,Yt,jt[Yt]);if(ti)for(var Yt of ti(jt))hc.call(jt,Yt)&&dc(A,Yt,jt[Yt]);return A},_t=(A,jt)=>uh(A,sh(jt));var Wa=(A,jt)=>{var Yt={};for(var ye in A)pc.call(A,ye)&&jt.indexOf(ye)<0&&(Yt[ye]=A[ye]);if(A!=null&&ti)for(var ye of ti(A))jt.indexOf(ye)<0&&hc.call(A,ye)&&(Yt[ye]=A[ye]);return Yt};var gr=(A,jt,Yt)=>new Promise((ye,kr)=>{var eo=ar=>{try{vr(Yt.next(ar))}catch(kn){kr(kn)}},ei=ar=>{try{vr(Yt.throw(ar))}catch(kn){kr(kn)}},vr=ar=>ar.done?ye(ar.value):Promise.resolve(ar.value).then(eo,ei);vr((Yt=Yt.apply(A,jt)).next())});var jt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Yt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ye={exports:{}},kr={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var eo;function ei(){if(eo)return kr;eo=1;var n=A,o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function h(d,x,L){var Q,k={},V=null,N=null;L!==void 0&&(V=""+L),x.key!==void 0&&(V=""+x.key),x.ref!==void 0&&(N=x.ref);for(Q in x)s.call(x,Q)&&!p.hasOwnProperty(Q)&&(k[Q]=x[Q]);if(d&&d.defaultProps)for(Q in x=d.defaultProps,x)k[Q]===void 0&&(k[Q]=x[Q]);return{$$typeof:o,type:d,key:V,ref:N,props:k,_owner:l.current}}return kr.Fragment=a,kr.jsx=h,kr.jsxs=h,kr}var vr={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ar;function kn(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var n=A,o=Symbol.for("react.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),d=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),O=Symbol.iterator,Y="@@iterator";function M(y){if(y===null||typeof y!="object")return null;var E=O&&y[O]||y[Y];return typeof E=="function"?E:null}var T=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function z(y){{for(var E=arguments.length,D=new Array(E>1?E-1:0),rt=1;rt<E;rt++)D[rt-1]=arguments[rt];K("error",y,D)}}function K(y,E,D){{var rt=T.ReactDebugCurrentFrame,ft=rt.getStackAddendum();ft!==""&&(E+="%s",D=D.concat([ft]));var Qt=D.map(function(wt){return String(wt)});Qt.unshift("Warning: "+E),Function.prototype.apply.call(console[y],console,Qt)}}var ct=!1,at=!1,H=!1,J=!1,F=!1,et;et=Symbol.for("react.module.reference");function yt(y){return!!(typeof y=="string"||typeof y=="function"||y===s||y===p||F||y===l||y===L||y===Q||J||y===N||ct||at||H||typeof y=="object"&&y!==null&&(y.$$typeof===V||y.$$typeof===k||y.$$typeof===h||y.$$typeof===d||y.$$typeof===x||y.$$typeof===et||y.getModuleId!==void 0))}function It(y,E,D){var rt=y.displayName;if(rt)return rt;var ft=E.displayName||E.name||"";return ft!==""?D+"("+ft+")":D}function Ut(y){return y.displayName||"Context"}function ut(y){if(y==null)return null;if(typeof y.tag=="number"&&z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case s:return"Fragment";case a:return"Portal";case p:return"Profiler";case l:return"StrictMode";case L:return"Suspense";case Q:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case d:var E=y;return Ut(E)+".Consumer";case h:var D=y;return Ut(D._context)+".Provider";case x:return It(y,y.render,"ForwardRef");case k:var rt=y.displayName||null;return rt!==null?rt:ut(y.type)||"Memo";case V:{var ft=y,Qt=ft._payload,wt=ft._init;try{return ut(wt(Qt))}catch(gt){return null}}}return null}var pt=Object.assign,lt=0,Ct,Tt,Mt,Rt,Ot,Xt,$e;function Lt(){}Lt.__reactDisabledLog=!0;function He(){{if(lt===0){Ct=console.log,Tt=console.info,Mt=console.warn,Rt=console.error,Ot=console.group,Xt=console.groupCollapsed,$e=console.groupEnd;var y={configurable:!0,enumerable:!0,value:Lt,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}lt++}}function q(){{if(lt--,lt===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pt({},y,{value:Ct}),info:pt({},y,{value:Tt}),warn:pt({},y,{value:Mt}),error:pt({},y,{value:Rt}),group:pt({},y,{value:Ot}),groupCollapsed:pt({},y,{value:Xt}),groupEnd:pt({},y,{value:$e})})}lt<0&&z("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=T.ReactCurrentDispatcher,U;function P(y,E,D){{if(U===void 0)try{throw Error()}catch(ft){var rt=ft.stack.trim().match(/\n( *(at )?)/);U=rt&&rt[1]||""}return`
|
|
18
|
+
`+U+y}}var st=!1,Nt;{var $t=typeof WeakMap=="function"?WeakMap:Map;Nt=new $t}function te(y,E){if(!y||st)return"";{var D=Nt.get(y);if(D!==void 0)return D}var rt;st=!0;var ft=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Qt;Qt=B.current,B.current=null,He();try{if(E){var wt=function(){throw Error()};if(Object.defineProperty(wt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(wt,[])}catch(Pe){rt=Pe}Reflect.construct(y,[],wt)}else{try{wt.call()}catch(Pe){rt=Pe}y.call(wt.prototype)}}else{try{throw Error()}catch(Pe){rt=Pe}y()}}catch(Pe){if(Pe&&rt&&typeof Pe.stack=="string"){for(var gt=Pe.stack.split(`
|
|
19
|
+
`),ee=rt.stack.split(`
|
|
20
|
+
`),Bt=gt.length-1,Et=ee.length-1;Bt>=1&&Et>=0&>[Bt]!==ee[Et];)Et--;for(;Bt>=1&&Et>=0;Bt--,Et--)if(gt[Bt]!==ee[Et]){if(Bt!==1||Et!==1)do if(Bt--,Et--,Et<0||gt[Bt]!==ee[Et]){var se=`
|
|
21
|
+
`+gt[Bt].replace(" at new "," at ");return y.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",y.displayName)),typeof y=="function"&&Nt.set(y,se),se}while(Bt>=1&&Et>=0);break}}}finally{st=!1,B.current=Qt,q(),Error.prepareStackTrace=ft}var Or=y?y.displayName||y.name:"",ze=Or?P(Or):"";return typeof y=="function"&&Nt.set(y,ze),ze}function Kt(y,E,D){return te(y,!1)}function ue(y){var E=y.prototype;return!!(E&&E.isReactComponent)}function We(y,E,D){if(y==null)return"";if(typeof y=="function")return te(y,ue(y));if(typeof y=="string")return P(y);switch(y){case L:return P("Suspense");case Q:return P("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case x:return Kt(y.render);case k:return We(y.type,E,D);case V:{var rt=y,ft=rt._payload,Qt=rt._init;try{return We(Qt(ft),E,D)}catch(wt){}}}return""}var tr=Object.prototype.hasOwnProperty,Zr={},ln=T.ReactDebugCurrentFrame;function g(y){if(y){var E=y._owner,D=We(y.type,y._source,E?E.type:null);ln.setExtraStackFrame(D)}else ln.setExtraStackFrame(null)}function Tn(y,E,D,rt,ft){{var Qt=Function.call.bind(tr);for(var wt in y)if(Qt(y,wt)){var gt=void 0;try{if(typeof y[wt]!="function"){var ee=Error((rt||"React class")+": "+D+" type `"+wt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[wt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ee.name="Invariant Violation",ee}gt=y[wt](E,wt,rt,D,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Bt){gt=Bt}gt&&!(gt instanceof Error)&&(g(ft),z("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",rt||"React class",D,wt,typeof gt),g(null)),gt instanceof Error&&!(gt.message in Zr)&&(Zr[gt.message]=!0,g(ft),z("Failed %s type: %s",D,gt.message),g(null))}}}var Ur=Array.isArray;function zr(y){return Ur(y)}function Ht(y){{var E=typeof Symbol=="function"&&Symbol.toStringTag,D=E&&y[Symbol.toStringTag]||y.constructor.name||"Object";return D}}function Rr(y){try{return sr(y),!1}catch(E){return!0}}function sr(y){return""+y}function Pr(y){if(Rr(y))return z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ht(y)),sr(y)}var Be=T.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0},mr,Ve,we;we={};function cr(y){if(tr.call(y,"ref")){var E=Object.getOwnPropertyDescriptor(y,"ref").get;if(E&&E.isReactWarning)return!1}return y.ref!==void 0}function fe(y){if(tr.call(y,"key")){var E=Object.getOwnPropertyDescriptor(y,"key").get;if(E&&E.isReactWarning)return!1}return y.key!==void 0}function er(y,E){if(typeof y.ref=="string"&&Be.current&&E&&Be.current.stateNode!==E){var D=ut(Be.current.type);we[D]||(z('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ut(Be.current.type),y.ref),we[D]=!0)}}function fn(y,E){{var D=function(){mr||(mr=!0,z("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};D.isReactWarning=!0,Object.defineProperty(y,"key",{get:D,configurable:!0})}}function Ce(y,E){{var D=function(){Ve||(Ve=!0,z("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};D.isReactWarning=!0,Object.defineProperty(y,"ref",{get:D,configurable:!0})}}var lr=function(y,E,D,rt,ft,Qt,wt){var gt={$$typeof:o,type:y,key:E,ref:D,props:wt,_owner:Qt};return gt._store={},Object.defineProperty(gt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(gt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:rt}),Object.defineProperty(gt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ft}),Object.freeze&&(Object.freeze(gt.props),Object.freeze(gt)),gt};function Ee(y,E,D,rt,ft){{var Qt,wt={},gt=null,ee=null;D!==void 0&&(Pr(D),gt=""+D),fe(E)&&(Pr(E.key),gt=""+E.key),cr(E)&&(ee=E.ref,er(E,ft));for(Qt in E)tr.call(E,Qt)&&!ne.hasOwnProperty(Qt)&&(wt[Qt]=E[Qt]);if(y&&y.defaultProps){var Bt=y.defaultProps;for(Qt in Bt)wt[Qt]===void 0&&(wt[Qt]=Bt[Qt])}if(gt||ee){var Et=typeof y=="function"?y.displayName||y.name||"Unknown":y;gt&&fn(wt,Et),ee&&Ce(wt,Et)}return lr(y,gt,ee,ft,rt,Be.current,wt)}}var Fe=T.ReactCurrentOwner,Ae=T.ReactDebugCurrentFrame;function zt(y){if(y){var E=y._owner,D=We(y.type,y._source,E?E.type:null);Ae.setExtraStackFrame(D)}else Ae.setExtraStackFrame(null)}var _e;_e=!1;function Sr(y){return typeof y=="object"&&y!==null&&y.$$typeof===o}function dn(){{if(Fe.current){var y=ut(Fe.current.type);if(y)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+y+"`."}return""}}function On(y){{if(y!==void 0){var E=y.fileName.replace(/^.*[\\\/]/,""),D=y.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+E+":"+D+"."}return""}}var _r={};function Ze(y){{var E=dn();if(!E){var D=typeof y=="string"?y:y.displayName||y.name;D&&(E=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+D+">.")}return E}}function pn(y,E){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var D=Ze(E);if(_r[D])return;_r[D]=!0;var rt="";y&&y._owner&&y._owner!==Fe.current&&(rt=" It was passed a child from "+ut(y._owner.type)+"."),zt(y),z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D,rt),zt(null)}}function fr(y,E){{if(typeof y!="object")return;if(zr(y))for(var D=0;D<y.length;D++){var rt=y[D];Sr(rt)&&pn(rt,E)}else if(Sr(y))y._store&&(y._store.validated=!0);else if(y){var ft=M(y);if(typeof ft=="function"&&ft!==y.entries)for(var Qt=ft.call(y),wt;!(wt=Qt.next()).done;)Sr(wt.value)&&pn(wt.value,E)}}}function rr(y){{var E=y.type;if(E==null||typeof E=="string")return;var D;if(typeof E=="function")D=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===x||E.$$typeof===k))D=E.propTypes;else return;if(D){var rt=ut(E);Tn(D,y.props,"prop",rt,y)}else if(E.PropTypes!==void 0&&!_e){_e=!0;var ft=ut(E);z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ft||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ue(y){{for(var E=Object.keys(y.props),D=0;D<E.length;D++){var rt=E[D];if(rt!=="children"&&rt!=="key"){zt(y),z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",rt),zt(null);break}}y.ref!==null&&(zt(y),z("Invalid attribute `ref` supplied to `React.Fragment`."),zt(null))}}function hn(y,E,D,rt,ft,Qt){{var wt=yt(y);if(!wt){var gt="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(gt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ee=On(ft);ee?gt+=ee:gt+=dn();var Bt;y===null?Bt="null":zr(y)?Bt="array":y!==void 0&&y.$$typeof===o?(Bt="<"+(ut(y.type)||"Unknown")+" />",gt=" Did you accidentally export a JSX literal instead of a component?"):Bt=typeof y,z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Bt,gt)}var Et=Ee(y,E,D,ft,Qt);if(Et==null)return Et;if(wt){var se=E.children;if(se!==void 0)if(rt)if(zr(se)){for(var Or=0;Or<se.length;Or++)fr(se[Or],y);Object.freeze&&Object.freeze(se)}else z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fr(se,y)}return y===s?Ue(Et):rr(Et),Et}}function Tr(y,E,D){return hn(y,E,D,!0)}function Le(y,E,D){return hn(y,E,D,!1)}var Dn=Le,Wn=Tr;vr.Fragment=s,vr.jsx=Dn,vr.jsxs=Wn}()),vr}process.env.NODE_ENV==="production"?ye.exports=ei():ye.exports=kn();var _=ye.exports;const gc=0,Va=2,Ma="blue",Gt=14,ri=16,Na=[[0,0],[.5,0],[1,0],[1,.5],[1,1],[.5,1],[0,1],[0,.5]],Ha=["brush","rect","square","line","polygon","circle","curve","ellipse","picture","text"],me=["transparent","black","white","red","green","blue","yellow"],jr=[0,1,2],vc=[0,1,2,3],Ba=[[1,0],[1,2],[4,6]],yc=["arial","serif","monospace"],jn="serif",mc=36,In={APP:1,LOADING:2,PANEL:3,SNACKBAR:4},Fr=[10,20,40],ni=18,Fa=n=>{n.lineCap="round",n.lineJoin="round"},ur=(n,o={})=>{const{fillColor:a="transparent",globalAlpha:s=100,strokeColor:l=Ma,lineWidth:p=Va,lineDash:h=0}=o;s!==void 0&&(n.globalAlpha=s/100),a&&(n.fillStyle=a),l&&(n.strokeStyle=l),p&&(n.lineWidth=p),h!==void 0&&p&&n.setLineDash([Ba[h][0]*p,Ba[h][1]*p])},Za=(n,o,a,s,l)=>{n.save(),n.scale(o,o),n.translate(a[0],a[1]),s!==0&&(n.translate(l[0],l[1]),n.rotate(s),n.translate(-l[0],-l[1]))};var ro={exports:{}};/**
|
|
28
|
+
* @license
|
|
29
|
+
* Lodash <https://lodash.com/>
|
|
30
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
31
|
+
* Released under MIT license <https://lodash.com/license>
|
|
32
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
33
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
34
|
+
*/ro.exports,function(n,o){(function(){function a(b,j,u){switch(u.length){case 0:return b.call(j);case 1:return b.call(j,u[0]);case 2:return b.call(j,u[0],u[1]);case 3:return b.call(j,u[0],u[1],u[2])}return b.apply(j,u)}function s(b,j,u,S){for(var nt=-1,G=b==null?0:b.length;++nt<G;){var ke=b[nt];j(S,ke,u(ke),b)}return S}function l(b,j){for(var u=-1,S=b==null?0:b.length;++u<S&&j(b[u],u,b)!==!1;);return b}function p(b,j){for(var u=b==null?0:b.length;u--&&j(b[u],u,b)!==!1;);return b}function h(b,j){for(var u=-1,S=b==null?0:b.length;++u<S;)if(!j(b[u],u,b))return!1;return!0}function d(b,j){for(var u=-1,S=b==null?0:b.length,nt=0,G=[];++u<S;){var ke=b[u];j(ke,u,b)&&(G[nt++]=ke)}return G}function x(b,j){return!!(b!=null&&b.length)&&K(b,j,0)>-1}function L(b,j,u){for(var S=-1,nt=b==null?0:b.length;++S<nt;)if(u(j,b[S]))return!0;return!1}function Q(b,j){for(var u=-1,S=b==null?0:b.length,nt=Array(S);++u<S;)nt[u]=j(b[u],u,b);return nt}function k(b,j){for(var u=-1,S=j.length,nt=b.length;++u<S;)b[nt+u]=j[u];return b}function V(b,j,u,S){var nt=-1,G=b==null?0:b.length;for(S&&G&&(u=b[++nt]);++nt<G;)u=j(u,b[nt],nt,b);return u}function N(b,j,u,S){var nt=b==null?0:b.length;for(S&&nt&&(u=b[--nt]);nt--;)u=j(u,b[nt],nt,b);return u}function O(b,j){for(var u=-1,S=b==null?0:b.length;++u<S;)if(j(b[u],u,b))return!0;return!1}function Y(b){return b.split("")}function M(b){return b.match(c0)||[]}function T(b,j,u){var S;return u(b,function(nt,G,ke){if(j(nt,G,ke))return S=G,!1}),S}function z(b,j,u,S){for(var nt=b.length,G=u+(S?1:-1);S?G--:++G<nt;)if(j(b[G],G,b))return G;return-1}function K(b,j,u){return j===j?$t(b,j,u):z(b,at,u)}function ct(b,j,u,S){for(var nt=u-1,G=b.length;++nt<G;)if(S(b[nt],j))return nt;return-1}function at(b){return b!==b}function H(b,j){var u=b==null?0:b.length;return u?It(b,j)/u:Tr}function J(b){return function(j){return j==null?g:j[b]}}function F(b){return function(j){return b==null?g:b[j]}}function et(b,j,u,S,nt){return nt(b,function(G,ke,Hi){u=S?(S=!1,G):j(u,G,ke,Hi)}),u}function yt(b,j){var u=b.length;for(b.sort(j);u--;)b[u]=b[u].value;return b}function It(b,j){for(var u,S=-1,nt=b.length;++S<nt;){var G=j(b[S]);G!==g&&(u=u===g?G:u+G)}return u}function Ut(b,j){for(var u=-1,S=Array(b);++u<b;)S[u]=j(u);return S}function ut(b,j){return Q(j,function(u){return[u,b[u]]})}function pt(b){return b&&b.slice(0,We(b)+1).replace(Ri,"")}function lt(b){return function(j){return b(j)}}function Ct(b,j){return Q(j,function(u){return b[u]})}function Tt(b,j){return b.has(j)}function Mt(b,j){for(var u=-1,S=b.length;++u<S&&K(j,b[u],0)>-1;);return u}function Rt(b,j){for(var u=b.length;u--&&K(j,b[u],0)>-1;);return u}function Ot(b,j){for(var u=b.length,S=0;u--;)b[u]===j&&++S;return S}function Xt(b){return"\\"+S0[b]}function $e(b,j){return b==null?g:b[j]}function Lt(b){return H0.test(b)}function He(b){return B0.test(b)}function q(b){for(var j,u=[];!(j=b.next()).done;)u.push(j.value);return u}function B(b){var j=-1,u=Array(b.size);return b.forEach(function(S,nt){u[++j]=[nt,S]}),u}function U(b,j){return function(u){return b(j(u))}}function P(b,j){for(var u=-1,S=b.length,nt=0,G=[];++u<S;){var ke=b[u];ke!==j&&ke!==Be||(b[u]=Be,G[nt++]=u)}return G}function st(b){var j=-1,u=Array(b.size);return b.forEach(function(S){u[++j]=S}),u}function Nt(b){var j=-1,u=Array(b.size);return b.forEach(function(S){u[++j]=[S,S]}),u}function $t(b,j,u){for(var S=u-1,nt=b.length;++S<nt;)if(b[S]===j)return S;return-1}function te(b,j,u){for(var S=u+1;S--;)if(b[S]===j)return S;return S}function Kt(b){return Lt(b)?tr(b):K0(b)}function ue(b){return Lt(b)?Zr(b):Y(b)}function We(b){for(var j=b.length;j--&&i0.test(b.charAt(j)););return j}function tr(b){for(var j=Vi.lastIndex=0;Vi.test(b);)++j;return j}function Zr(b){return b.match(Vi)||[]}function ln(b){return b.match(N0)||[]}var g,Tn="4.17.21",Ur=200,zr="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",Ht="Expected a function",Rr="Invalid `variable` option passed into `_.template`",sr="__lodash_hash_undefined__",Pr=500,Be="__lodash_placeholder__",ne=1,mr=2,Ve=4,we=1,cr=2,fe=1,er=2,fn=4,Ce=8,lr=16,Ee=32,Fe=64,Ae=128,zt=256,_e=512,Sr=30,dn="...",On=800,_r=16,Ze=1,pn=2,fr=3,rr=1/0,Ue=9007199254740991,hn=17976931348623157e292,Tr=NaN,Le=4294967295,Dn=Le-1,Wn=Le>>>1,y=[["ary",Ae],["bind",fe],["bindKey",er],["curry",Ce],["curryRight",lr],["flip",_e],["partial",Ee],["partialRight",Fe],["rearg",zt]],E="[object Arguments]",D="[object Array]",rt="[object AsyncFunction]",ft="[object Boolean]",Qt="[object Date]",wt="[object DOMException]",gt="[object Error]",ee="[object Function]",Bt="[object GeneratorFunction]",Et="[object Map]",se="[object Number]",Or="[object Null]",ze="[object Object]",Pe="[object Promise]",Pf="[object Proxy]",Vn="[object RegExp]",nr="[object Set]",Mn="[object String]",ho="[object Symbol]",Sf="[object Undefined]",Nn="[object WeakMap]",Yf="[object WeakSet]",Hn="[object ArrayBuffer]",gn="[object DataView]",xi="[object Float32Array]",Qi="[object Float64Array]",wi="[object Int8Array]",Ci="[object Int16Array]",Ei="[object Int32Array]",Ai="[object Uint8Array]",Li="[object Uint8ClampedArray]",ki="[object Uint16Array]",ji="[object Uint32Array]",Gf=/\b__p \+= '';/g,Xf=/\b(__p \+=) '' \+/g,Kf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Su=/&(?:amp|lt|gt|quot|#39);/g,Yu=/[&<>"']/g,Jf=RegExp(Su.source),qf=RegExp(Yu.source),$f=/<%-([\s\S]+?)%>/g,t0=/<%([\s\S]+?)%>/g,Gu=/<%=([\s\S]+?)%>/g,e0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r0=/^\w*$/,n0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ii=/[\\^$.*+?()[\]{}|]/g,o0=RegExp(Ii.source),Ri=/^\s+/,i0=/\s/,a0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,u0=/\{\n\/\* \[wrapped with (.+)\] \*/,s0=/,? & /,c0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,l0=/[()=,{}\[\]\/\s]/,f0=/\\(\\)?/g,d0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xu=/\w*$/,p0=/^[-+]0x[0-9a-f]+$/i,h0=/^0b[01]+$/i,g0=/^\[object .+?Constructor\]$/,v0=/^0o[0-7]+$/i,y0=/^(?:0|[1-9]\d*)$/,m0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,go=/($^)/,_0=/['\n\r\u2028\u2029\\]/g,vo="\\ud800-\\udfff",b0="\\u0300-\\u036f",x0="\\ufe20-\\ufe2f",Q0="\\u20d0-\\u20ff",Ku=b0+x0+Q0,Ju="\\u2700-\\u27bf",qu="a-z\\xdf-\\xf6\\xf8-\\xff",w0="\\xac\\xb1\\xd7\\xf7",C0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",E0="\\u2000-\\u206f",A0=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$u="A-Z\\xc0-\\xd6\\xd8-\\xde",ts="\\ufe0e\\ufe0f",es=w0+C0+E0+A0,Ti="['’]",L0="["+vo+"]",rs="["+es+"]",yo="["+Ku+"]",ns="\\d+",k0="["+Ju+"]",os="["+qu+"]",is="[^"+vo+es+ns+Ju+qu+$u+"]",Oi="\\ud83c[\\udffb-\\udfff]",j0="(?:"+yo+"|"+Oi+")",as="[^"+vo+"]",Di="(?:\\ud83c[\\udde6-\\uddff]){2}",Wi="[\\ud800-\\udbff][\\udc00-\\udfff]",vn="["+$u+"]",us="\\u200d",ss="(?:"+os+"|"+is+")",I0="(?:"+vn+"|"+is+")",cs="(?:"+Ti+"(?:d|ll|m|re|s|t|ve))?",ls="(?:"+Ti+"(?:D|LL|M|RE|S|T|VE))?",fs=j0+"?",ds="["+ts+"]?",R0="(?:"+us+"(?:"+[as,Di,Wi].join("|")+")"+ds+fs+")*",T0="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",O0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ps=ds+fs+R0,D0="(?:"+[k0,Di,Wi].join("|")+")"+ps,W0="(?:"+[as+yo+"?",yo,Di,Wi,L0].join("|")+")",V0=RegExp(Ti,"g"),M0=RegExp(yo,"g"),Vi=RegExp(Oi+"(?="+Oi+")|"+W0+ps,"g"),N0=RegExp([vn+"?"+os+"+"+cs+"(?="+[rs,vn,"$"].join("|")+")",I0+"+"+ls+"(?="+[rs,vn+ss,"$"].join("|")+")",vn+"?"+ss+"+"+cs,vn+"+"+ls,O0,T0,ns,D0].join("|"),"g"),H0=RegExp("["+us+vo+Ku+ts+"]"),B0=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,F0=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Z0=-1,Wt={};Wt[xi]=Wt[Qi]=Wt[wi]=Wt[Ci]=Wt[Ei]=Wt[Ai]=Wt[Li]=Wt[ki]=Wt[ji]=!0,Wt[E]=Wt[D]=Wt[Hn]=Wt[ft]=Wt[gn]=Wt[Qt]=Wt[gt]=Wt[ee]=Wt[Et]=Wt[se]=Wt[ze]=Wt[Vn]=Wt[nr]=Wt[Mn]=Wt[Nn]=!1;var Dt={};Dt[E]=Dt[D]=Dt[Hn]=Dt[gn]=Dt[ft]=Dt[Qt]=Dt[xi]=Dt[Qi]=Dt[wi]=Dt[Ci]=Dt[Ei]=Dt[Et]=Dt[se]=Dt[ze]=Dt[Vn]=Dt[nr]=Dt[Mn]=Dt[ho]=Dt[Ai]=Dt[Li]=Dt[ki]=Dt[ji]=!0,Dt[gt]=Dt[ee]=Dt[Nn]=!1;var U0={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},z0={"&":"&","<":"<",">":">",'"':""","'":"'"},P0={"&":"&","<":"<",">":">",""":'"',"'":"'"},S0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Y0=parseFloat,G0=parseInt,hs=typeof jt=="object"&&jt&&jt.Object===Object&&jt,X0=typeof self=="object"&&self&&self.Object===Object&&self,de=hs||X0||Function("return this")(),Mi=o&&!o.nodeType&&o,Yr=Mi&&!0&&n&&!n.nodeType&&n,gs=Yr&&Yr.exports===Mi,Ni=gs&&hs.process,Se=function(){try{var b=Yr&&Yr.require&&Yr.require("util").types;return b||Ni&&Ni.binding&&Ni.binding("util")}catch(j){}}(),vs=Se&&Se.isArrayBuffer,ys=Se&&Se.isDate,ms=Se&&Se.isMap,_s=Se&&Se.isRegExp,bs=Se&&Se.isSet,xs=Se&&Se.isTypedArray,K0=J("length"),J0=F(U0),q0=F(z0),$0=F(P0),td=function b(j){function u(t){if(Pt(t)&&!dt(t)&&!(t instanceof G)){if(t instanceof nt)return t;if(kt.call(t,"__wrapped__"))return g1(t)}return new nt(t)}function S(){}function nt(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=g}function G(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Le,this.__views__=[]}function ke(){var t=new G(this.__wrapped__);return t.__actions__=je(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=je(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=je(this.__views__),t}function Hi(){if(this.__filtered__){var t=new G(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function ed(){var t=this.__wrapped__.value(),e=this.__dir__,r=dt(t),i=e<0,c=r?t.length:0,f=l3(0,c,this.__views__),v=f.start,m=f.end,w=m-v,R=i?m:v-1,I=this.__iteratees__,W=I.length,Z=0,X=he(w,this.__takeCount__);if(!r||!i&&c==w&&X==w)return Zs(t,this.__actions__);var $=[];t:for(;w--&&Z<X;){R+=e;for(var ht=-1,tt=t[R];++ht<W;){var bt=I[ht],xt=bt.iteratee,ve=bt.type,Oe=xt(tt);if(ve==pn)tt=Oe;else if(!Oe){if(ve==Ze)continue t;break t}}$[Z++]=tt}return $}function Gr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function rd(){this.__data__=Jn?Jn(null):{},this.size=0}function nd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function od(t){var e=this.__data__;if(Jn){var r=e[t];return r===sr?g:r}return kt.call(e,t)?e[t]:g}function id(t){var e=this.__data__;return Jn?e[t]!==g:kt.call(e,t)}function ad(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Jn&&e===g?sr:e,this}function br(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function ud(){this.__data__=[],this.size=0}function sd(t){var e=this.__data__,r=mo(e,t);return!(r<0)&&(r==e.length-1?e.pop():So.call(e,r,1),--this.size,!0)}function cd(t){var e=this.__data__,r=mo(e,t);return r<0?g:e[r][1]}function ld(t){return mo(this.__data__,t)>-1}function fd(t,e){var r=this.__data__,i=mo(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}function xr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function dd(){this.size=0,this.__data__={hash:new Gr,map:new(Xn||br),string:new Gr}}function pd(t){var e=Io(this,t).delete(t);return this.size-=e?1:0,e}function hd(t){return Io(this,t).get(t)}function gd(t){return Io(this,t).has(t)}function vd(t,e){var r=Io(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}function Xr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new xr;++e<r;)this.add(t[e])}function yd(t){return this.__data__.set(t,sr),this}function md(t){return this.__data__.has(t)}function or(t){this.size=(this.__data__=new br(t)).size}function _d(){this.__data__=new br,this.size=0}function bd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function xd(t){return this.__data__.get(t)}function Qd(t){return this.__data__.has(t)}function wd(t,e){var r=this.__data__;if(r instanceof br){var i=r.__data__;if(!Xn||i.length<Ur-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new xr(i)}return r.set(t,e),this.size=r.size,this}function Qs(t,e){var r=dt(t),i=!r&&en(t),c=!r&&!i&&Hr(t),f=!r&&!i&&!c&&Ln(t),v=r||i||c||f,m=v?Ut(t.length,_2):[],w=m.length;for(var R in t)!e&&!kt.call(t,R)||v&&(R=="length"||c&&(R=="offset"||R=="parent")||f&&(R=="buffer"||R=="byteLength"||R=="byteOffset")||Er(R,w))||m.push(R);return m}function ws(t){var e=t.length;return e?t[Xi(0,e-1)]:g}function Cd(t,e){return Ro(je(t),Kr(e,0,t.length))}function Ed(t){return Ro(je(t))}function Bi(t,e,r){(r===g||ir(t[e],r))&&(r!==g||e in t)||Qr(t,e,r)}function Bn(t,e,r){var i=t[e];kt.call(t,e)&&ir(i,r)&&(r!==g||e in t)||Qr(t,e,r)}function mo(t,e){for(var r=t.length;r--;)if(ir(t[r][0],e))return r;return-1}function Ad(t,e,r,i){return Nr(t,function(c,f,v){e(i,c,r(c),v)}),i}function Cs(t,e){return t&&pr(e,ce(e),t)}function Ld(t,e){return t&&pr(e,Re(e),t)}function Qr(t,e,r){e=="__proto__"&&Yo?Yo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Fi(t,e){for(var r=-1,i=e.length,c=oe(i),f=t==null;++r<i;)c[r]=f?g:ha(t,e[r]);return c}function Kr(t,e,r){return t===t&&(r!==g&&(t=t<=r?t:r),e!==g&&(t=t>=e?t:e)),t}function Ye(t,e,r,i,c,f){var v,m=e&ne,w=e&mr,R=e&Ve;if(r&&(v=c?r(t,i,c,f):r(t)),v!==g)return v;if(!Zt(t))return t;var I=dt(t);if(I){if(v=d3(t),!m)return je(t,v)}else{var W=ge(t),Z=W==ee||W==Bt;if(Hr(t))return zs(t,m);if(W==ze||W==E||Z&&!c){if(v=w||Z?{}:s1(t),!m)return w?r3(t,Ld(v,t)):e3(t,Cs(v,t))}else{if(!Dt[W])return c?t:{};v=p3(t,W,m)}}f||(f=new or);var X=f.get(t);if(X)return X;f.set(t,v),ic(t)?t.forEach(function(tt){v.add(Ye(tt,e,r,tt,t,f))}):oc(t)&&t.forEach(function(tt,bt){v.set(bt,Ye(tt,e,r,bt,t,f))});var $=R?w?aa:ia:w?Re:ce,ht=I?g:$(t);return l(ht||t,function(tt,bt){ht&&(bt=tt,tt=t[bt]),Bn(v,bt,Ye(tt,e,r,bt,t,f))}),v}function kd(t){var e=ce(t);return function(r){return Es(r,t,e)}}function Es(t,e,r){var i=r.length;if(t==null)return!i;for(t=Vt(t);i--;){var c=r[i],f=e[c],v=t[c];if(v===g&&!(c in t)||!f(v))return!1}return!0}function As(t,e,r){if(typeof t!="function")throw new Je(Ht);return $n(function(){t.apply(g,r)},e)}function Fn(t,e,r,i){var c=-1,f=x,v=!0,m=t.length,w=[],R=e.length;if(!m)return w;r&&(e=Q(e,lt(r))),i?(f=L,v=!1):e.length>=Ur&&(f=Tt,v=!1,e=new Xr(e));t:for(;++c<m;){var I=t[c],W=r==null?I:r(I);if(I=i||I!==0?I:0,v&&W===W){for(var Z=R;Z--;)if(e[Z]===W)continue t;w.push(I)}else f(e,W,i)||w.push(I)}return w}function jd(t,e){var r=!0;return Nr(t,function(i,c,f){return r=!!e(i,c,f)}),r}function _o(t,e,r){for(var i=-1,c=t.length;++i<c;){var f=t[i],v=e(f);if(v!=null&&(m===g?v===v&&!Ne(v):r(v,m)))var m=v,w=f}return w}function Id(t,e,r,i){var c=t.length;for(r=vt(r),r<0&&(r=-r>c?0:c+r),i=i===g||i>c?c:vt(i),i<0&&(i+=c),i=r>i?0:O1(i);r<i;)t[r++]=e;return t}function Ls(t,e){var r=[];return Nr(t,function(i,c,f){e(i,c,f)&&r.push(i)}),r}function pe(t,e,r,i,c){var f=-1,v=t.length;for(r||(r=g3),c||(c=[]);++f<v;){var m=t[f];e>0&&r(m)?e>1?pe(m,e-1,r,i,c):k(c,m):i||(c[c.length]=m)}return c}function dr(t,e){return t&&La(t,e,ce)}function Zi(t,e){return t&&K1(t,e,ce)}function bo(t,e){return d(e,function(r){return Ar(t[r])})}function Jr(t,e){e=Wr(e,t);for(var r=0,i=e.length;t!=null&&r<i;)t=t[hr(e[r++])];return r&&r==i?t:g}function ks(t,e,r){var i=e(t);return dt(t)?i:k(i,r(t))}function be(t){return t==null?t===g?Sf:Or:tn&&tn in Vt(t)?c3(t):x3(t)}function Ui(t,e){return t>e}function Rd(t,e){return t!=null&&kt.call(t,e)}function Td(t,e){return t!=null&&e in Vt(t)}function Od(t,e,r){return t>=he(e,r)&&t<ie(e,r)}function zi(t,e,r){for(var i=r?L:x,c=t[0].length,f=t.length,v=f,m=oe(f),w=1/0,R=[];v--;){var I=t[v];v&&e&&(I=Q(I,lt(e))),w=he(I.length,w),m[v]=!r&&(e||c>=120&&I.length>=120)?new Xr(v&&I):g}I=t[0];var W=-1,Z=m[0];t:for(;++W<c&&R.length<w;){var X=I[W],$=e?e(X):X;if(X=r||X!==0?X:0,!(Z?Tt(Z,$):i(R,$,r))){for(v=f;--v;){var ht=m[v];if(!(ht?Tt(ht,$):i(t[v],$,r)))continue t}Z&&Z.push($),R.push(X)}}return R}function Dd(t,e,r,i){return dr(t,function(c,f,v){e(i,r(c),f,v)}),i}function Zn(t,e,r){e=Wr(e,t),t=d1(t,e);var i=t==null?t:t[hr(Xe(e))];return i==null?g:a(i,t,r)}function js(t){return Pt(t)&&be(t)==E}function Wd(t){return Pt(t)&&be(t)==Hn}function Vd(t){return Pt(t)&&be(t)==Qt}function Un(t,e,r,i,c){return t===e||(t==null||e==null||!Pt(t)&&!Pt(e)?t!==t&&e!==e:Md(t,e,r,i,Un,c))}function Md(t,e,r,i,c,f){var v=dt(t),m=dt(e),w=v?D:ge(t),R=m?D:ge(e);w=w==E?ze:w,R=R==E?ze:R;var I=w==ze,W=R==ze,Z=w==R;if(Z&&Hr(t)){if(!Hr(e))return!1;v=!0,I=!1}if(Z&&!I)return f||(f=new or),v||Ln(t)?a1(t,e,r,i,c,f):u3(t,e,w,r,i,c,f);if(!(r&we)){var X=I&&kt.call(t,"__wrapped__"),$=W&&kt.call(e,"__wrapped__");if(X||$){var ht=X?t.value():t,tt=$?e.value():e;return f||(f=new or),c(ht,tt,r,i,f)}}return!!Z&&(f||(f=new or),s3(t,e,r,i,c,f))}function Nd(t){return Pt(t)&&ge(t)==Et}function Pi(t,e,r,i){var c=r.length,f=c,v=!i;if(t==null)return!f;for(t=Vt(t);c--;){var m=r[c];if(v&&m[2]?m[1]!==t[m[0]]:!(m[0]in t))return!1}for(;++c<f;){m=r[c];var w=m[0],R=t[w],I=m[1];if(v&&m[2]){if(R===g&&!(w in t))return!1}else{var W=new or;if(i)var Z=i(R,I,w,t,e,W);if(!(Z===g?Un(I,R,we|cr,i,W):Z))return!1}}return!0}function Is(t){return!(!Zt(t)||y3(t))&&(Ar(t)?C2:g0).test($r(t))}function Hd(t){return Pt(t)&&be(t)==Vn}function Bd(t){return Pt(t)&&ge(t)==nr}function Fd(t){return Pt(t)&&Vo(t.length)&&!!Wt[be(t)]}function Rs(t){return typeof t=="function"?t:t==null?Te:typeof t=="object"?dt(t)?Ds(t[0],t[1]):Os(t):H1(t)}function Si(t){if(!Sn(t))return I2(t);var e=[];for(var r in Vt(t))kt.call(t,r)&&r!="constructor"&&e.push(r);return e}function Zd(t){if(!Zt(t))return b3(t);var e=Sn(t),r=[];for(var i in t)(i!="constructor"||!e&&kt.call(t,i))&&r.push(i);return r}function Yi(t,e){return t<e}function Ts(t,e){var r=-1,i=Ie(t)?oe(t.length):[];return Nr(t,function(c,f,v){i[++r]=e(c,f,v)}),i}function Os(t){var e=ua(t);return e.length==1&&e[0][2]?l1(e[0][0],e[0][1]):function(r){return r===t||Pi(r,t,e)}}function Ds(t,e){return sa(t)&&c1(e)?l1(hr(t),e):function(r){var i=ha(r,t);return i===g&&i===e?ga(r,t):Un(e,i,we|cr)}}function xo(t,e,r,i,c){t!==e&&La(e,function(f,v){if(c||(c=new or),Zt(f))Ud(t,e,v,r,xo,i,c);else{var m=i?i(la(t,v),f,v+"",t,e,c):g;m===g&&(m=f),Bi(t,v,m)}},Re)}function Ud(t,e,r,i,c,f,v){var m=la(t,r),w=la(e,r),R=v.get(w);if(R)return Bi(t,r,R),g;var I=f?f(m,w,r+"",t,e,v):g,W=I===g;if(W){var Z=dt(w),X=!Z&&Hr(w),$=!Z&&!X&&Ln(w);I=w,Z||X||$?dt(m)?I=m:Jt(m)?I=je(m):X?(W=!1,I=zs(w,!0)):$?(W=!1,I=Ps(w,!0)):I=[]:Yn(w)||en(w)?(I=m,en(m)?I=D1(m):Zt(m)&&!Ar(m)||(I=s1(w))):W=!1}W&&(v.set(w,I),c(I,w,i,f,v),v.delete(w)),Bi(t,r,I)}function Ws(t,e){var r=t.length;if(r)return e+=e<0?r:0,Er(e,r)?t[e]:g}function Vs(t,e,r){e=e.length?Q(e,function(c){return dt(c)?function(f){return Jr(f,c.length===1?c[0]:c)}:c}):[Te];var i=-1;return e=Q(e,lt(ot())),yt(Ts(t,function(c,f,v){return{criteria:Q(e,function(m){return m(c)}),index:++i,value:c}}),function(c,f){return t3(c,f,r)})}function zd(t,e){return Ms(t,e,function(r,i){return ga(t,i)})}function Ms(t,e,r){for(var i=-1,c=e.length,f={};++i<c;){var v=e[i],m=Jr(t,v);r(m,v)&&zn(f,Wr(v,t),m)}return f}function Pd(t){return function(e){return Jr(e,t)}}function Gi(t,e,r,i){var c=i?ct:K,f=-1,v=e.length,m=t;for(t===e&&(e=je(e)),r&&(m=Q(t,lt(r)));++f<v;)for(var w=0,R=e[f],I=r?r(R):R;(w=c(m,I,w,i))>-1;)m!==t&&So.call(m,w,1),So.call(t,w,1);return t}function Ns(t,e){for(var r=t?e.length:0,i=r-1;r--;){var c=e[r];if(r==i||c!==f){var f=c;Er(c)?So.call(t,c,1):qi(t,c)}}return t}function Xi(t,e){return t+Xo(Y1()*(e-t+1))}function Sd(t,e,r,i){for(var c=-1,f=ie(Go((e-t)/(r||1)),0),v=oe(f);f--;)v[i?f:++c]=t,t+=r;return v}function Ki(t,e){var r="";if(!t||e<1||e>Ue)return r;do e%2&&(r+=t),e=Xo(e/2),e&&(t+=t);while(e);return r}function mt(t,e){return Ia(f1(t,e,Te),t+"")}function Yd(t){return ws(xn(t))}function Gd(t,e){var r=xn(t);return Ro(r,Kr(e,0,r.length))}function zn(t,e,r,i){if(!Zt(t))return t;e=Wr(e,t);for(var c=-1,f=e.length,v=f-1,m=t;m!=null&&++c<f;){var w=hr(e[c]),R=r;if(w==="__proto__"||w==="constructor"||w==="prototype")return t;if(c!=v){var I=m[w];R=i?i(I,w,m):g,R===g&&(R=Zt(I)?I:Er(e[c+1])?[]:{})}Bn(m,w,R),m=m[w]}return t}function Xd(t){return Ro(xn(t))}function Ge(t,e,r){var i=-1,c=t.length;e<0&&(e=-e>c?0:c+e),r=r>c?c:r,r<0&&(r+=c),c=e>r?0:r-e>>>0,e>>>=0;for(var f=oe(c);++i<c;)f[i]=t[i+e];return f}function Kd(t,e){var r;return Nr(t,function(i,c,f){return r=e(i,c,f),!r}),!!r}function Qo(t,e,r){var i=0,c=t==null?i:t.length;if(typeof e=="number"&&e===e&&c<=Wn){for(;i<c;){var f=i+c>>>1,v=t[f];v!==null&&!Ne(v)&&(r?v<=e:v<e)?i=f+1:c=f}return c}return Ji(t,e,Te,r)}function Ji(t,e,r,i){var c=0,f=t==null?0:t.length;if(f===0)return 0;e=r(e);for(var v=e!==e,m=e===null,w=Ne(e),R=e===g;c<f;){var I=Xo((c+f)/2),W=r(t[I]),Z=W!==g,X=W===null,$=W===W,ht=Ne(W);if(v)var tt=i||$;else tt=R?$&&(i||Z):m?$&&Z&&(i||!X):w?$&&Z&&!X&&(i||!ht):!X&&!ht&&(i?W<=e:W<e);tt?c=I+1:f=I}return he(f,Dn)}function Hs(t,e){for(var r=-1,i=t.length,c=0,f=[];++r<i;){var v=t[r],m=e?e(v):v;if(!r||!ir(m,w)){var w=m;f[c++]=v===0?0:v}}return f}function Bs(t){return typeof t=="number"?t:Ne(t)?Tr:+t}function Me(t){if(typeof t=="string")return t;if(dt(t))return Q(t,Me)+"";if(Ne(t))return G1?G1.call(t):"";var e=t+"";return e=="0"&&1/t==-rr?"-0":e}function Dr(t,e,r){var i=-1,c=x,f=t.length,v=!0,m=[],w=m;if(r)v=!1,c=L;else if(f>=Ur){var R=e?null:F2(t);if(R)return st(R);v=!1,c=Tt,w=new Xr}else w=e?[]:m;t:for(;++i<f;){var I=t[i],W=e?e(I):I;if(I=r||I!==0?I:0,v&&W===W){for(var Z=w.length;Z--;)if(w[Z]===W)continue t;e&&w.push(W),m.push(I)}else c(w,W,r)||(w!==m&&w.push(W),m.push(I))}return m}function qi(t,e){return e=Wr(e,t),t=d1(t,e),t==null||delete t[hr(Xe(e))]}function Fs(t,e,r,i){return zn(t,e,r(Jr(t,e)),i)}function wo(t,e,r,i){for(var c=t.length,f=i?c:-1;(i?f--:++f<c)&&e(t[f],f,t););return r?Ge(t,i?0:f,i?f+1:c):Ge(t,i?f+1:0,i?c:f)}function Zs(t,e){var r=t;return r instanceof G&&(r=r.value()),V(e,function(i,c){return c.func.apply(c.thisArg,k([i],c.args))},r)}function $i(t,e,r){var i=t.length;if(i<2)return i?Dr(t[0]):[];for(var c=-1,f=oe(i);++c<i;)for(var v=t[c],m=-1;++m<i;)m!=c&&(f[c]=Fn(f[c]||v,t[m],e,r));return Dr(pe(f,1),e,r)}function Us(t,e,r){for(var i=-1,c=t.length,f=e.length,v={};++i<c;)r(v,t[i],i<f?e[i]:g);return v}function ta(t){return Jt(t)?t:[]}function ea(t){return typeof t=="function"?t:Te}function Wr(t,e){return dt(t)?t:sa(t,e)?[t]:ec(At(t))}function Vr(t,e,r){var i=t.length;return r=r===g?i:r,!e&&r>=i?t:Ge(t,e,r)}function zs(t,e){if(e)return t.slice();var r=t.length,i=Z1?Z1(r):new t.constructor(r);return t.copy(i),i}function ra(t){var e=new t.constructor(t.byteLength);return new zo(e).set(new zo(t)),e}function Jd(t,e){return new t.constructor(e?ra(t.buffer):t.buffer,t.byteOffset,t.byteLength)}function qd(t){var e=new t.constructor(t.source,Xu.exec(t));return e.lastIndex=t.lastIndex,e}function $d(t){return qn?Vt(qn.call(t)):{}}function Ps(t,e){return new t.constructor(e?ra(t.buffer):t.buffer,t.byteOffset,t.length)}function Ss(t,e){if(t!==e){var r=t!==g,i=t===null,c=t===t,f=Ne(t),v=e!==g,m=e===null,w=e===e,R=Ne(e);if(!m&&!R&&!f&&t>e||f&&v&&w&&!m&&!R||i&&v&&w||!r&&w||!c)return 1;if(!i&&!f&&!R&&t<e||R&&r&&c&&!i&&!f||m&&r&&c||!v&&c||!w)return-1}return 0}function t3(t,e,r){for(var i=-1,c=t.criteria,f=e.criteria,v=c.length,m=r.length;++i<v;){var w=Ss(c[i],f[i]);if(w)return i>=m?w:w*(r[i]=="desc"?-1:1)}return t.index-e.index}function Ys(t,e,r,i){for(var c=-1,f=t.length,v=r.length,m=-1,w=e.length,R=ie(f-v,0),I=oe(w+R),W=!i;++m<w;)I[m]=e[m];for(;++c<v;)(W||c<f)&&(I[r[c]]=t[c]);for(;R--;)I[m++]=t[c++];return I}function Gs(t,e,r,i){for(var c=-1,f=t.length,v=-1,m=r.length,w=-1,R=e.length,I=ie(f-m,0),W=oe(I+R),Z=!i;++c<I;)W[c]=t[c];for(var X=c;++w<R;)W[X+w]=e[w];for(;++v<m;)(Z||c<f)&&(W[X+r[v]]=t[c++]);return W}function je(t,e){var r=-1,i=t.length;for(e||(e=oe(i));++r<i;)e[r]=t[r];return e}function pr(t,e,r,i){var c=!r;r||(r={});for(var f=-1,v=e.length;++f<v;){var m=e[f],w=i?i(r[m],t[m],m,r,t):g;w===g&&(w=t[m]),c?Qr(r,m,w):Bn(r,m,w)}return r}function e3(t,e){return pr(t,ja(t),e)}function r3(t,e){return pr(t,$1(t),e)}function Co(t,e){return function(r,i){var c=dt(r)?s:Ad,f=e?e():{};return c(r,t,ot(i,2),f)}}function mn(t){return mt(function(e,r){var i=-1,c=r.length,f=c>1?r[c-1]:g,v=c>2?r[2]:g;for(f=t.length>3&&typeof f=="function"?(c--,f):g,v&&xe(r[0],r[1],v)&&(f=c<3?g:f,c=1),e=Vt(e);++i<c;){var m=r[i];m&&t(e,m,i,f)}return e})}function Xs(t,e){return function(r,i){if(r==null)return r;if(!Ie(r))return t(r,i);for(var c=r.length,f=e?c:-1,v=Vt(r);(e?f--:++f<c)&&i(v[f],f,v)!==!1;);return r}}function Ks(t){return function(e,r,i){for(var c=-1,f=Vt(e),v=i(e),m=v.length;m--;){var w=v[t?m:++c];if(r(f[w],w,f)===!1)break}return e}}function n3(t,e,r){function i(){return(this&&this!==de&&this instanceof i?f:t).apply(c?r:this,arguments)}var c=e&fe,f=Pn(t);return i}function Js(t){return function(e){e=At(e);var r=Lt(e)?ue(e):g,i=r?r[0]:e.charAt(0),c=r?Vr(r,1).join(""):e.slice(1);return i[t]()+c}}function _n(t){return function(e){return V(N1(M1(e).replace(V0,"")),t,"")}}function Pn(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=An(t.prototype),i=t.apply(r,e);return Zt(i)?i:r}}function o3(t,e,r){function i(){for(var f=arguments.length,v=oe(f),m=f,w=bn(i);m--;)v[m]=arguments[m];var R=f<3&&v[0]!==w&&v[f-1]!==w?[]:P(v,w);return f-=R.length,f<r?r1(t,e,Eo,i.placeholder,g,v,R,g,g,r-f):a(this&&this!==de&&this instanceof i?c:t,this,v)}var c=Pn(t);return i}function qs(t){return function(e,r,i){var c=Vt(e);if(!Ie(e)){var f=ot(r,3);e=ce(e),r=function(m){return f(c[m],m,c)}}var v=t(e,r,i);return v>-1?c[f?e[v]:v]:g}}function $s(t){return Cr(function(e){var r=e.length,i=r,c=nt.prototype.thru;for(t&&e.reverse();i--;){var f=e[i];if(typeof f!="function")throw new Je(Ht);if(c&&!v&&jo(f)=="wrapper")var v=new nt([],!0)}for(i=v?i:r;++i<r;){f=e[i];var m=jo(f),w=m=="wrapper"?ka(f):g;v=w&&ca(w[0])&&w[1]==(Ae|Ce|Ee|zt)&&!w[4].length&&w[9]==1?v[jo(w[0])].apply(v,w[3]):f.length==1&&ca(f)?v[m]():v.thru(f)}return function(){var R=arguments,I=R[0];if(v&&R.length==1&&dt(I))return v.plant(I).value();for(var W=0,Z=r?e[W].apply(this,R):I;++W<r;)Z=e[W].call(this,Z);return Z}})}function Eo(t,e,r,i,c,f,v,m,w,R){function I(){for(var bt=arguments.length,xt=oe(bt),ve=bt;ve--;)xt[ve]=arguments[ve];if($)var Oe=bn(I),Br=Ot(xt,Oe);if(i&&(xt=Ys(xt,i,c,$)),f&&(xt=Gs(xt,f,v,$)),bt-=Br,$&&bt<R)return r1(t,e,Eo,I.placeholder,r,xt,P(xt,Oe),m,w,R-bt);var St=Z?r:this,qe=X?St[t]:t;return bt=xt.length,m?xt=Q3(xt,m):ht&&bt>1&&xt.reverse(),W&&w<bt&&(xt.length=w),this&&this!==de&&this instanceof I&&(qe=tt||Pn(qe)),qe.apply(St,xt)}var W=e&Ae,Z=e&fe,X=e&er,$=e&(Ce|lr),ht=e&_e,tt=X?g:Pn(t);return I}function t1(t,e){return function(r,i){return Dd(r,t,e(i),{})}}function Ao(t,e){return function(r,i){var c;if(r===g&&i===g)return e;if(r!==g&&(c=r),i!==g){if(c===g)return i;typeof r=="string"||typeof i=="string"?(r=Me(r),i=Me(i)):(r=Bs(r),i=Bs(i)),c=t(r,i)}return c}}function na(t){return Cr(function(e){return e=Q(e,lt(ot())),mt(function(r){var i=this;return t(e,function(c){return a(c,i,r)})})})}function Lo(t,e){e=e===g?" ":Me(e);var r=e.length;if(r<2)return r?Ki(e,t):e;var i=Ki(e,Go(t/Kt(e)));return Lt(e)?Vr(ue(i),0,t).join(""):i.slice(0,t)}function i3(t,e,r,i){function c(){for(var m=-1,w=arguments.length,R=-1,I=i.length,W=oe(I+w),Z=this&&this!==de&&this instanceof c?v:t;++R<I;)W[R]=i[R];for(;w--;)W[R++]=arguments[++m];return a(Z,f?r:this,W)}var f=e&fe,v=Pn(t);return c}function e1(t){return function(e,r,i){return i&&typeof i!="number"&&xe(e,r,i)&&(r=i=g),e=Lr(e),r===g?(r=e,e=0):r=Lr(r),i=i===g?e<r?1:-1:Lr(i),Sd(e,r,i,t)}}function ko(t){return function(e,r){return typeof e=="string"&&typeof r=="string"||(e=Ke(e),r=Ke(r)),t(e,r)}}function r1(t,e,r,i,c,f,v,m,w,R){var I=e&Ce,W=I?v:g,Z=I?g:v,X=I?f:g,$=I?g:f;e|=I?Ee:Fe,e&=~(I?Fe:Ee),e&fn||(e&=~(fe|er));var ht=[t,e,c,X,W,$,Z,m,w,R],tt=r.apply(g,ht);return ca(t)&&tc(tt,ht),tt.placeholder=i,p1(tt,t,e)}function oa(t){var e=Qn[t];return function(r,i){if(r=Ke(r),i=i==null?0:he(vt(i),292),i&&S1(r)){var c=(At(r)+"e").split("e");return c=(At(e(c[0]+"e"+(+c[1]+i)))+"e").split("e"),+(c[0]+"e"+(+c[1]-i))}return e(r)}}function n1(t){return function(e){var r=ge(e);return r==Et?B(e):r==nr?Nt(e):ut(e,t(e))}}function wr(t,e,r,i,c,f,v,m){var w=e&er;if(!w&&typeof t!="function")throw new Je(Ht);var R=i?i.length:0;if(R||(e&=~(Ee|Fe),i=c=g),v=v===g?v:ie(vt(v),0),m=m===g?m:vt(m),R-=c?c.length:0,e&Fe){var I=i,W=c;i=c=g}var Z=w?g:ka(t),X=[t,e,r,i,c,I,W,f,v,m];if(Z&&_3(X,Z),t=X[0],e=X[1],r=X[2],i=X[3],c=X[4],m=X[9]=X[9]===g?w?0:t.length:ie(X[9]-R,0),!m&&e&(Ce|lr)&&(e&=~(Ce|lr)),e&&e!=fe)$=e==Ce||e==lr?o3(t,e,m):e!=Ee&&e!=(fe|Ee)||c.length?Eo.apply(g,X):i3(t,e,r,i);else var $=n3(t,e,r);return p1((Z?J1:tc)($,X),t,e)}function o1(t,e,r,i){return t===g||ir(t,wn[r])&&!kt.call(i,r)?e:t}function i1(t,e,r,i,c,f){return Zt(t)&&Zt(e)&&(f.set(e,t),xo(t,e,g,i1,f),f.delete(e)),t}function a3(t){return Yn(t)?g:t}function a1(t,e,r,i,c,f){var v=r&we,m=t.length,w=e.length;if(m!=w&&!(v&&w>m))return!1;var R=f.get(t),I=f.get(e);if(R&&I)return R==e&&I==t;var W=-1,Z=!0,X=r&cr?new Xr:g;for(f.set(t,e),f.set(e,t);++W<m;){var $=t[W],ht=e[W];if(i)var tt=v?i(ht,$,W,e,t,f):i($,ht,W,t,e,f);if(tt!==g){if(tt)continue;Z=!1;break}if(X){if(!O(e,function(bt,xt){if(!Tt(X,xt)&&($===bt||c($,bt,r,i,f)))return X.push(xt)})){Z=!1;break}}else if($!==ht&&!c($,ht,r,i,f)){Z=!1;break}}return f.delete(t),f.delete(e),Z}function u3(t,e,r,i,c,f,v){switch(r){case gn:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Hn:return!(t.byteLength!=e.byteLength||!f(new zo(t),new zo(e)));case ft:case Qt:case se:return ir(+t,+e);case gt:return t.name==e.name&&t.message==e.message;case Vn:case Mn:return t==e+"";case Et:var m=B;case nr:var w=i&we;if(m||(m=st),t.size!=e.size&&!w)return!1;var R=v.get(t);if(R)return R==e;i|=cr,v.set(t,e);var I=a1(m(t),m(e),i,c,f,v);return v.delete(t),I;case ho:if(qn)return qn.call(t)==qn.call(e)}return!1}function s3(t,e,r,i,c,f){var v=r&we,m=ia(t),w=m.length;if(w!=ia(e).length&&!v)return!1;for(var R=w;R--;){var I=m[R];if(!(v?I in e:kt.call(e,I)))return!1}var W=f.get(t),Z=f.get(e);if(W&&Z)return W==e&&Z==t;var X=!0;f.set(t,e),f.set(e,t);for(var $=v;++R<w;){I=m[R];var ht=t[I],tt=e[I];if(i)var bt=v?i(tt,ht,I,e,t,f):i(ht,tt,I,t,e,f);if(!(bt===g?ht===tt||c(ht,tt,r,i,f):bt)){X=!1;break}$||($=I=="constructor")}if(X&&!$){var xt=t.constructor,ve=e.constructor;xt!=ve&&"constructor"in t&&"constructor"in e&&!(typeof xt=="function"&&xt instanceof xt&&typeof ve=="function"&&ve instanceof ve)&&(X=!1)}return f.delete(t),f.delete(e),X}function Cr(t){return Ia(f1(t,g,m1),t+"")}function ia(t){return ks(t,ce,ja)}function aa(t){return ks(t,Re,$1)}function jo(t){for(var e=t.name+"",r=En[e],i=kt.call(En,e)?r.length:0;i--;){var c=r[i],f=c.func;if(f==null||f==t)return c.name}return e}function bn(t){return(kt.call(u,"placeholder")?u:t).placeholder}function ot(){var t=u.iteratee||ya;return t=t===ya?Rs:t,arguments.length?t(arguments[0],arguments[1]):t}function Io(t,e){var r=t.__data__;return v3(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ua(t){for(var e=ce(t),r=e.length;r--;){var i=e[r],c=t[i];e[r]=[i,c,c1(c)]}return e}function qr(t,e){var r=$e(t,e);return Is(r)?r:g}function c3(t){var e=kt.call(t,tn),r=t[tn];try{t[tn]=g;var i=!0}catch(f){}var c=Zo.call(t);return i&&(e?t[tn]=r:delete t[tn]),c}function l3(t,e,r){for(var i=-1,c=r.length;++i<c;){var f=r[i],v=f.size;switch(f.type){case"drop":t+=v;break;case"dropRight":e-=v;break;case"take":e=he(e,t+v);break;case"takeRight":t=ie(t,e-v)}}return{start:t,end:e}}function f3(t){var e=t.match(u0);return e?e[1].split(s0):[]}function u1(t,e,r){e=Wr(e,t);for(var i=-1,c=e.length,f=!1;++i<c;){var v=hr(e[i]);if(!(f=t!=null&&r(t,v)))break;t=t[v]}return f||++i!=c?f:(c=t==null?0:t.length,!!c&&Vo(c)&&Er(v,c)&&(dt(t)||en(t)))}function d3(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&kt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function s1(t){return typeof t.constructor!="function"||Sn(t)?{}:An(Po(t))}function p3(t,e,r){var i=t.constructor;switch(e){case Hn:return ra(t);case ft:case Qt:return new i(+t);case gn:return Jd(t,r);case xi:case Qi:case wi:case Ci:case Ei:case Ai:case Li:case ki:case ji:return Ps(t,r);case Et:return new i;case se:case Mn:return new i(t);case Vn:return qd(t);case nr:return new i;case ho:return $d(t)}}function h3(t,e){var r=e.length;if(!r)return t;var i=r-1;return e[i]=(r>1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(a0,`{
|
|
35
|
+
/* [wrapped with `+e+`] */
|
|
36
|
+
`)}function g3(t){return dt(t)||en(t)||!!(P1&&t&&t[P1])}function Er(t,e){var r=typeof t;return e=e==null?Ue:e,!!e&&(r=="number"||r!="symbol"&&y0.test(t))&&t>-1&&t%1==0&&t<e}function xe(t,e,r){if(!Zt(r))return!1;var i=typeof e;return!!(i=="number"?Ie(r)&&Er(e,r.length):i=="string"&&e in r)&&ir(r[e],t)}function sa(t,e){if(dt(t))return!1;var r=typeof t;return!(r!="number"&&r!="symbol"&&r!="boolean"&&t!=null&&!Ne(t))||r0.test(t)||!e0.test(t)||e!=null&&t in Vt(e)}function v3(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ca(t){var e=jo(t),r=u[e];if(typeof r!="function"||!(e in G.prototype))return!1;if(t===r)return!0;var i=ka(r);return!!i&&t===i[0]}function y3(t){return!!F1&&F1 in t}function Sn(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||wn)}function c1(t){return t===t&&!Zt(t)}function l1(t,e){return function(r){return r!=null&&r[t]===e&&(e!==g||t in Vt(r))}}function m3(t){var e=Do(t,function(i){return r.size===Pr&&r.clear(),i}),r=e.cache;return e}function _3(t,e){var r=t[1],i=e[1],c=r|i,f=c<(fe|er|Ae),v=i==Ae&&r==Ce||i==Ae&&r==zt&&t[7].length<=e[8]||i==(Ae|zt)&&e[7].length<=e[8]&&r==Ce;if(!f&&!v)return t;i&fe&&(t[2]=e[2],c|=r&fe?0:fn);var m=e[3];if(m){var w=t[3];t[3]=w?Ys(w,m,e[4]):m,t[4]=w?P(t[3],Be):e[4]}return m=e[5],m&&(w=t[5],t[5]=w?Gs(w,m,e[6]):m,t[6]=w?P(t[5],Be):e[6]),m=e[7],m&&(t[7]=m),i&Ae&&(t[8]=t[8]==null?e[8]:he(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=c,t}function b3(t){var e=[];if(t!=null)for(var r in Vt(t))e.push(r);return e}function x3(t){return Zo.call(t)}function f1(t,e,r){return e=ie(e===g?t.length-1:e,0),function(){for(var i=arguments,c=-1,f=ie(i.length-e,0),v=oe(f);++c<f;)v[c]=i[e+c];c=-1;for(var m=oe(e+1);++c<e;)m[c]=i[c];return m[e]=r(v),a(t,this,m)}}function d1(t,e){return e.length<2?t:Jr(t,Ge(e,0,-1))}function Q3(t,e){for(var r=t.length,i=he(e.length,r),c=je(t);i--;){var f=e[i];t[i]=Er(f,r)?c[f]:g}return t}function la(t,e){if((e!=="constructor"||typeof t[e]!="function")&&e!="__proto__")return t[e]}function p1(t,e,r){var i=e+"";return Ia(t,h3(i,w3(f3(i),r)))}function h1(t){var e=0,r=0;return function(){var i=R2(),c=_r-(i-r);if(r=i,c>0){if(++e>=On)return arguments[0]}else e=0;return t.apply(g,arguments)}}function Ro(t,e){var r=-1,i=t.length,c=i-1;for(e=e===g?i:e;++r<e;){var f=Xi(r,c),v=t[f];t[f]=t[r],t[r]=v}return t.length=e,t}function hr(t){if(typeof t=="string"||Ne(t))return t;var e=t+"";return e=="0"&&1/t==-rr?"-0":e}function $r(t){if(t!=null){try{return Fo.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function w3(t,e){return l(y,function(r){var i="_."+r[0];e&r[1]&&!x(t,i)&&t.push(i)}),t.sort()}function g1(t){if(t instanceof G)return t.clone();var e=new nt(t.__wrapped__,t.__chain__);return e.__actions__=je(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function C3(t,e,r){e=(r?xe(t,e,r):e===g)?1:ie(vt(e),0);var i=t==null?0:t.length;if(!i||e<1)return[];for(var c=0,f=0,v=oe(Go(i/e));c<i;)v[f++]=Ge(t,c,c+=e);return v}function E3(t){for(var e=-1,r=t==null?0:t.length,i=0,c=[];++e<r;){var f=t[e];f&&(c[i++]=f)}return c}function A3(){var t=arguments.length;if(!t)return[];for(var e=oe(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return k(dt(r)?je(r):[r],pe(e,1))}function L3(t,e,r){var i=t==null?0:t.length;return i?(e=r||e===g?1:vt(e),Ge(t,e<0?0:e,i)):[]}function k3(t,e,r){var i=t==null?0:t.length;return i?(e=r||e===g?1:vt(e),e=i-e,Ge(t,0,e<0?0:e)):[]}function j3(t,e){return t&&t.length?wo(t,ot(e,3),!0,!0):[]}function I3(t,e){return t&&t.length?wo(t,ot(e,3),!0):[]}function R3(t,e,r,i){var c=t==null?0:t.length;return c?(r&&typeof r!="number"&&xe(t,e,r)&&(r=0,i=c),Id(t,e,r,i)):[]}function v1(t,e,r){var i=t==null?0:t.length;if(!i)return-1;var c=r==null?0:vt(r);return c<0&&(c=ie(i+c,0)),z(t,ot(e,3),c)}function y1(t,e,r){var i=t==null?0:t.length;if(!i)return-1;var c=i-1;return r!==g&&(c=vt(r),c=r<0?ie(i+c,0):he(c,i-1)),z(t,ot(e,3),c,!0)}function m1(t){return t!=null&&t.length?pe(t,1):[]}function T3(t){return t!=null&&t.length?pe(t,rr):[]}function O3(t,e){return t!=null&&t.length?(e=e===g?1:vt(e),pe(t,e)):[]}function D3(t){for(var e=-1,r=t==null?0:t.length,i={};++e<r;){var c=t[e];i[c[0]]=c[1]}return i}function _1(t){return t&&t.length?t[0]:g}function W3(t,e,r){var i=t==null?0:t.length;if(!i)return-1;var c=r==null?0:vt(r);return c<0&&(c=ie(i+c,0)),K(t,e,c)}function V3(t){return t!=null&&t.length?Ge(t,0,-1):[]}function M3(t,e){return t==null?"":j2.call(t,e)}function Xe(t){var e=t==null?0:t.length;return e?t[e-1]:g}function N3(t,e,r){var i=t==null?0:t.length;if(!i)return-1;var c=i;return r!==g&&(c=vt(r),c=c<0?ie(i+c,0):he(c,i-1)),e===e?te(t,e,c):z(t,at,c,!0)}function H3(t,e){return t&&t.length?Ws(t,vt(e)):g}function b1(t,e){return t&&t.length&&e&&e.length?Gi(t,e):t}function B3(t,e,r){return t&&t.length&&e&&e.length?Gi(t,e,ot(r,2)):t}function F3(t,e,r){return t&&t.length&&e&&e.length?Gi(t,e,g,r):t}function Z3(t,e){var r=[];if(!t||!t.length)return r;var i=-1,c=[],f=t.length;for(e=ot(e,3);++i<f;){var v=t[i];e(v,i,t)&&(r.push(v),c.push(i))}return Ns(t,c),r}function fa(t){return t==null?t:O2.call(t)}function U3(t,e,r){var i=t==null?0:t.length;return i?(r&&typeof r!="number"&&xe(t,e,r)?(e=0,r=i):(e=e==null?0:vt(e),r=r===g?i:vt(r)),Ge(t,e,r)):[]}function z3(t,e){return Qo(t,e)}function P3(t,e,r){return Ji(t,e,ot(r,2))}function S3(t,e){var r=t==null?0:t.length;if(r){var i=Qo(t,e);if(i<r&&ir(t[i],e))return i}return-1}function Y3(t,e){return Qo(t,e,!0)}function G3(t,e,r){return Ji(t,e,ot(r,2),!0)}function X3(t,e){if(t!=null&&t.length){var r=Qo(t,e,!0)-1;if(ir(t[r],e))return r}return-1}function K3(t){return t&&t.length?Hs(t):[]}function J3(t,e){return t&&t.length?Hs(t,ot(e,2)):[]}function q3(t){var e=t==null?0:t.length;return e?Ge(t,1,e):[]}function $3(t,e,r){return t&&t.length?(e=r||e===g?1:vt(e),Ge(t,0,e<0?0:e)):[]}function tp(t,e,r){var i=t==null?0:t.length;return i?(e=r||e===g?1:vt(e),e=i-e,Ge(t,e<0?0:e,i)):[]}function ep(t,e){return t&&t.length?wo(t,ot(e,3),!1,!0):[]}function rp(t,e){return t&&t.length?wo(t,ot(e,3)):[]}function np(t){return t&&t.length?Dr(t):[]}function op(t,e){return t&&t.length?Dr(t,ot(e,2)):[]}function ip(t,e){return e=typeof e=="function"?e:g,t&&t.length?Dr(t,g,e):[]}function da(t){if(!t||!t.length)return[];var e=0;return t=d(t,function(r){if(Jt(r))return e=ie(r.length,e),!0}),Ut(e,function(r){return Q(t,J(r))})}function x1(t,e){if(!t||!t.length)return[];var r=da(t);return e==null?r:Q(r,function(i){return a(e,g,i)})}function ap(t,e){return Us(t||[],e||[],Bn)}function up(t,e){return Us(t||[],e||[],zn)}function Q1(t){var e=u(t);return e.__chain__=!0,e}function sp(t,e){return e(t),t}function To(t,e){return e(t)}function cp(){return Q1(this)}function lp(){return new nt(this.value(),this.__chain__)}function fp(){this.__values__===g&&(this.__values__=T1(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?g:this.__values__[this.__index__++]}}function dp(){return this}function pp(t){for(var e,r=this;r instanceof S;){var i=g1(r);i.__index__=0,i.__values__=g,e?c.__wrapped__=i:e=i;var c=i;r=r.__wrapped__}return c.__wrapped__=t,e}function hp(){var t=this.__wrapped__;if(t instanceof G){var e=t;return this.__actions__.length&&(e=new G(this)),e=e.reverse(),e.__actions__.push({func:To,args:[fa],thisArg:g}),new nt(e,this.__chain__)}return this.thru(fa)}function gp(){return Zs(this.__wrapped__,this.__actions__)}function vp(t,e,r){var i=dt(t)?h:jd;return r&&xe(t,e,r)&&(e=g),i(t,ot(e,3))}function yp(t,e){return(dt(t)?d:Ls)(t,ot(e,3))}function mp(t,e){return pe(Oo(t,e),1)}function _p(t,e){return pe(Oo(t,e),rr)}function bp(t,e,r){return r=r===g?1:vt(r),pe(Oo(t,e),r)}function w1(t,e){return(dt(t)?l:Nr)(t,ot(e,3))}function C1(t,e){return(dt(t)?p:X1)(t,ot(e,3))}function xp(t,e,r,i){t=Ie(t)?t:xn(t),r=r&&!i?vt(r):0;var c=t.length;return r<0&&(r=ie(c+r,0)),Mo(t)?r<=c&&t.indexOf(e,r)>-1:!!c&&K(t,e,r)>-1}function Oo(t,e){return(dt(t)?Q:Ts)(t,ot(e,3))}function Qp(t,e,r,i){return t==null?[]:(dt(e)||(e=e==null?[]:[e]),r=i?g:r,dt(r)||(r=r==null?[]:[r]),Vs(t,e,r))}function wp(t,e,r){var i=dt(t)?V:et,c=arguments.length<3;return i(t,ot(e,4),r,c,Nr)}function Cp(t,e,r){var i=dt(t)?N:et,c=arguments.length<3;return i(t,ot(e,4),r,c,X1)}function Ep(t,e){return(dt(t)?d:Ls)(t,Wo(ot(e,3)))}function Ap(t){return(dt(t)?ws:Yd)(t)}function Lp(t,e,r){return e=(r?xe(t,e,r):e===g)?1:vt(e),(dt(t)?Cd:Gd)(t,e)}function kp(t){return(dt(t)?Ed:Xd)(t)}function jp(t){if(t==null)return 0;if(Ie(t))return Mo(t)?Kt(t):t.length;var e=ge(t);return e==Et||e==nr?t.size:Si(t).length}function Ip(t,e,r){var i=dt(t)?O:Kd;return r&&xe(t,e,r)&&(e=g),i(t,ot(e,3))}function Rp(t,e){if(typeof e!="function")throw new Je(Ht);return t=vt(t),function(){if(--t<1)return e.apply(this,arguments)}}function E1(t,e,r){return e=r?g:e,e=t&&e==null?t.length:e,wr(t,Ae,g,g,g,g,e)}function A1(t,e){var r;if(typeof e!="function")throw new Je(Ht);return t=vt(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=g),r}}function L1(t,e,r){e=r?g:e;var i=wr(t,Ce,g,g,g,g,g,e);return i.placeholder=L1.placeholder,i}function k1(t,e,r){e=r?g:e;var i=wr(t,lr,g,g,g,g,g,e);return i.placeholder=k1.placeholder,i}function j1(t,e,r){function i(St){var qe=Z,to=X;return Z=X=g,xt=St,ht=t.apply(to,qe)}function c(St){return xt=St,tt=$n(m,e),ve?i(St):ht}function f(St){var qe=St-bt,to=St-xt,fc=e-qe;return Oe?he(fc,$-to):fc}function v(St){var qe=St-bt,to=St-xt;return bt===g||qe>=e||qe<0||Oe&&to>=$}function m(){var St=qo();return v(St)?w(St):(tt=$n(m,f(St)),g)}function w(St){return tt=g,Br&&Z?i(St):(Z=X=g,ht)}function R(){tt!==g&&q1(tt),xt=0,Z=bt=X=tt=g}function I(){return tt===g?ht:w(qo())}function W(){var St=qo(),qe=v(St);if(Z=arguments,X=this,bt=St,qe){if(tt===g)return c(bt);if(Oe)return q1(tt),tt=$n(m,e),i(bt)}return tt===g&&(tt=$n(m,e)),ht}var Z,X,$,ht,tt,bt,xt=0,ve=!1,Oe=!1,Br=!0;if(typeof t!="function")throw new Je(Ht);return e=Ke(e)||0,Zt(r)&&(ve=!!r.leading,Oe="maxWait"in r,$=Oe?ie(Ke(r.maxWait)||0,e):$,Br="trailing"in r?!!r.trailing:Br),W.cancel=R,W.flush=I,W}function Tp(t){return wr(t,_e)}function Do(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new Je(Ht);var r=function(){var i=arguments,c=e?e.apply(this,i):i[0],f=r.cache;if(f.has(c))return f.get(c);var v=t.apply(this,i);return r.cache=f.set(c,v)||f,v};return r.cache=new(Do.Cache||xr),r}function Wo(t){if(typeof t!="function")throw new Je(Ht);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Op(t){return A1(2,t)}function Dp(t,e){if(typeof t!="function")throw new Je(Ht);return e=e===g?e:vt(e),mt(t,e)}function Wp(t,e){if(typeof t!="function")throw new Je(Ht);return e=e==null?0:ie(vt(e),0),mt(function(r){var i=r[e],c=Vr(r,0,e);return i&&k(c,i),a(t,this,c)})}function Vp(t,e,r){var i=!0,c=!0;if(typeof t!="function")throw new Je(Ht);return Zt(r)&&(i="leading"in r?!!r.leading:i,c="trailing"in r?!!r.trailing:c),j1(t,e,{leading:i,maxWait:e,trailing:c})}function Mp(t){return E1(t,1)}function Np(t,e){return Ta(ea(e),t)}function Hp(){if(!arguments.length)return[];var t=arguments[0];return dt(t)?t:[t]}function Bp(t){return Ye(t,Ve)}function Fp(t,e){return e=typeof e=="function"?e:g,Ye(t,Ve,e)}function Zp(t){return Ye(t,ne|Ve)}function Up(t,e){return e=typeof e=="function"?e:g,Ye(t,ne|Ve,e)}function zp(t,e){return e==null||Es(t,e,ce(e))}function ir(t,e){return t===e||t!==t&&e!==e}function Ie(t){return t!=null&&Vo(t.length)&&!Ar(t)}function Jt(t){return Pt(t)&&Ie(t)}function Pp(t){return t===!0||t===!1||Pt(t)&&be(t)==ft}function Sp(t){return Pt(t)&&t.nodeType===1&&!Yn(t)}function Yp(t){if(t==null)return!0;if(Ie(t)&&(dt(t)||typeof t=="string"||typeof t.splice=="function"||Hr(t)||Ln(t)||en(t)))return!t.length;var e=ge(t);if(e==Et||e==nr)return!t.size;if(Sn(t))return!Si(t).length;for(var r in t)if(kt.call(t,r))return!1;return!0}function Gp(t,e){return Un(t,e)}function Xp(t,e,r){r=typeof r=="function"?r:g;var i=r?r(t,e):g;return i===g?Un(t,e,g,r):!!i}function pa(t){if(!Pt(t))return!1;var e=be(t);return e==gt||e==wt||typeof t.message=="string"&&typeof t.name=="string"&&!Yn(t)}function Kp(t){return typeof t=="number"&&S1(t)}function Ar(t){if(!Zt(t))return!1;var e=be(t);return e==ee||e==Bt||e==rt||e==Pf}function I1(t){return typeof t=="number"&&t==vt(t)}function Vo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ue}function Zt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Pt(t){return t!=null&&typeof t=="object"}function Jp(t,e){return t===e||Pi(t,e,ua(e))}function qp(t,e,r){return r=typeof r=="function"?r:g,Pi(t,e,ua(e),r)}function $p(t){return R1(t)&&t!=+t}function t5(t){if(Z2(t))throw new Qa(zr);return Is(t)}function e5(t){return t===null}function r5(t){return t==null}function R1(t){return typeof t=="number"||Pt(t)&&be(t)==se}function Yn(t){if(!Pt(t)||be(t)!=ze)return!1;var e=Po(t);if(e===null)return!0;var r=kt.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Fo.call(r)==Q2}function n5(t){return I1(t)&&t>=-Ue&&t<=Ue}function Mo(t){return typeof t=="string"||!dt(t)&&Pt(t)&&be(t)==Mn}function Ne(t){return typeof t=="symbol"||Pt(t)&&be(t)==ho}function o5(t){return t===g}function i5(t){return Pt(t)&&ge(t)==Nn}function a5(t){return Pt(t)&&be(t)==Yf}function T1(t){if(!t)return[];if(Ie(t))return Mo(t)?ue(t):je(t);if(Gn&&t[Gn])return q(t[Gn]());var e=ge(t);return(e==Et?B:e==nr?st:xn)(t)}function Lr(t){return t?(t=Ke(t),t===rr||t===-rr?(t<0?-1:1)*hn:t===t?t:0):t===0?t:0}function vt(t){var e=Lr(t),r=e%1;return e===e?r?e-r:e:0}function O1(t){return t?Kr(vt(t),0,Le):0}function Ke(t){if(typeof t=="number")return t;if(Ne(t))return Tr;if(Zt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pt(t);var r=h0.test(t);return r||v0.test(t)?G0(t.slice(2),r?2:8):p0.test(t)?Tr:+t}function D1(t){return pr(t,Re(t))}function u5(t){return t?Kr(vt(t),-Ue,Ue):t===0?t:0}function At(t){return t==null?"":Me(t)}function s5(t,e){var r=An(t);return e==null?r:Cs(r,e)}function c5(t,e){return T(t,ot(e,3),dr)}function l5(t,e){return T(t,ot(e,3),Zi)}function f5(t,e){return t==null?t:La(t,ot(e,3),Re)}function d5(t,e){return t==null?t:K1(t,ot(e,3),Re)}function p5(t,e){return t&&dr(t,ot(e,3))}function h5(t,e){return t&&Zi(t,ot(e,3))}function g5(t){return t==null?[]:bo(t,ce(t))}function v5(t){return t==null?[]:bo(t,Re(t))}function ha(t,e,r){var i=t==null?g:Jr(t,e);return i===g?r:i}function y5(t,e){return t!=null&&u1(t,e,Rd)}function ga(t,e){return t!=null&&u1(t,e,Td)}function ce(t){return Ie(t)?Qs(t):Si(t)}function Re(t){return Ie(t)?Qs(t,!0):Zd(t)}function m5(t,e){var r={};return e=ot(e,3),dr(t,function(i,c,f){Qr(r,e(i,c,f),i)}),r}function _5(t,e){var r={};return e=ot(e,3),dr(t,function(i,c,f){Qr(r,c,e(i,c,f))}),r}function b5(t,e){return W1(t,Wo(ot(e)))}function W1(t,e){if(t==null)return{};var r=Q(aa(t),function(i){return[i]});return e=ot(e),Ms(t,r,function(i,c){return e(i,c[0])})}function x5(t,e,r){e=Wr(e,t);var i=-1,c=e.length;for(c||(c=1,t=g);++i<c;){var f=t==null?g:t[hr(e[i])];f===g&&(i=c,f=r),t=Ar(f)?f.call(t):f}return t}function Q5(t,e,r){return t==null?t:zn(t,e,r)}function w5(t,e,r,i){return i=typeof i=="function"?i:g,t==null?t:zn(t,e,r,i)}function C5(t,e,r){var i=dt(t),c=i||Hr(t)||Ln(t);if(e=ot(e,4),r==null){var f=t&&t.constructor;r=c?i?new f:[]:Zt(t)&&Ar(f)?An(Po(t)):{}}return(c?l:dr)(t,function(v,m,w){return e(r,v,m,w)}),r}function E5(t,e){return t==null||qi(t,e)}function A5(t,e,r){return t==null?t:Fs(t,e,ea(r))}function L5(t,e,r,i){return i=typeof i=="function"?i:g,t==null?t:Fs(t,e,ea(r),i)}function xn(t){return t==null?[]:Ct(t,ce(t))}function k5(t){return t==null?[]:Ct(t,Re(t))}function j5(t,e,r){return r===g&&(r=e,e=g),r!==g&&(r=Ke(r),r=r===r?r:0),e!==g&&(e=Ke(e),e=e===e?e:0),Kr(Ke(t),e,r)}function I5(t,e,r){return e=Lr(e),r===g?(r=e,e=0):r=Lr(r),t=Ke(t),Od(t,e,r)}function R5(t,e,r){if(r&&typeof r!="boolean"&&xe(t,e,r)&&(e=r=g),r===g&&(typeof e=="boolean"?(r=e,e=g):typeof t=="boolean"&&(r=t,t=g)),t===g&&e===g?(t=0,e=1):(t=Lr(t),e===g?(e=t,t=0):e=Lr(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var c=Y1();return he(t+c*(e-t+Y0("1e-"+((c+"").length-1))),e)}return Xi(t,e)}function V1(t){return Da(At(t).toLowerCase())}function M1(t){return t=At(t),t&&t.replace(m0,J0).replace(M0,"")}function T5(t,e,r){t=At(t),e=Me(e);var i=t.length;r=r===g?i:Kr(vt(r),0,i);var c=r;return r-=e.length,r>=0&&t.slice(r,c)==e}function O5(t){return t=At(t),t&&qf.test(t)?t.replace(Yu,q0):t}function D5(t){return t=At(t),t&&o0.test(t)?t.replace(Ii,"\\$&"):t}function W5(t,e,r){t=At(t),e=vt(e);var i=e?Kt(t):0;if(!e||i>=e)return t;var c=(e-i)/2;return Lo(Xo(c),r)+t+Lo(Go(c),r)}function V5(t,e,r){t=At(t),e=vt(e);var i=e?Kt(t):0;return e&&i<e?t+Lo(e-i,r):t}function M5(t,e,r){t=At(t),e=vt(e);var i=e?Kt(t):0;return e&&i<e?Lo(e-i,r)+t:t}function N5(t,e,r){return r||e==null?e=0:e&&(e=+e),T2(At(t).replace(Ri,""),e||0)}function H5(t,e,r){return e=(r?xe(t,e,r):e===g)?1:vt(e),Ki(At(t),e)}function B5(){var t=arguments,e=At(t[0]);return t.length<3?e:e.replace(t[1],t[2])}function F5(t,e,r){return r&&typeof r!="number"&&xe(t,e,r)&&(e=r=g),(r=r===g?Le:r>>>0)?(t=At(t),t&&(typeof e=="string"||e!=null&&!Oa(e))&&(e=Me(e),!e&&Lt(t))?Vr(ue(t),0,r):t.split(e,r)):[]}function Z5(t,e,r){return t=At(t),r=r==null?0:Kr(vt(r),0,t.length),e=Me(e),t.slice(r,r+e.length)==e}function U5(t,e,r){var i=u.templateSettings;r&&xe(t,e,r)&&(e=g),t=At(t),e=$o({},e,i,o1);var c,f,v=$o({},e.imports,i.imports,o1),m=ce(v),w=Ct(v,m),R=0,I=e.interpolate||go,W="__p += '",Z=wa((e.escape||go).source+"|"+I.source+"|"+(I===Gu?d0:go).source+"|"+(e.evaluate||go).source+"|$","g"),X="//# sourceURL="+(kt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Z0+"]")+`
|
|
37
|
+
`;t.replace(Z,function(tt,bt,xt,ve,Oe,Br){return xt||(xt=ve),W+=t.slice(R,Br).replace(_0,Xt),bt&&(c=!0,W+=`' +
|
|
38
|
+
__e(`+bt+`) +
|
|
39
|
+
'`),Oe&&(f=!0,W+=`';
|
|
40
|
+
`+Oe+`;
|
|
41
|
+
__p += '`),xt&&(W+=`' +
|
|
42
|
+
((__t = (`+xt+`)) == null ? '' : __t) +
|
|
43
|
+
'`),R=Br+tt.length,tt}),W+=`';
|
|
44
|
+
`;var $=kt.call(e,"variable")&&e.variable;if($){if(l0.test($))throw new Qa(Rr)}else W=`with (obj) {
|
|
45
|
+
`+W+`
|
|
46
|
+
}
|
|
47
|
+
`;W=(f?W.replace(Gf,""):W).replace(Xf,"$1").replace(Kf,"$1;"),W="function("+($||"obj")+`) {
|
|
48
|
+
`+($?"":`obj || (obj = {});
|
|
49
|
+
`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(f?`, __j = Array.prototype.join;
|
|
50
|
+
function print() { __p += __j.call(arguments, '') }
|
|
51
|
+
`:`;
|
|
52
|
+
`)+W+`return __p
|
|
53
|
+
}`;var ht=lc(function(){return B1(m,X+"return "+W).apply(g,w)});if(ht.source=W,pa(ht))throw ht;return ht}function z5(t){return At(t).toLowerCase()}function P5(t){return At(t).toUpperCase()}function S5(t,e,r){if(t=At(t),t&&(r||e===g))return pt(t);if(!t||!(e=Me(e)))return t;var i=ue(t),c=ue(e);return Vr(i,Mt(i,c),Rt(i,c)+1).join("")}function Y5(t,e,r){if(t=At(t),t&&(r||e===g))return t.slice(0,We(t)+1);if(!t||!(e=Me(e)))return t;var i=ue(t);return Vr(i,0,Rt(i,ue(e))+1).join("")}function G5(t,e,r){if(t=At(t),t&&(r||e===g))return t.replace(Ri,"");if(!t||!(e=Me(e)))return t;var i=ue(t);return Vr(i,Mt(i,ue(e))).join("")}function X5(t,e){var r=Sr,i=dn;if(Zt(e)){var c="separator"in e?e.separator:c;r="length"in e?vt(e.length):r,i="omission"in e?Me(e.omission):i}t=At(t);var f=t.length;if(Lt(t)){var v=ue(t);f=v.length}if(r>=f)return t;var m=r-Kt(i);if(m<1)return i;var w=v?Vr(v,0,m).join(""):t.slice(0,m);if(c===g)return w+i;if(v&&(m+=w.length-m),Oa(c)){if(t.slice(m).search(c)){var R,I=w;for(c.global||(c=wa(c.source,At(Xu.exec(c))+"g")),c.lastIndex=0;R=c.exec(I);)var W=R.index;w=w.slice(0,W===g?m:W)}}else if(t.indexOf(Me(c),m)!=m){var Z=w.lastIndexOf(c);Z>-1&&(w=w.slice(0,Z))}return w+i}function K5(t){return t=At(t),t&&Jf.test(t)?t.replace(Su,$0):t}function N1(t,e,r){return t=At(t),e=r?g:e,e===g?He(t)?ln(t):M(t):t.match(e)||[]}function J5(t){var e=t==null?0:t.length,r=ot();return t=e?Q(t,function(i){if(typeof i[1]!="function")throw new Je(Ht);return[r(i[0]),i[1]]}):[],mt(function(i){for(var c=-1;++c<e;){var f=t[c];if(a(f[0],this,i))return a(f[1],this,i)}})}function q5(t){return kd(Ye(t,ne))}function va(t){return function(){return t}}function $5(t,e){return t==null||t!==t?e:t}function Te(t){return t}function ya(t){return Rs(typeof t=="function"?t:Ye(t,ne))}function t2(t){return Os(Ye(t,ne))}function e2(t,e){return Ds(t,Ye(e,ne))}function ma(t,e,r){var i=ce(e),c=bo(e,i);r!=null||Zt(e)&&(c.length||!i.length)||(r=e,e=t,t=this,c=bo(e,ce(e)));var f=!(Zt(r)&&"chain"in r&&!r.chain),v=Ar(t);return l(c,function(m){var w=e[m];t[m]=w,v&&(t.prototype[m]=function(){var R=this.__chain__;if(f||R){var I=t(this.__wrapped__);return(I.__actions__=je(this.__actions__)).push({func:w,args:arguments,thisArg:t}),I.__chain__=R,I}return w.apply(t,k([this.value()],arguments))})}),t}function r2(){return de._===this&&(de._=w2),this}function _a(){}function n2(t){return t=vt(t),mt(function(e){return Ws(e,t)})}function H1(t){return sa(t)?J(hr(t)):Pd(t)}function o2(t){return function(e){return t==null?g:Jr(t,e)}}function ba(){return[]}function xa(){return!1}function i2(){return{}}function a2(){return""}function u2(){return!0}function s2(t,e){if(t=vt(t),t<1||t>Ue)return[];var r=Le,i=he(t,Le);e=ot(e),t-=Le;for(var c=Ut(i,e);++r<t;)e(r);return c}function c2(t){return dt(t)?Q(t,hr):Ne(t)?[t]:je(ec(At(t)))}function l2(t){var e=++x2;return At(t)+e}function f2(t){return t&&t.length?_o(t,Te,Ui):g}function d2(t,e){return t&&t.length?_o(t,ot(e,2),Ui):g}function p2(t){return H(t,Te)}function h2(t,e){return H(t,ot(e,2))}function g2(t){return t&&t.length?_o(t,Te,Yi):g}function v2(t,e){return t&&t.length?_o(t,ot(e,2),Yi):g}function y2(t){return t&&t.length?It(t,Te):0}function m2(t,e){return t&&t.length?It(t,ot(e,2)):0}j=j==null?de:yn.defaults(de.Object(),j,yn.pick(de,F0));var oe=j.Array,No=j.Date,Qa=j.Error,B1=j.Function,Qn=j.Math,Vt=j.Object,wa=j.RegExp,_2=j.String,Je=j.TypeError,Ho=oe.prototype,b2=B1.prototype,wn=Vt.prototype,Bo=j["__core-js_shared__"],Fo=b2.toString,kt=wn.hasOwnProperty,x2=0,F1=function(){var t=/[^.]+$/.exec(Bo&&Bo.keys&&Bo.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Zo=wn.toString,Q2=Fo.call(Vt),w2=de._,C2=wa("^"+Fo.call(kt).replace(Ii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Uo=gs?j.Buffer:g,Mr=j.Symbol,zo=j.Uint8Array,Z1=Uo?Uo.allocUnsafe:g,Po=U(Vt.getPrototypeOf,Vt),U1=Vt.create,z1=wn.propertyIsEnumerable,So=Ho.splice,P1=Mr?Mr.isConcatSpreadable:g,Gn=Mr?Mr.iterator:g,tn=Mr?Mr.toStringTag:g,Yo=function(){try{var t=qr(Vt,"defineProperty");return t({},"",{}),t}catch(e){}}(),E2=j.clearTimeout!==de.clearTimeout&&j.clearTimeout,A2=No&&No.now!==de.Date.now&&No.now,L2=j.setTimeout!==de.setTimeout&&j.setTimeout,Go=Qn.ceil,Xo=Qn.floor,Ca=Vt.getOwnPropertySymbols,k2=Uo?Uo.isBuffer:g,S1=j.isFinite,j2=Ho.join,I2=U(Vt.keys,Vt),ie=Qn.max,he=Qn.min,R2=No.now,T2=j.parseInt,Y1=Qn.random,O2=Ho.reverse,Ea=qr(j,"DataView"),Xn=qr(j,"Map"),Aa=qr(j,"Promise"),Cn=qr(j,"Set"),Kn=qr(j,"WeakMap"),Jn=qr(Vt,"create"),Ko=Kn&&new Kn,En={},D2=$r(Ea),W2=$r(Xn),V2=$r(Aa),M2=$r(Cn),N2=$r(Kn),Jo=Mr?Mr.prototype:g,qn=Jo?Jo.valueOf:g,G1=Jo?Jo.toString:g,An=function(){function t(){}return function(e){if(!Zt(e))return{};if(U1)return U1(e);t.prototype=e;var r=new t;return t.prototype=g,r}}();u.templateSettings={escape:$f,evaluate:t0,interpolate:Gu,variable:"",imports:{_:u}},u.prototype=S.prototype,u.prototype.constructor=u,nt.prototype=An(S.prototype),nt.prototype.constructor=nt,G.prototype=An(S.prototype),G.prototype.constructor=G,Gr.prototype.clear=rd,Gr.prototype.delete=nd,Gr.prototype.get=od,Gr.prototype.has=id,Gr.prototype.set=ad,br.prototype.clear=ud,br.prototype.delete=sd,br.prototype.get=cd,br.prototype.has=ld,br.prototype.set=fd,xr.prototype.clear=dd,xr.prototype.delete=pd,xr.prototype.get=hd,xr.prototype.has=gd,xr.prototype.set=vd,Xr.prototype.add=Xr.prototype.push=yd,Xr.prototype.has=md,or.prototype.clear=_d,or.prototype.delete=bd,or.prototype.get=xd,or.prototype.has=Qd,or.prototype.set=wd;var Nr=Xs(dr),X1=Xs(Zi,!0),La=Ks(),K1=Ks(!0),J1=Ko?function(t,e){return Ko.set(t,e),t}:Te,H2=Yo?function(t,e){return Yo(t,"toString",{configurable:!0,enumerable:!1,value:va(e),writable:!0})}:Te,B2=mt,q1=E2||function(t){return de.clearTimeout(t)},F2=Cn&&1/st(new Cn([,-0]))[1]==rr?function(t){return new Cn(t)}:_a,ka=Ko?function(t){return Ko.get(t)}:_a,ja=Ca?function(t){return t==null?[]:(t=Vt(t),d(Ca(t),function(e){return z1.call(t,e)}))}:ba,$1=Ca?function(t){for(var e=[];t;)k(e,ja(t)),t=Po(t);return e}:ba,ge=be;(Ea&&ge(new Ea(new ArrayBuffer(1)))!=gn||Xn&&ge(new Xn)!=Et||Aa&&ge(Aa.resolve())!=Pe||Cn&&ge(new Cn)!=nr||Kn&&ge(new Kn)!=Nn)&&(ge=function(t){var e=be(t),r=e==ze?t.constructor:g,i=r?$r(r):"";if(i)switch(i){case D2:return gn;case W2:return Et;case V2:return Pe;case M2:return nr;case N2:return Nn}return e});var Z2=Bo?Ar:xa,tc=h1(J1),$n=L2||function(t,e){return de.setTimeout(t,e)},Ia=h1(H2),ec=m3(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(n0,function(r,i,c,f){e.push(c?f.replace(f0,"$1"):i||r)}),e}),U2=mt(function(t,e){return Jt(t)?Fn(t,pe(e,1,Jt,!0)):[]}),z2=mt(function(t,e){var r=Xe(e);return Jt(r)&&(r=g),Jt(t)?Fn(t,pe(e,1,Jt,!0),ot(r,2)):[]}),P2=mt(function(t,e){var r=Xe(e);return Jt(r)&&(r=g),Jt(t)?Fn(t,pe(e,1,Jt,!0),g,r):[]}),S2=mt(function(t){var e=Q(t,ta);return e.length&&e[0]===t[0]?zi(e):[]}),Y2=mt(function(t){var e=Xe(t),r=Q(t,ta);return e===Xe(r)?e=g:r.pop(),r.length&&r[0]===t[0]?zi(r,ot(e,2)):[]}),G2=mt(function(t){var e=Xe(t),r=Q(t,ta);return e=typeof e=="function"?e:g,e&&r.pop(),r.length&&r[0]===t[0]?zi(r,g,e):[]}),X2=mt(b1),K2=Cr(function(t,e){var r=t==null?0:t.length,i=Fi(t,e);return Ns(t,Q(e,function(c){return Er(c,r)?+c:c}).sort(Ss)),i}),J2=mt(function(t){return Dr(pe(t,1,Jt,!0))}),q2=mt(function(t){var e=Xe(t);return Jt(e)&&(e=g),Dr(pe(t,1,Jt,!0),ot(e,2))}),$2=mt(function(t){var e=Xe(t);return e=typeof e=="function"?e:g,Dr(pe(t,1,Jt,!0),g,e)}),t7=mt(function(t,e){return Jt(t)?Fn(t,e):[]}),e7=mt(function(t){return $i(d(t,Jt))}),r7=mt(function(t){var e=Xe(t);return Jt(e)&&(e=g),$i(d(t,Jt),ot(e,2))}),n7=mt(function(t){var e=Xe(t);return e=typeof e=="function"?e:g,$i(d(t,Jt),g,e)}),o7=mt(da),i7=mt(function(t){var e=t.length,r=e>1?t[e-1]:g;return r=typeof r=="function"?(t.pop(),r):g,x1(t,r)}),a7=Cr(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,c=function(f){return Fi(f,t)};return!(e>1||this.__actions__.length)&&i instanceof G&&Er(r)?(i=i.slice(r,+r+(e?1:0)),i.__actions__.push({func:To,args:[c],thisArg:g}),new nt(i,this.__chain__).thru(function(f){return e&&!f.length&&f.push(g),f})):this.thru(c)}),u7=Co(function(t,e,r){kt.call(t,r)?++t[r]:Qr(t,r,1)}),s7=qs(v1),c7=qs(y1),l7=Co(function(t,e,r){kt.call(t,r)?t[r].push(e):Qr(t,r,[e])}),f7=mt(function(t,e,r){var i=-1,c=typeof e=="function",f=Ie(t)?oe(t.length):[];return Nr(t,function(v){f[++i]=c?a(e,v,r):Zn(v,e,r)}),f}),d7=Co(function(t,e,r){Qr(t,r,e)}),p7=Co(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),h7=mt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&xe(t,e[0],e[1])?e=[]:r>2&&xe(e[0],e[1],e[2])&&(e=[e[0]]),Vs(t,pe(e,1),[])}),qo=A2||function(){return de.Date.now()},Ra=mt(function(t,e,r){var i=fe;if(r.length){var c=P(r,bn(Ra));i|=Ee}return wr(t,i,e,r,c)}),rc=mt(function(t,e,r){var i=fe|er;if(r.length){var c=P(r,bn(rc));i|=Ee}return wr(e,i,t,r,c)}),g7=mt(function(t,e){return As(t,1,e)}),v7=mt(function(t,e,r){return As(t,Ke(e)||0,r)});Do.Cache=xr;var y7=B2(function(t,e){e=e.length==1&&dt(e[0])?Q(e[0],lt(ot())):Q(pe(e,1),lt(ot()));var r=e.length;return mt(function(i){for(var c=-1,f=he(i.length,r);++c<f;)i[c]=e[c].call(this,i[c]);return a(t,this,i)})}),Ta=mt(function(t,e){return wr(t,Ee,g,e,P(e,bn(Ta)))}),nc=mt(function(t,e){return wr(t,Fe,g,e,P(e,bn(nc)))}),m7=Cr(function(t,e){return wr(t,zt,g,g,g,e)}),_7=ko(Ui),b7=ko(function(t,e){return t>=e}),en=js(function(){return arguments}())?js:function(t){return Pt(t)&&kt.call(t,"callee")&&!z1.call(t,"callee")},dt=oe.isArray,x7=vs?lt(vs):Wd,Hr=k2||xa,Q7=ys?lt(ys):Vd,oc=ms?lt(ms):Nd,Oa=_s?lt(_s):Hd,ic=bs?lt(bs):Bd,Ln=xs?lt(xs):Fd,w7=ko(Yi),C7=ko(function(t,e){return t<=e}),E7=mn(function(t,e){if(Sn(e)||Ie(e))return pr(e,ce(e),t),g;for(var r in e)kt.call(e,r)&&Bn(t,r,e[r])}),ac=mn(function(t,e){pr(e,Re(e),t)}),$o=mn(function(t,e,r,i){pr(e,Re(e),t,i)}),A7=mn(function(t,e,r,i){pr(e,ce(e),t,i)}),L7=Cr(Fi),k7=mt(function(t,e){t=Vt(t);var r=-1,i=e.length,c=i>2?e[2]:g;for(c&&xe(e[0],e[1],c)&&(i=1);++r<i;)for(var f=e[r],v=Re(f),m=-1,w=v.length;++m<w;){var R=v[m],I=t[R];(I===g||ir(I,wn[R])&&!kt.call(t,R))&&(t[R]=f[R])}return t}),j7=mt(function(t){return t.push(g,i1),a(uc,g,t)}),I7=t1(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=Zo.call(e)),t[e]=r},va(Te)),R7=t1(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=Zo.call(e)),kt.call(t,e)?t[e].push(r):t[e]=[r]},ot),T7=mt(Zn),O7=mn(function(t,e,r){xo(t,e,r)}),uc=mn(function(t,e,r,i){xo(t,e,r,i)}),D7=Cr(function(t,e){var r={};if(t==null)return r;var i=!1;e=Q(e,function(f){return f=Wr(f,t),i||(i=f.length>1),f}),pr(t,aa(t),r),i&&(r=Ye(r,ne|mr|Ve,a3));for(var c=e.length;c--;)qi(r,e[c]);return r}),W7=Cr(function(t,e){return t==null?{}:zd(t,e)}),sc=n1(ce),cc=n1(Re),V7=_n(function(t,e,r){return e=e.toLowerCase(),t+(r?V1(e):e)}),M7=_n(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),N7=_n(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),H7=Js("toLowerCase"),B7=_n(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),F7=_n(function(t,e,r){return t+(r?" ":"")+Da(e)}),Z7=_n(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Da=Js("toUpperCase"),lc=mt(function(t,e){try{return a(t,g,e)}catch(r){return pa(r)?r:new Qa(r)}}),U7=Cr(function(t,e){return l(e,function(r){r=hr(r),Qr(t,r,Ra(t[r],t))}),t}),z7=$s(),P7=$s(!0),S7=mt(function(t,e){return function(r){return Zn(r,t,e)}}),Y7=mt(function(t,e){return function(r){return Zn(t,r,e)}}),G7=na(Q),X7=na(h),K7=na(O),J7=e1(),q7=e1(!0),$7=Ao(function(t,e){return t+e},0),th=oa("ceil"),eh=Ao(function(t,e){return t/e},1),rh=oa("floor"),nh=Ao(function(t,e){return t*e},1),oh=oa("round"),ih=Ao(function(t,e){return t-e},0);return u.after=Rp,u.ary=E1,u.assign=E7,u.assignIn=ac,u.assignInWith=$o,u.assignWith=A7,u.at=L7,u.before=A1,u.bind=Ra,u.bindAll=U7,u.bindKey=rc,u.castArray=Hp,u.chain=Q1,u.chunk=C3,u.compact=E3,u.concat=A3,u.cond=J5,u.conforms=q5,u.constant=va,u.countBy=u7,u.create=s5,u.curry=L1,u.curryRight=k1,u.debounce=j1,u.defaults=k7,u.defaultsDeep=j7,u.defer=g7,u.delay=v7,u.difference=U2,u.differenceBy=z2,u.differenceWith=P2,u.drop=L3,u.dropRight=k3,u.dropRightWhile=j3,u.dropWhile=I3,u.fill=R3,u.filter=yp,u.flatMap=mp,u.flatMapDeep=_p,u.flatMapDepth=bp,u.flatten=m1,u.flattenDeep=T3,u.flattenDepth=O3,u.flip=Tp,u.flow=z7,u.flowRight=P7,u.fromPairs=D3,u.functions=g5,u.functionsIn=v5,u.groupBy=l7,u.initial=V3,u.intersection=S2,u.intersectionBy=Y2,u.intersectionWith=G2,u.invert=I7,u.invertBy=R7,u.invokeMap=f7,u.iteratee=ya,u.keyBy=d7,u.keys=ce,u.keysIn=Re,u.map=Oo,u.mapKeys=m5,u.mapValues=_5,u.matches=t2,u.matchesProperty=e2,u.memoize=Do,u.merge=O7,u.mergeWith=uc,u.method=S7,u.methodOf=Y7,u.mixin=ma,u.negate=Wo,u.nthArg=n2,u.omit=D7,u.omitBy=b5,u.once=Op,u.orderBy=Qp,u.over=G7,u.overArgs=y7,u.overEvery=X7,u.overSome=K7,u.partial=Ta,u.partialRight=nc,u.partition=p7,u.pick=W7,u.pickBy=W1,u.property=H1,u.propertyOf=o2,u.pull=X2,u.pullAll=b1,u.pullAllBy=B3,u.pullAllWith=F3,u.pullAt=K2,u.range=J7,u.rangeRight=q7,u.rearg=m7,u.reject=Ep,u.remove=Z3,u.rest=Dp,u.reverse=fa,u.sampleSize=Lp,u.set=Q5,u.setWith=w5,u.shuffle=kp,u.slice=U3,u.sortBy=h7,u.sortedUniq=K3,u.sortedUniqBy=J3,u.split=F5,u.spread=Wp,u.tail=q3,u.take=$3,u.takeRight=tp,u.takeRightWhile=ep,u.takeWhile=rp,u.tap=sp,u.throttle=Vp,u.thru=To,u.toArray=T1,u.toPairs=sc,u.toPairsIn=cc,u.toPath=c2,u.toPlainObject=D1,u.transform=C5,u.unary=Mp,u.union=J2,u.unionBy=q2,u.unionWith=$2,u.uniq=np,u.uniqBy=op,u.uniqWith=ip,u.unset=E5,u.unzip=da,u.unzipWith=x1,u.update=A5,u.updateWith=L5,u.values=xn,u.valuesIn=k5,u.without=t7,u.words=N1,u.wrap=Np,u.xor=e7,u.xorBy=r7,u.xorWith=n7,u.zip=o7,u.zipObject=ap,u.zipObjectDeep=up,u.zipWith=i7,u.entries=sc,u.entriesIn=cc,u.extend=ac,u.extendWith=$o,ma(u,u),u.add=$7,u.attempt=lc,u.camelCase=V7,u.capitalize=V1,u.ceil=th,u.clamp=j5,u.clone=Bp,u.cloneDeep=Zp,u.cloneDeepWith=Up,u.cloneWith=Fp,u.conformsTo=zp,u.deburr=M1,u.defaultTo=$5,u.divide=eh,u.endsWith=T5,u.eq=ir,u.escape=O5,u.escapeRegExp=D5,u.every=vp,u.find=s7,u.findIndex=v1,u.findKey=c5,u.findLast=c7,u.findLastIndex=y1,u.findLastKey=l5,u.floor=rh,u.forEach=w1,u.forEachRight=C1,u.forIn=f5,u.forInRight=d5,u.forOwn=p5,u.forOwnRight=h5,u.get=ha,u.gt=_7,u.gte=b7,u.has=y5,u.hasIn=ga,u.head=_1,u.identity=Te,u.includes=xp,u.indexOf=W3,u.inRange=I5,u.invoke=T7,u.isArguments=en,u.isArray=dt,u.isArrayBuffer=x7,u.isArrayLike=Ie,u.isArrayLikeObject=Jt,u.isBoolean=Pp,u.isBuffer=Hr,u.isDate=Q7,u.isElement=Sp,u.isEmpty=Yp,u.isEqual=Gp,u.isEqualWith=Xp,u.isError=pa,u.isFinite=Kp,u.isFunction=Ar,u.isInteger=I1,u.isLength=Vo,u.isMap=oc,u.isMatch=Jp,u.isMatchWith=qp,u.isNaN=$p,u.isNative=t5,u.isNil=r5,u.isNull=e5,u.isNumber=R1,u.isObject=Zt,u.isObjectLike=Pt,u.isPlainObject=Yn,u.isRegExp=Oa,u.isSafeInteger=n5,u.isSet=ic,u.isString=Mo,u.isSymbol=Ne,u.isTypedArray=Ln,u.isUndefined=o5,u.isWeakMap=i5,u.isWeakSet=a5,u.join=M3,u.kebabCase=M7,u.last=Xe,u.lastIndexOf=N3,u.lowerCase=N7,u.lowerFirst=H7,u.lt=w7,u.lte=C7,u.max=f2,u.maxBy=d2,u.mean=p2,u.meanBy=h2,u.min=g2,u.minBy=v2,u.stubArray=ba,u.stubFalse=xa,u.stubObject=i2,u.stubString=a2,u.stubTrue=u2,u.multiply=nh,u.nth=H3,u.noConflict=r2,u.noop=_a,u.now=qo,u.pad=W5,u.padEnd=V5,u.padStart=M5,u.parseInt=N5,u.random=R5,u.reduce=wp,u.reduceRight=Cp,u.repeat=H5,u.replace=B5,u.result=x5,u.round=oh,u.runInContext=b,u.sample=Ap,u.size=jp,u.snakeCase=B7,u.some=Ip,u.sortedIndex=z3,u.sortedIndexBy=P3,u.sortedIndexOf=S3,u.sortedLastIndex=Y3,u.sortedLastIndexBy=G3,u.sortedLastIndexOf=X3,u.startCase=F7,u.startsWith=Z5,u.subtract=ih,u.sum=y2,u.sumBy=m2,u.template=U5,u.times=s2,u.toFinite=Lr,u.toInteger=vt,u.toLength=O1,u.toLower=z5,u.toNumber=Ke,u.toSafeInteger=u5,u.toString=At,u.toUpper=P5,u.trim=S5,u.trimEnd=Y5,u.trimStart=G5,u.truncate=X5,u.unescape=K5,u.uniqueId=l2,u.upperCase=Z7,u.upperFirst=Da,u.each=w1,u.eachRight=C1,u.first=_1,ma(u,function(){var t={};return dr(u,function(e,r){kt.call(u.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),u.VERSION=Tn,l(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){u[t].placeholder=u}),l(["drop","take"],function(t,e){G.prototype[t]=function(r){r=r===g?1:ie(vt(r),0);var i=this.__filtered__&&!e?new G(this):this.clone();return i.__filtered__?i.__takeCount__=he(r,i.__takeCount__):i.__views__.push({size:he(r,Le),type:t+(i.__dir__<0?"Right":"")}),i},G.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),l(["filter","map","takeWhile"],function(t,e){var r=e+1,i=r==Ze||r==fr;G.prototype[t]=function(c){var f=this.clone();return f.__iteratees__.push({iteratee:ot(c,3),type:r}),f.__filtered__=f.__filtered__||i,f}}),l(["head","last"],function(t,e){var r="take"+(e?"Right":"");G.prototype[t]=function(){return this[r](1).value()[0]}}),l(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");G.prototype[t]=function(){return this.__filtered__?new G(this):this[r](1)}}),G.prototype.compact=function(){return this.filter(Te)},G.prototype.find=function(t){return this.filter(t).head()},G.prototype.findLast=function(t){return this.reverse().find(t)},G.prototype.invokeMap=mt(function(t,e){return typeof t=="function"?new G(this):this.map(function(r){return Zn(r,t,e)})}),G.prototype.reject=function(t){return this.filter(Wo(ot(t)))},G.prototype.slice=function(t,e){t=vt(t);var r=this;return r.__filtered__&&(t>0||e<0)?new G(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==g&&(e=vt(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},G.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},G.prototype.toArray=function(){return this.take(Le)},dr(G.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),c=u[i?"take"+(e=="last"?"Right":""):e],f=i||/^find/.test(e);c&&(u.prototype[e]=function(){var v=this.__wrapped__,m=i?[1]:arguments,w=v instanceof G,R=m[0],I=w||dt(v),W=function(bt){var xt=c.apply(u,k([bt],m));return i&&Z?xt[0]:xt};I&&r&&typeof R=="function"&&R.length!=1&&(w=I=!1);var Z=this.__chain__,X=!!this.__actions__.length,$=f&&!Z,ht=w&&!X;if(!f&&I){v=ht?v:new G(this);var tt=t.apply(v,m);return tt.__actions__.push({func:To,args:[W],thisArg:g}),new nt(tt,Z)}return $&&ht?t.apply(this,m):(tt=this.thru(W),$?i?tt.value()[0]:tt.value():tt)})}),l(["pop","push","shift","sort","splice","unshift"],function(t){var e=Ho[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);u.prototype[t]=function(){var c=arguments;if(i&&!this.__chain__){var f=this.value();return e.apply(dt(f)?f:[],c)}return this[r](function(v){return e.apply(dt(v)?v:[],c)})}}),dr(G.prototype,function(t,e){var r=u[e];if(r){var i=r.name+"";kt.call(En,i)||(En[i]=[]),En[i].push({name:e,func:r})}}),En[Eo(g,er).name]=[{name:"wrapper",func:g}],G.prototype.clone=ke,G.prototype.reverse=Hi,G.prototype.value=ed,u.prototype.at=a7,u.prototype.chain=cp,u.prototype.commit=lp,u.prototype.next=fp,u.prototype.plant=pp,u.prototype.reverse=hp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=gp,u.prototype.first=u.prototype.head,Gn&&(u.prototype[Gn]=dp),u},yn=td();Yr?((Yr.exports=yn)._=yn,Mi._=yn):de._=yn}).call(jt)}(ro,ro.exports);var _c=ro.exports,Ua={};(function(n){n.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},n.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},n.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},n.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},n.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},n.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},n.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},n.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},n.realToAlias=function(){var o=Object.prototype.hasOwnProperty,a=n.aliasToReal,s={};for(var l in a){var p=a[l];o.call(s,p)?s[p].push(l):s[p]=[l]}return s}(),n.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},n.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},n.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(Ua);var bc={},re=Ua,xc=bc,za=Array.prototype.push;function Qc(n,o){return o==2?function(a,s){return n.apply(void 0,arguments)}:function(a){return n.apply(void 0,arguments)}}function oi(n,o){return o==2?function(a,s){return n(a,s)}:function(a){return n(a)}}function Pa(n){for(var o=n?n.length:0,a=Array(o);o--;)a[o]=n[o];return a}function wc(n){return function(o){return n({},o)}}function Cc(n,o){return function(){for(var a=arguments.length,s=a-1,l=Array(a);a--;)l[a]=arguments[a];var p=l[o],h=l.slice(0,o);return p&&za.apply(h,p),o!=s&&za.apply(h,l.slice(o+1)),n.apply(this,h)}}function ii(n,o){return function(){var a=arguments.length;if(a){for(var s=Array(a);a--;)s[a]=arguments[a];var l=s[0]=o.apply(void 0,s);return n.apply(void 0,s),l}}}function ai(n,o,a,s){var l=typeof o=="function",p=o===Object(o);if(p&&(s=a,a=o,o=void 0),a==null)throw new TypeError;s||(s={});var h={cap:"cap"in s?s.cap:!0,curry:"curry"in s?s.curry:!0,fixed:"fixed"in s?s.fixed:!0,immutable:"immutable"in s?s.immutable:!0,rearg:"rearg"in s?s.rearg:!0},d=l?a:xc,x="curry"in s&&s.curry,L="fixed"in s&&s.fixed,Q="rearg"in s&&s.rearg,k=l?a.runInContext():void 0,V=l?a:{ary:n.ary,assign:n.assign,clone:n.clone,curry:n.curry,forEach:n.forEach,isArray:n.isArray,isError:n.isError,isFunction:n.isFunction,isWeakMap:n.isWeakMap,iteratee:n.iteratee,keys:n.keys,rearg:n.rearg,toInteger:n.toInteger,toPath:n.toPath},N=V.ary,O=V.assign,Y=V.clone,M=V.curry,T=V.forEach,z=V.isArray,K=V.isError,ct=V.isFunction,at=V.isWeakMap,H=V.keys,J=V.rearg,F=V.toInteger,et=V.toPath,yt=H(re.aryMethod),It={castArray:function(q){return function(){var B=arguments[0];return z(B)?q(Pa(B)):q.apply(void 0,arguments)}},iteratee:function(q){return function(){var B=arguments[0],U=arguments[1],P=q(B,U),st=P.length;return h.cap&&typeof U=="number"?(U=U>2?U-2:1,st&&st<=U?P:oi(P,U)):P}},mixin:function(q){return function(B){var U=this;if(!ct(U))return q(U,Object(B));var P=[];return T(H(B),function(st){ct(B[st])&&P.push([st,U.prototype[st]])}),q(U,Object(B)),T(P,function(st){var Nt=st[1];ct(Nt)?U.prototype[st[0]]=Nt:delete U.prototype[st[0]]}),U}},nthArg:function(q){return function(B){var U=B<0?1:F(B)+1;return M(q(B),U)}},rearg:function(q){return function(B,U){var P=U?U.length:0;return M(q(B,U),P)}},runInContext:function(q){return function(B){return ai(n,q(B),s)}}};function Ut(q,B){if(h.cap){var U=re.iterateeRearg[q];if(U)return Ot(B,U);var P=!l&&re.iterateeAry[q];if(P)return Rt(B,P)}return B}function ut(q,B,U){return x||h.curry&&U>1?M(B,U):B}function pt(q,B,U){if(h.fixed&&(L||!re.skipFixed[q])){var P=re.methodSpread[q],st=P&&P.start;return st===void 0?N(B,U):Cc(B,st)}return B}function lt(q,B,U){return h.rearg&&U>1&&(Q||!re.skipRearg[q])?J(B,re.methodRearg[q]||re.aryRearg[U]):B}function Ct(q,B){B=et(B);for(var U=-1,P=B.length,st=P-1,Nt=Y(Object(q)),$t=Nt;$t!=null&&++U<P;){var te=B[U],Kt=$t[te];Kt!=null&&!(ct(Kt)||K(Kt)||at(Kt))&&($t[te]=Y(U==st?Kt:Object(Kt))),$t=$t[te]}return Nt}function Tt(q){return Lt.runInContext.convert(q)(void 0)}function Mt(q,B){var U=re.aliasToReal[q]||q,P=re.remap[U]||U,st=s;return function(Nt){var $t=l?k:V,te=l?k[P]:B,Kt=O(O({},st),Nt);return ai($t,U,te,Kt)}}function Rt(q,B){return Xt(q,function(U){return typeof U=="function"?oi(U,B):U})}function Ot(q,B){return Xt(q,function(U){var P=B.length;return Qc(J(oi(U,P),B),P)})}function Xt(q,B){return function(){var U=arguments.length;if(!U)return q();for(var P=Array(U);U--;)P[U]=arguments[U];var st=h.rearg?0:U-1;return P[st]=B(P[st]),q.apply(void 0,P)}}function $e(q,B,U){var P,st=re.aliasToReal[q]||q,Nt=B,$t=It[st];return $t?Nt=$t(B):h.immutable&&(re.mutate.array[st]?Nt=ii(B,Pa):re.mutate.object[st]?Nt=ii(B,wc(B)):re.mutate.set[st]&&(Nt=ii(B,Ct))),T(yt,function(te){return T(re.aryMethod[te],function(Kt){if(st==Kt){var ue=re.methodSpread[st],We=ue&&ue.afterRearg;return P=We?pt(st,lt(st,Nt,te),te):lt(st,pt(st,Nt,te),te),P=Ut(st,P),P=ut(st,P,te),!1}}),!P}),P||(P=Nt),P==B&&(P=x?M(P,1):function(){return B.apply(this,arguments)}),P.convert=Mt(st,B),P.placeholder=B.placeholder=U,P}if(!p)return $e(o,a,d);var Lt=a,He=[];return T(yt,function(q){T(re.aryMethod[q],function(B){var U=Lt[re.remap[B]||B];U&&He.push([B,$e(B,U,Lt)])})}),T(H(Lt),function(q){var B=Lt[q];if(typeof B=="function"){for(var U=He.length;U--;)if(He[U][0]==q)return;B.convert=Mt(q,B),He.push([q,B])}}),T(He,function(q){Lt[q[0]]=q[1]}),Lt.convert=Tt,Lt.placeholder=Lt,T(H(Lt),function(q){T(re.realToAlias[q]||[],function(B){Lt[B]=Lt[q]})}),Lt}var Ec=ai,Sa=_c.runInContext(),Ac=Ec(Sa,Sa);const C=Yt(Ac),Lc=/(<([^>]+)>)/gi,kc=/<(\/)?div(\/?\s?)>/gi,jc=n=>n.map(o=>`<div>${o===""?"<br/>":o}</div>`).join(""),Ic=n=>{const o=document.createElement("textarea");return o.innerHTML=n,o.value},Rc=n=>C.flow(o=>Ic(o),o=>o.split("<div>"),C.flatMap(o=>{const a=o.replaceAll(kc,"");return a===""?void 0:a.replaceAll(Lc,"")}),C.reject(C.isUndefined))(n),Ya=n=>n*180/Math.PI,no=(n,o)=>o[0]>=n.x&&o[0]<=n.x+n.width&&o[1]>=n.y&&o[1]<=n.y+n.height,rn=({origin:n=[0,0],point:o,rotation:a})=>{const s=[o[0]-n[0],o[1]-n[1]],l=s[1]*Math.cos(a)-s[0]*Math.sin(a);return[s[1]*Math.sin(a)+s[0]*Math.cos(a)+n[0],l+n[1]]},Ga=(n,o,a=!0)=>{const s=Math.atan2(o[1]-n[1],o[0]-n[0]);return a?s:Ya(s)},oo=(n,o,a,s,l=1)=>{var x;const{clientX:p,clientY:h}=C.getOr(C.getOr(n,"changedTouches[0]",n),"touches[0]",n),d=(x=o==null?void 0:o.getBoundingClientRect())!=null?x:{left:0,top:0,width:a,height:s};return[(p-d.left)*(a/d.width)/l,(h-d.top)*(s/d.height)/l]},nn=(n,o,[a,s],[l,p])=>rn({origin:[a-l,s-p],point:n,rotation:o}),ui=(n,o,[a,s],[l,p])=>rn({origin:[a-l,s-p],point:n,rotation:-o}),io=(n,o,a,s,l=1,p=!1)=>{if(n.locked)return!1;const h=Math.min(1,l),{borders:d,center:x}=qt(n,s),L=nn(o,n.rotation,x,a);if(p)if(n.type==="line"||n.type==="polygon"||n.type==="curve"){for(let Q=0;Q<n.points.length;Q++)if(no({x:n.points[Q][0]-Gt/2/h,y:n.points[Q][1]-Gt/2/h,width:Gt/h,height:Gt/h},L))return{mode:"resize",anchor:Q}}else{if(no({x:d.x+d.width/2-Gt/2/h,y:d.y-Gt/h-ri/h,width:Gt/h,height:Gt/h},L))return{mode:"rotate"};for(const Q of Na)if(no({x:d.x+d.width*Q[0]-Gt/2/h,y:d.y+d.height*Q[1]-Gt/2/h,width:Gt/h,height:Gt/h},L))return{mode:"resize",anchor:Q}}return no(d,L)?{mode:"translate"}:!1},Tc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),x:o[0],y:o[1],width:1,height:1,rotation:0,style:{globalAlpha:n.settings.opacity.default,fillColor:n.settings.fillColor.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default}}),ao=(n,o)=>{var a,s;ur(n,o.style),n.globalAlpha!==0&&(n.beginPath(),n.rect(o.x,o.y,o.width,o.height),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke())},Xa=(n,o)=>({x:n.x-o,width:n.width+o*2,y:n.y-o,height:n.height+o*2}),on=(n,o,a,s,[l,p]=[!1,!1])=>{const h=n[0]===.5?a.x+a.width/2:n[0]===0?a.x+(l?0:a.width):a.x+(l?a.width:0),d=n[1]===.5?a.y+a.height/2:n[1]===0?a.y+(p?0:a.height):a.y+(p?a.height:0);return ui([h,d],a.rotation,o,s)},si=(n,o,a,s,l,p=!1)=>{const{center:h,borders:d}=qt(a,l),x=nn(n,a.rotation,h,o),L=s.anchor[0]===.5?a.width:s.anchor[0]===0?d.x+d.width-x[0]+l*-2:x[0]-d.x-l*2,Q=s.anchor[1]===.5?a.height:s.anchor[1]===0?d.y+d.height-x[1]+l*-2:x[1]-d.y-l*2,[k,V]=p?ci(a.width,a.height,L,Q):[L,Q],N=_t(it({},a),{width:Math.abs(k),height:Math.abs(V)}),{center:O}=qt(N,l),[Y,M]=on(s.anchor,h,a,o),[T,z]=on(s.anchor,O,N,o,[k<0,V<0]);return _t(it({},N),{x:N.x-(T-Y),y:N.y-(z-M)})},Oc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),points:[[o]],rotation:0,style:{globalAlpha:n.settings.opacity.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default}}),Dc=(n,o)=>{var a;o.points.length<1||(ur(n,o.style),n.beginPath(),!(((a=o.style)==null?void 0:a.strokeColor)==="transparent"||n.globalAlpha===0)&&(o.points.forEach(s=>{s.length===1?n.rect(s[0][0],s[0][1],1,1):(n.moveTo(...s[0]),s.slice(1).forEach(l=>{n.lineTo(...l)}))}),n.stroke()))},Wc=(n,o)=>{const a=C.flatMap(d=>d,n.points),s=C.flow(C.map(d=>d[0]),C.min,C.add(-o))(a),l=C.flow(C.map(d=>d[0]),C.max,C.add(o))(a),p=C.flow(C.map(d=>d[1]),C.min,C.add(-o))(a),h=C.flow(C.map(d=>d[1]),C.max,C.add(o))(a);return{x:s,width:l-s,y:p,height:h-p}},Vc=(n,o,a,s,l,p)=>{const{center:h,borders:d}=qt(a,l),x=nn(n,a.rotation,h,o),L=s.anchor[0]===.5?1:s.anchor[0]===0?(d.x+d.width-x[0]+l*-2)/(d.width+l*-2):(x[0]-d.x-l*2)/(d.width-l*2),Q=s.anchor[1]===.5?1:s.anchor[1]===0?(d.y+d.height-x[1]+l*-2)/(d.height+l*-2):(x[1]-d.y-l*2)/(d.height-l*2),[k,V]=p?ci(1,1,L,Q):[L,Q],N=_t(it({},a),{points:a.points.map(ct=>ct.map(at=>[(at[0]-d.x)*k+d.x,(at[1]-d.y)*V+d.y]))}),{center:O,borders:Y}=qt(N,l),[M,T]=on(s.anchor,h,it(it({},a),d),o),[z,K]=on(s.anchor,O,it(it({},N),Y),o,[k<0,V<0]);return _t(it({},N),{points:N.points.map(ct=>ct.map(([at,H])=>[at-(z-M),H-(K-T)]))})},Mc=(n,o)=>_t(it({},n),{points:C.set(n.points.length-1,[...n.points[n.points.length-1],[Math.round(o[0]),Math.round(o[1])]],n.points)}),Nc=(n,o)=>_t(it({},n),{points:C.set(n.points.length,[[Math.round(o[0]),Math.round(o[1])]],n.points)}),Ir=300,ci=(n,o,a,s)=>{const l=n/o,p=a/s;return p>l||s<0?a>n?[a,a/l]:[s*l,s]:p<l?s>o?[s*l,s]:[a,a/l]:[a,s]},Qe=(n,o)=>{const a=n>=0?Fr[o-1]:-Fr[o-1];return o?n+a/2-(n+a/2)%a:Math.round(n)},Hc=(n,o)=>{const a=n.points.length;if(a===o)return n;if(a>o){const s=n.points.slice(0,o);return _t(it({},n),{points:s,style:_t(it({},n.style),{pointsCount:s.length})})}else{const s=o-a,l=C.flow(C.range(0),C.map(h=>[n.points[0][0]+(n.points[1][0]-n.points[0][0])*(h+1)/(s+1),n.points[0][1]+(n.points[1][1]-n.points[0][1])*(h+1)/(s+1)]))(s),p=[n.points[0],...l,...n.points.slice(1,n.points.length)];return _t(it({},n),{points:p,style:_t(it({},n.style),{pointsCount:p.length})})}},Bc=(n,o,a,s,l,p,h,d)=>{switch(p.mode){case"brush":return Mc(o,a);case"translate":return vi(a,p.originalShape,p.cursorStartPosition,s);case"rotate":return of(o,a,p.originalShape,p.cursorStartPosition,p.center,s);case"resize":const x=[Qe(a[0],s),Qe(a[1],s)];return af(n,o,x,l,p.originalShape,p,h,d);default:return o}},Fc=(n,o,a,s,l=!1)=>{if(!n||!o||!s||!a)return[Ir,Ir];const p=n/o,h=a/s;if(p>h){const d=l?a:Math.min(n,a);return[d,d/p]}else{const d=l?s:Math.min(o,s);return[d*p,d]}},Zc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),x:o[0],y:o[1],radius:1,rotation:0,style:{globalAlpha:n.settings.opacity.default,fillColor:n.settings.fillColor.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default}}),uo=(n,o)=>{var a,s;ur(n,o.style),n.beginPath(),n.arc(o.x,o.y,o.radius,0,2*Math.PI),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke()},Uc=(n,o)=>({x:n.x-n.radius-o,width:(n.radius+o)*2,y:n.y-n.radius-o,height:(n.radius+o)*2}),Ka=(n,o,a,s,[l,p]=[!1,!1])=>{const h=n[0]===.5?a.x:n[0]===0?a.x+(l?-a.radius:a.radius):a.x+(l?a.radius:-a.radius),d=n[1]===.5?a.y:n[1]===0?a.y+(p?-a.radius:a.radius):a.y+(p?a.radius:-a.radius);return ui([h,d],a.rotation,o,s)},zc=(n,o,a,s,l)=>{const{center:p,borders:h}=qt(a,l),d=nn(n,a.rotation,p,o),x=[d[0],d[1]],L=s.anchor[1]===.5?(s.anchor[0]===0?h.x+h.width-x[0]+l*(s.anchor[0]===0?-2:2):x[0]-h.x-l*(s.anchor[0]===0?-2:2))/2:(s.anchor[1]===0?h.y+h.height-x[1]+l*(s.anchor[1]===0?-2:2):x[1]-h.y-l*(s.anchor[1]===0?-2:2))/2,Q=_t(it({},a),{radius:Math.abs(L)}),{center:k}=qt(Q,l),[V,N]=Ka(s.anchor,p,a,o),[O,Y]=Ka(s.anchor,k,Q,o,[L<0,L<0]);return _t(it({},Q),{x:Q.x-(O-V),y:Q.y-(Y-N)})},Ja=(n,o)=>{var a,s;ur(n,o.style),n.globalAlpha!==0&&(n.beginPath(),n.moveTo(...o.points[0]),n.lineTo(...o.points[1]),n.lineTo(...o.points[2]),n.lineTo(...o.points[0]),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke())},Pc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),points:[o,o],rotation:0,style:{globalAlpha:n.settings.opacity.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default,lineArrow:n.settings.lineArrow.default}}),qa=(n,o,a)=>{var l,p,h,d,x,L,Q,k,V,N,O;const s=[rn({point:[0,-(10+((p=(l=a.style)==null?void 0:l.lineWidth)!=null?p:0)*1)],rotation:o}),rn({point:[-(5+((d=(h=a.style)==null?void 0:h.lineWidth)!=null?d:0)*1),5+((L=(x=a.style)==null?void 0:x.lineWidth)!=null?L:0)*2],rotation:o}),rn({point:[5+((k=(Q=a.style)==null?void 0:Q.lineWidth)!=null?k:0)*1,5+((N=(V=a.style)==null?void 0:V.lineWidth)!=null?N:0)*2],rotation:o})];return{points:[[n[0]+s[0][0],n[1]+s[0][1]],[n[0]+s[1][0],n[1]+s[1][1]],[n[0]+s[2][0],n[1]+s[2][1]]],style:_t(it({},a.style),{fillColor:(O=a.style)==null?void 0:O.strokeColor,strokeColor:"transparent"})}},$a=(n,o)=>{var a,s,l,p,h,d;if(ur(n,o.style),n.globalAlpha!==0){if(n.beginPath(),n.moveTo(...o.points[0]),n.lineTo(...o.points[1]),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke(),((l=o.style)==null?void 0:l.lineArrow)===1||((p=o.style)==null?void 0:p.lineArrow)===3){const x=Math.PI/2-Ga(o.points[0],o.points[1]);Ja(n,qa(o.points[0],x,{style:o.style}))}if(((h=o.style)==null?void 0:h.lineArrow)===2||((d=o.style)==null?void 0:d.lineArrow)===3){const x=Math.PI/2-Ga(o.points[1],o.points[0]);Ja(n,qa(o.points[1],x,{style:o.style}))}}},Sc=(n,o)=>{const a=Math.min(n.points[0][0],n.points[1][0])-o,s=Math.abs(n.points[0][0]-n.points[1][0])+o*2,l=Math.min(n.points[0][1],n.points[1][1])-o,p=Math.abs(n.points[0][1]-n.points[1][1])+o*2;return{x:a,width:s,y:l,height:p}},Yc=(n,o,a,s,l)=>{const{center:p}=qt(a,l),h=nn(n,a.rotation,p,o);return C.set(["points",s.anchor],h,a)},Gc=({ctx:n,shape:o,withAnchors:a,selectionPadding:s,selectionWidth:l,selectionColor:p,currentScale:h=1})=>{const{borders:d}=qt(o,s);if(ao(n,_t(it({},d),{style:{fillColor:"transparent",strokeColor:p,lineWidth:l/h}})),!(!a||o.locked))for(let x=0;x<o.points.length;x++){const L=o.points[x];o.type==="curve"&&x>0&&x<o.points.length-1?ao(n,{x:L[0]-Gt/2,y:L[1]-Gt/2,width:Gt/h,height:Gt/h,style:{fillColor:"rgb(255,255,255)",strokeColor:"rgb(150,150,150)",lineWidth:l/h}}):uo(n,{x:L[0],y:L[1],radius:Gt/2/h,style:{fillColor:"rgb(255,255,255)",strokeColor:"rgb(150,150,150)",lineWidth:l/h}})}},Xc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),points:C.flow(C.range(0),C.map(()=>o))(n.settings.pointsCount.default),rotation:0,style:{globalAlpha:n.settings.opacity.default,fillColor:n.settings.fillColor.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default,pointsCount:n.settings.pointsCount.default}}),Kc=(n,o)=>{var a,s;o.points.length<1||(ur(n,o.style),n.globalAlpha!==0&&(n.beginPath(),n.moveTo(...o.points[0]),o.points.slice(1).forEach(l=>{n.lineTo(...l)}),n.lineTo(...o.points[0]),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke()))},tu=(n,o)=>{const a=C.flow(C.map(h=>h[0]),C.min,C.add(-o))(n.points),s=C.flow(C.map(h=>h[0]),C.max,C.add(o))(n.points),l=C.flow(C.map(h=>h[1]),C.min,C.add(-o))(n.points),p=C.flow(C.map(h=>h[1]),C.max,C.add(o))(n.points);return{x:a,width:s-a,y:l,height:p-l}},Jc=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),points:C.flow(C.range(0),C.map(()=>o))(n.settings.pointsCount.default),rotation:0,style:{globalAlpha:n.settings.opacity.default,fillColor:n.settings.fillColor.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default,pointsCount:n.settings.pointsCount.default}}),qc=(n,o)=>{var a,s;if(!(o.points.length<3)&&(ur(n,o.style),n.globalAlpha!==0)){n.beginPath(),n.moveTo(...o.points[0]);for(let l=1;l<o.points.length-1;l++)n.quadraticCurveTo(...o.points[l],o.points.length-2===l?o.points[l+1][0]:(o.points[l+1][0]-o.points[l][0])/2+o.points[l][0],o.points.length-2===l?o.points[l+1][1]:(o.points[l+1][1]-o.points[l][1])/2+o.points[l][1]);((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke()}},$c=tu,li=(n,o,a,s,l,p=jn)=>{var h;return n.font=`${l?"italic":""} ${s?"bold":""} 1px ${p}`,(h=C.flow(C.map(d=>a/n.measureText(d).width),C.min)(o))!=null?h:mc},tl=(n,o,a)=>{var p,h,d,x;const s=["Texte"],l=li(n,s,50,(h=(p=o.settings)==null?void 0:p.fontBold.default)!=null?h:!1,(x=(d=o.settings)==null?void 0:d.fontItalic.default)!=null?x:!1,o.settings.fontFamily.default);return{toolId:o.id,type:o.type,id:C.uniqueId(`${o.type}_`),x:a[0],y:a[1],value:s,fontSize:l,width:50,height:l*(s.length||1),rotation:0,style:{globalAlpha:o.settings.opacity.default,strokeColor:o.settings.strokeColor.default,fontFamily:o.settings.fontFamily.default}}},el=(n,o)=>{var a,s,l,p,h;if(ur(n,o.style),!(n.globalAlpha===0||!((a=o.style)!=null&&a.strokeColor)||o.style.strokeColor==="transparent")){n.font=`${(s=o.style)!=null&&s.fontItalic?"italic":""} ${(l=o.style)!=null&&l.fontBold?"bold":""} ${o.fontSize}px ${(h=(p=o.style)==null?void 0:p.fontFamily)!=null?h:jn}`,n.textBaseline="top",n.fillStyle=o.style.strokeColor;for(let d=0;d<o.value.length;d++)n.fillText(o.value[d],o.x,o.y+d*o.fontSize,o.width)}},rl=(n,o)=>({x:n.x-o,width:n.width+o*2,y:n.y-o,height:n.height+o*2}),nl=(n,o,a,s,l,p)=>{var d,x,L,Q,k;const h=si(o,a,s,l,p,!0);return _t(it({},h),{fontSize:li(n,h.value,h.width,(x=(d=h.style)==null?void 0:d.fontBold)!=null?x:!1,(Q=(L=h.style)==null?void 0:L.fontItalic)!=null?Q:!1,(k=h.style)==null?void 0:k.fontFamily)})},ol=(n,o,a,s,l,p=jn)=>{var h;return n.font=`${l?"italic":""} ${s?"bold":""} ${a}px ${p}`,(h=C.flow(C.map(d=>n.measureText(d).width),C.max)(o))!=null?h:20},il=(n,o,a,s)=>{var Y,M,T,z,K;const l=C.set("value",a,o),p=ol(n,l.value,l.fontSize,(M=(Y=l.style)==null?void 0:Y.fontBold)!=null?M:!1,(z=(T=l.style)==null?void 0:T.fontItalic)!=null?z:!1,(K=l.style)==null?void 0:K.fontFamily),h=l.fontSize*l.value.length,d=_t(it({},l),{width:p,height:h}),x=0,{center:L}=qt(o,x),{center:Q}=qt(d,x),[k,V]=on([1,.5],L,o,s),[N,O]=on([1,.5],Q,d,s,[!1,!1]);return _t(it({},d),{x:d.x-(N-k),y:d.y-(O-V)})},al=(n,o)=>({toolId:n.id,type:n.type,id:C.uniqueId(`${n.type}_`),x:o[0],y:o[1],radiusX:1,radiusY:1,rotation:0,style:{globalAlpha:n.settings.opacity.default,fillColor:n.settings.fillColor.default,strokeColor:n.settings.strokeColor.default,lineWidth:n.settings.lineWidth.default,lineDash:n.settings.lineDash.default}}),ul=(n,o)=>{var a,s;ur(n,o.style),n.globalAlpha!==0&&(n.beginPath(),n.ellipse(o.x,o.y,o.radiusX,o.radiusY,0,0,2*Math.PI),((a=o.style)==null?void 0:a.fillColor)!=="transparent"&&n.fill(),((s=o.style)==null?void 0:s.strokeColor)!=="transparent"&&n.stroke())},sl=(n,o)=>({x:n.x-n.radiusX-o,width:(n.radiusX+o)*2,y:n.y-n.radiusY-o,height:(n.radiusY+o)*2}),eu=(n,o,a,s,[l,p]=[!1,!1])=>{const h=n[0]===.5?a.x:n[0]===0?a.x+(l?-a.radiusX:a.radiusX):a.x+(l?a.radiusX:-a.radiusX),d=n[1]===.5?a.y:n[1]===0?a.y+(p?-a.radiusY:a.radiusY):a.y+(p?a.radiusY:-a.radiusY);return ui([h,d],a.rotation,o,s)},cl=(n,o,a,s,l,p=!1)=>{const{center:h,borders:d}=qt(a,l),x=nn(n,a.rotation,h,o),L=[x[0],x[1]],Q=s.anchor[0]===.5?a.radiusX:(s.anchor[0]===0?d.x+d.width-L[0]+l*(s.anchor[0]===0?-2:2):L[0]-d.x-l*(s.anchor[0]===0?-2:2))/2,k=s.anchor[1]===.5?a.radiusY:(s.anchor[1]===0?d.y+d.height-L[1]+l*(s.anchor[1]===0?-2:2):L[1]-d.y-l*(s.anchor[1]===0?-2:2))/2,[V,N]=p?ci(a.radiusX,a.radiusY,Q,k):[Q,k],O=_t(it({},a),{radiusX:Math.abs(V),radiusY:Math.abs(N)}),{center:Y}=qt(O,l),[M,T]=eu(s.anchor,h,a,o),[z,K]=eu(s.anchor,Y,O,o,[V<0,N<0]);return _t(it({},O),{x:O.x-(z-M),y:O.y-(K-T)})},ll=n=>{const o=["img","id"];return n.map(a=>a.type==="picture"&&!a.src.startsWith("http")?C.omit(o,_t(it({},a),{src:dl(a.img)})):C.omit(o,a))},ru=(n,o,a)=>({shapes:ll(n),config:{width:o,height:a}}),nu=n=>_t(it({},n),{id:C.uniqueId(`${n.type}_`)}),fl=n=>C.map(o=>{if(!o.translation)return o;const a=o.translation;switch(o.type){case"rect":case"square":case"ellipse":case"circle":case"picture":return _t(it({},C.omit(["translation"],o)),{x:o.x+a[0],y:o.y+a[1]});case"line":return _t(it({},C.omit(["translation"],o)),{points:o.points.map(([s,l])=>[s+a[0],l+a[1]])});case"polygon":case"curve":return _t(it({},C.omit(["translation"],o)),{points:o.points.map(([s,l])=>[s+a[0],l+a[1]])});case"brush":return _t(it({},C.omit(["translation"],o)),{points:o.points.map(s=>s.map(([l,p])=>[l+a[0],p+a[1]]))})}},n),ou=n=>{var x;const s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("svg")[0],l=s.getAttribute("width"),p=s.getAttribute("height");let h;if(l||p)h=n;else{const L=(x=s.getAttribute("viewBox"))!=null?x:`0 0 ${Ir} ${Ir}`,[,,Q,k]=L.split(" ");s.setAttribute("width",Q!=null?Q:Ir),s.setAttribute("height",k!=null?k:Ir),h=new XMLSerializer().serializeToString(s)}const d=new Blob([h],{type:"image/svg+xml"});return URL.createObjectURL(d)},iu=n=>(n instanceof File?n.name:n).includes(".svg"),au=n=>iu(n)?fetch(n).then(o=>o.text()).then(o=>ou(o)):fetch(n).then(o=>o.blob()).then(o=>URL.createObjectURL(o)),uu=(n,o)=>{const a=document.createElement("a");a.href=n,a.download=o,document.body.appendChild(a),a.click(),document.body.removeChild(a)},dl=n=>{const o=document.createElement("canvas");o.width=n.width,o.height=n.height;const a=o.getContext("2d");return a?(a.drawImage(n,0,0),o.toDataURL("image/png")):""},pl=n=>"data:text/plain;charset=utf-8,"+encodeURIComponent(JSON.stringify(n)),su=(n,o,a,s,l)=>{const p=document.createElement("canvas");p.width=a,p.height=s;const h=p.getContext("2d");if(!h)return"";h.clearRect(0,0,a,s),Fa(h);for(let d=n.length-1;d>=0;d--)Ou(h,n[d],1,o,l);return p.toDataURL("image/png")},hl=(n,o,a)=>{const s=ru(n,o,a);return pl(s)},gl=n=>gr(this,null,function*(){return new Promise((o,a)=>{const s=new FileReader;s.onload=l=>{var d;const p=(d=l.target)==null?void 0:d.result;if(!p)return a("Impossible de récupérer les données du fichier");const h=JSON.parse(p);o(h)},s.readAsText(n)})}),vl=n=>gr(this,null,function*(){const o=[],a=n.shapes,s=C.flow(l=>fl(l),C.map(l=>{if(!Ha.includes(l.type))return null;if(l.type==="picture"){const p=new Image,h=new Promise((d,x)=>{p.onload=()=>{URL.revokeObjectURL(p.src),d()},p.onerror=()=>{x(new Error("Some images could not be loaded"))}});return o.push(h),l.src.startsWith("http")?au(l.src).then(d=>{p.src=d}).catch(()=>{p.src=""}):p.src=l.src,nu(_t(it({},l),{img:p}))}return nu(l)}),C.compact)(a);return yield Promise.all(o),s}),cu='<svg><path d="M5.146 17.5Q4.146 17.5 3.208 17Q2.271 16.5 1.667 15.708Q2.208 15.75 2.802 15.344Q3.396 14.938 3.396 14.104Q3.396 13.042 4.135 12.292Q4.875 11.542 5.958 11.542Q7.021 11.542 7.76 12.292Q8.5 13.042 8.5 14.104Q8.5 15.5 7.51 16.5Q6.521 17.5 5.146 17.5ZM9.917 12.5 7.562 10.146 14.917 2.729Q15.146 2.5 15.469 2.5Q15.792 2.5 16.021 2.729L17.271 3.958Q17.5 4.188 17.5 4.531Q17.5 4.875 17.271 5.125Z"/></svg>',so='<svg><path d="M2.5 17.5V2.5H17.5V17.5ZM4.25 15.75H15.75V4.25H4.25ZM4.25 15.75V4.25V15.75Z"/></svg>',yl='<svg><path d="M5.333 9.292 10.021 1.646 14.708 9.292ZM14.562 18.333Q13 18.333 11.896 17.229Q10.792 16.125 10.792 14.562Q10.792 13 11.896 11.896Q13 10.792 14.562 10.792Q16.125 10.792 17.229 11.896Q18.333 13 18.333 14.562Q18.333 16.125 17.229 17.229Q16.125 18.333 14.562 18.333ZM2.5 17.917V11.188H9.229V17.917ZM14.562 16.583Q15.438 16.583 16.01 16.01Q16.583 15.438 16.583 14.562Q16.583 13.688 16.01 13.115Q15.438 12.542 14.562 12.542Q13.688 12.542 13.115 13.115Q12.542 13.688 12.542 14.562Q12.542 15.438 13.115 16.01Q13.688 16.583 14.562 16.583ZM4.25 16.167H7.479V12.938H4.25ZM8.458 7.542H11.583L10.021 5ZM10.021 7.542ZM7.479 12.938ZM14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Z"/></svg>',co='<svg><path d="M10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.271 2.323 6.75Q2.979 5.229 4.104 4.104Q5.229 2.979 6.75 2.323Q8.271 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.729 17.677 13.25Q17.021 14.771 15.896 15.896Q14.771 17.021 13.25 17.677Q11.729 18.333 10 18.333ZM10 16.583Q12.75 16.583 14.667 14.667Q16.583 12.75 16.583 10Q16.583 7.25 14.667 5.333Q12.75 3.417 10 3.417Q7.25 3.417 5.333 5.333Q3.417 7.25 3.417 10Q3.417 12.75 5.333 14.667Q7.25 16.583 10 16.583ZM10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Z"/></svg>',fi='<svg><path d="M12.25 18.333V16.167L6.833 13.458H2.5V8.208H6.25L8.25 5.917V1.667H13.5V6.917H9.708L7.75 9.146V11.958L12.25 14.208V13.083H17.5V18.333Z"/></svg>',lu='<svg><path d="M4.125 5.083V3.333H7.062L7.896 2.5H12.104L12.938 3.333H15.875V5.083ZM6.75 17.5Q6.021 17.5 5.51 16.99Q5 16.479 5 15.75V5.958H15V15.75Q15 16.479 14.49 16.99Q13.979 17.5 13.25 17.5Z"/></svg>',fu='<svg><path d="M10 17.5Q7.208 17.5 5.271 15.594Q3.333 13.688 3.333 10.958Q3.333 9.583 3.854 8.396Q4.375 7.208 5.292 6.292L10 1.667L14.688 6.292Q15.604 7.208 16.135 8.396Q16.667 9.583 16.667 10.958Q16.667 13.688 14.719 15.594Q12.771 17.5 10 17.5ZM5.146 11.667H14.854Q15.083 10.188 14.552 9.146Q14.021 8.104 13.479 7.562L10 4.125L6.521 7.562Q5.979 8.104 5.448 9.146Q4.917 10.188 5.146 11.667Z"/></svg>',ml='<svg><path d="M11.708 15.833H5.854V14.083H11.708Q13 14.083 13.958 13.292Q14.917 12.5 14.917 11.271Q14.917 10.042 13.958 9.24Q13 8.438 11.708 8.438H6.667L8.792 10.562L7.562 11.792L3.333 7.562L7.562 3.333L8.792 4.562L6.667 6.688H11.708Q13.729 6.688 15.198 7.99Q16.667 9.292 16.667 11.25Q16.667 13.208 15.198 14.521Q13.729 15.833 11.708 15.833Z"/></svg>',_l='<svg><path d="M8.292 15.833Q6.271 15.833 4.802 14.521Q3.333 13.208 3.333 11.25Q3.333 9.292 4.802 7.99Q6.271 6.688 8.292 6.688H13.333L11.208 4.562L12.438 3.333L16.667 7.562L12.438 11.792L11.208 10.562L13.333 8.438H8.292Q7 8.438 6.042 9.229Q5.083 10.021 5.083 11.25Q5.083 12.5 6.042 13.292Q7 14.083 8.292 14.083H14.146V15.833Z"/></svg>',bl='<svg><path d="M10 17.646 2.438 11.75 3.875 10.646 10 15.396 16.125 10.646 17.562 11.75ZM10 13.188 2.5 7.354 10 1.521 17.5 7.354Z"/></svg>',xl='<svg><path d="M7.854 13.812 10 11.688 12.125 13.812 13.354 12.604 11.208 10.458 13.354 8.312 12.125 7.104 10 9.229 7.854 7.104 6.625 8.312 8.771 10.458 6.625 12.604ZM5.896 17.5Q5.167 17.5 4.656 16.99Q4.146 16.479 4.146 15.75V5.125H3.333V3.375H7.542V2.5H12.458V3.375H16.667V5.125H15.833V15.75Q15.833 16.479 15.323 16.99Q14.812 17.5 14.083 17.5Z"/></svg>',Ql='<svg><path d="M17.5 5.833V15.75Q17.5 16.479 16.99 16.99Q16.479 17.5 15.75 17.5H4.25Q3.521 17.5 3.01 16.99Q2.5 16.479 2.5 15.75V4.25Q2.5 3.521 3.01 3.01Q3.521 2.5 4.25 2.5H14.167ZM10 14.917Q11.062 14.917 11.823 14.156Q12.583 13.396 12.583 12.333Q12.583 11.271 11.823 10.51Q11.062 9.75 10 9.75Q8.938 9.75 8.177 10.51Q7.417 11.271 7.417 12.333Q7.417 13.396 8.177 14.156Q8.938 14.917 10 14.917ZM5.021 8.396H12.521V5.021H5.021Z"/></svg>',wl='<svg><path d="M10 13.271 5.708 8.979 6.958 7.729 9.125 9.896V3.333H10.875V9.896L13.042 7.729L14.292 8.979ZM5.083 16.667Q4.354 16.667 3.844 16.156Q3.333 15.646 3.333 14.917V12.5H5.083V14.917Q5.083 14.917 5.083 14.917Q5.083 14.917 5.083 14.917H14.917Q14.917 14.917 14.917 14.917Q14.917 14.917 14.917 14.917V12.5H16.667V14.917Q16.667 15.646 16.156 16.156Q15.646 16.667 14.917 16.667Z"/></svg>',Cl='<svg><path d="M3.417 16.667Q2.729 16.667 2.198 16.135Q1.667 15.604 1.667 14.917V5.083Q1.667 4.396 2.198 3.865Q2.729 3.333 3.417 3.333H8.25L9.917 5H16.667Q17.354 5 17.844 5.531Q18.333 6.062 18.333 6.75H3.417V14.917Q3.417 14.917 3.417 14.917Q3.417 14.917 3.417 14.917L5.438 8.5H19.583L17.396 15.479Q17.229 16.021 16.802 16.344Q16.375 16.667 15.833 16.667Z"/></svg>',di='<svg><path d="M4.792 15.083 8.333 11.542 9.833 13.021 11.667 10.708 15.167 15.083ZM6.667 8.417Q5.938 8.417 5.427 7.906Q4.917 7.396 4.917 6.667Q4.917 5.938 5.427 5.427Q5.938 4.917 6.667 4.917Q7.396 4.917 7.906 5.427Q8.417 5.938 8.417 6.667Q8.417 7.396 7.906 7.906Q7.396 8.417 6.667 8.417ZM4.167 18.333Q3.125 18.333 2.396 17.604Q1.667 16.875 1.667 15.833V4.167Q1.667 3.125 2.396 2.396Q3.125 1.667 4.167 1.667H15.833Q16.875 1.667 17.604 2.396Q18.333 3.125 18.333 4.167V15.833Q18.333 16.875 17.604 17.604Q16.875 18.333 15.833 18.333ZM4.167 16.583H15.833Q16.146 16.583 16.365 16.365Q16.583 16.146 16.583 15.833V4.167Q16.583 3.854 16.365 3.635Q16.146 3.417 15.833 3.417H4.167Q3.854 3.417 3.635 3.635Q3.417 3.854 3.417 4.167V15.833Q3.417 16.146 3.635 16.365Q3.854 16.583 4.167 16.583Z"/></svg>',du='<svg><path d="M8.708 16.667V5.917H4.167V3.333H15.833V5.917H11.292V16.667Z"/></svg>',pu='<svg><path d="M7.5 15.833V14.083H12.833L3.333 4.583L4.583 3.333L14.083 12.833V7.5H15.833V15.833Z"/></svg>',El='<svg><path d="M8.0145 11.1707C8.38484 10.9914 8.82183 11.1558 8.99959 11.5295L10.7031 15.2591L12.0363 14.6238L10.3254 10.9017C10.1476 10.528 10.3106 10.0795 10.6809 9.90761L10.8883 9.84782L12.5918 9.51148L6.48133 4.33192V12.389L7.82934 11.2903L8.0145 11.1707ZM10.6587 16.9258C10.2883 17.1052 9.84395 16.9482 9.67359 16.5745L8.05894 13.0318L6.19988 14.5416C6.07396 14.6462 5.91842 14.706 5.74066 14.706C5.54423 14.706 5.35584 14.6272 5.21694 14.4871C5.07803 14.3469 5 14.1568 5 13.9586V2.74741C5 2.54919 5.07803 2.35908 5.21694 2.21891C5.35584 2.07874 5.54423 2 5.74066 2C5.91842 2 6.08878 2.06727 6.21469 2.1719L6.2221 2.16443L14.7323 9.36947C15.0508 9.63854 15.0879 10.1094 14.8286 10.4233C14.7175 10.5579 14.562 10.6475 14.4064 10.6774L12.0659 11.1408L13.6954 14.6761C13.888 15.0498 13.7102 15.4908 13.3399 15.6627L10.6587 16.9258Z"/></svg>',Al='<svg><path d="M2.5 15V13.25H17.5V15ZM2.5 10.875V9.125H17.5V10.875ZM2.5 6.75V5H17.5V6.75Z"/></svg>',Ll='<svg><path d="M10 13.354Q11.583 13.354 12.688 12.25Q13.792 11.146 13.792 9.562Q13.792 7.979 12.688 6.875Q11.583 5.771 10 5.771Q8.417 5.771 7.312 6.875Q6.208 7.979 6.208 9.562Q6.208 11.146 7.312 12.25Q8.417 13.354 10 13.354ZM10 11.812Q9.062 11.812 8.406 11.156Q7.75 10.5 7.75 9.562Q7.75 8.625 8.406 7.969Q9.062 7.312 10 7.312Q10.938 7.312 11.594 7.969Q12.25 8.625 12.25 9.562Q12.25 10.5 11.594 11.156Q10.938 11.812 10 11.812ZM10 15.833Q6.938 15.833 4.448 14.125Q1.958 12.417 0.833 9.562Q1.958 6.708 4.458 5.021Q6.958 3.333 10 3.333Q13.042 3.333 15.542 5.021Q18.042 6.708 19.167 9.562Q18.042 12.417 15.552 14.125Q13.062 15.833 10 15.833ZM10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562ZM10 14.083Q12.333 14.083 14.281 12.865Q16.229 11.646 17.25 9.562Q16.229 7.479 14.281 6.281Q12.333 5.083 10 5.083Q7.667 5.083 5.708 6.281Q3.75 7.479 2.729 9.562Q3.75 11.646 5.708 12.865Q7.667 14.083 10 14.083Z"/></svg>',kl='<svg><path d="M13.521 11.021 12.25 9.75Q12.333 8.75 11.604 7.979Q10.875 7.208 9.812 7.312L8.542 6.042Q8.896 5.896 9.26 5.833Q9.625 5.771 10 5.771Q11.583 5.771 12.688 6.875Q13.792 7.979 13.792 9.562Q13.792 9.979 13.719 10.354Q13.646 10.729 13.521 11.021ZM16.167 13.646 14.917 12.417Q15.667 11.833 16.25 11.146Q16.833 10.458 17.25 9.562Q16.229 7.479 14.292 6.281Q12.354 5.083 10 5.083Q9.396 5.083 8.885 5.156Q8.375 5.229 7.875 5.375L6.5 4Q7.354 3.646 8.208 3.49Q9.062 3.333 10 3.333Q13.146 3.333 15.615 5.052Q18.083 6.771 19.167 9.562Q18.688 10.792 17.917 11.823Q17.146 12.854 16.167 13.646ZM16.396 18.854 12.938 15.396Q12.208 15.625 11.479 15.729Q10.75 15.833 10 15.833Q6.833 15.833 4.375 14.094Q1.917 12.354 0.833 9.562Q1.25 8.479 1.917 7.552Q2.583 6.625 3.417 5.875L1.125 3.562L2.375 2.354L17.625 17.625ZM4.604 7.062Q4.021 7.604 3.542 8.219Q3.062 8.833 2.729 9.562Q3.75 11.646 5.688 12.865Q7.625 14.083 10 14.083Q10.354 14.083 10.74 14.052Q11.125 14.021 11.479 13.938L10.812 13.271Q10.625 13.312 10.417 13.333Q10.208 13.354 10 13.354Q8.417 13.354 7.312 12.25Q6.208 11.146 6.208 9.562Q6.208 9.354 6.24 9.167Q6.271 8.979 6.312 8.771ZM11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875ZM8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Z"/></svg>',jl='<svg><path d="M9.958 18.333Q8.25 18.333 6.74 17.677Q5.229 17.021 4.104 15.885Q2.979 14.75 2.323 13.229Q1.667 11.708 1.667 10Q1.667 8.271 2.333 6.75Q3 5.229 4.156 4.104Q5.312 2.979 6.854 2.323Q8.396 1.667 10.125 1.667Q11.771 1.667 13.26 2.25Q14.75 2.833 15.875 3.854Q17 4.875 17.667 6.26Q18.333 7.646 18.333 9.25Q18.333 11.688 16.792 12.948Q15.25 14.208 13.188 14.208H11.75Q11.625 14.208 11.562 14.281Q11.5 14.354 11.5 14.458Q11.5 14.688 11.812 15.219Q12.125 15.75 12.125 16.458Q12.125 17.458 11.51 17.896Q10.896 18.333 9.958 18.333ZM5.458 10.875Q6 10.875 6.375 10.5Q6.75 10.125 6.75 9.583Q6.75 9.042 6.375 8.667Q6 8.292 5.458 8.292Q4.917 8.292 4.542 8.667Q4.167 9.042 4.167 9.583Q4.167 10.125 4.542 10.5Q4.917 10.875 5.458 10.875ZM7.917 7.583Q8.458 7.583 8.833 7.208Q9.208 6.833 9.208 6.292Q9.208 5.75 8.833 5.375Q8.458 5 7.917 5Q7.375 5 7 5.375Q6.625 5.75 6.625 6.292Q6.625 6.833 7 7.208Q7.375 7.583 7.917 7.583ZM12.021 7.583Q12.562 7.583 12.938 7.208Q13.312 6.833 13.312 6.292Q13.312 5.75 12.938 5.375Q12.562 5 12.021 5Q11.479 5 11.104 5.375Q10.729 5.75 10.729 6.292Q10.729 6.833 11.104 7.208Q11.479 7.583 12.021 7.583ZM14.479 10.875Q15.021 10.875 15.396 10.5Q15.771 10.125 15.771 9.583Q15.771 9.042 15.396 8.667Q15.021 8.292 14.479 8.292Q13.938 8.292 13.562 8.667Q13.188 9.042 13.188 9.583Q13.188 10.125 13.562 10.5Q13.938 10.875 14.479 10.875Z"/></svg>',Il='<svg><path d="M9.188 16.542V14.938Q8.5 14.938 8.021 14.458Q7.542 13.979 7.542 13.292V12.458L3.583 8.5Q3.5 8.875 3.458 9.25Q3.417 9.625 3.417 10Q3.417 12.5 5.062 14.365Q6.708 16.229 9.188 16.542ZM14.854 14.438Q15.708 13.521 16.146 12.385Q16.583 11.25 16.583 10Q16.583 7.979 15.469 6.313Q14.354 4.646 12.479 3.917V4.229Q12.479 4.917 12 5.396Q11.521 5.875 10.833 5.875H9.188V7.521Q9.188 7.875 8.948 8.115Q8.708 8.354 8.354 8.354H6.708V10H11.646Q12 10 12.24 10.229Q12.479 10.458 12.479 10.812V13.292H13.292Q13.833 13.292 14.26 13.604Q14.688 13.917 14.854 14.438ZM10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.271 2.323 6.75Q2.979 5.229 4.104 4.104Q5.229 2.979 6.75 2.323Q8.271 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.729 17.677 13.25Q17.021 14.771 15.896 15.896Q14.771 17.021 13.25 17.677Q11.729 18.333 10 18.333Z"/></svg>',Rl='<svg><path d="M10 0.833Q11.771 0.833 12.99 2.052Q14.208 3.271 14.208 5.042V6.667H14.917Q15.646 6.667 16.156 7.177Q16.667 7.688 16.667 8.417V16.562Q16.667 17.292 16.156 17.812Q15.646 18.333 14.917 18.333H5.083Q4.354 18.333 3.844 17.812Q3.333 17.292 3.333 16.562V8.417Q3.333 7.688 3.844 7.177Q4.354 6.667 5.083 6.667H5.792V5.042Q5.792 3.271 7.01 2.052Q8.229 0.833 10 0.833ZM10 2.583Q8.979 2.583 8.26 3.302Q7.542 4.021 7.542 5.042V6.667H12.458V5.042Q12.458 4.021 11.74 3.302Q11.021 2.583 10 2.583ZM5.083 16.583H14.917Q14.917 16.583 14.917 16.583Q14.917 16.583 14.917 16.583V8.417Q14.917 8.417 14.917 8.417Q14.917 8.417 14.917 8.417H5.083Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583ZM10 10.812Q9.292 10.812 8.802 11.302Q8.312 11.792 8.312 12.5Q8.312 13.208 8.802 13.698Q9.292 14.188 10 14.188Q10.708 14.188 11.198 13.698Q11.688 13.208 11.688 12.5Q11.688 11.792 11.198 11.302Q10.708 10.812 10 10.812ZM5.083 8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583V8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417Z"/></svg>',Tl='<svg><path d="M5.792 5.042Q5.792 3.271 7.01 2.052Q8.229 0.833 10 0.833Q11.771 0.833 12.99 2.052Q14.208 3.271 14.208 5.042V6.667H14.917Q15.646 6.667 16.156 7.177Q16.667 7.688 16.667 8.417V16.562Q16.667 17.292 16.156 17.812Q15.646 18.333 14.917 18.333H5.083Q4.354 18.333 3.844 17.812Q3.333 17.292 3.333 16.562V8.417Q3.333 7.688 3.844 7.177Q4.354 6.667 5.083 6.667H12.458V5.042Q12.458 4.021 11.74 3.302Q11.021 2.583 10 2.583Q8.979 2.583 8.26 3.302Q7.542 4.021 7.542 5.042ZM5.083 16.583H14.917Q14.917 16.583 14.917 16.583Q14.917 16.583 14.917 16.583V8.417Q14.917 8.417 14.917 8.417Q14.917 8.417 14.917 8.417H5.083Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583ZM10 10.812Q9.292 10.812 8.802 11.302Q8.312 11.792 8.312 12.5Q8.312 13.208 8.802 13.698Q9.292 14.188 10 14.188Q10.708 14.188 11.198 13.698Q11.688 13.208 11.688 12.5Q11.688 11.792 11.198 11.302Q10.708 10.812 10 10.812ZM5.083 8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583V8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417Z"/></svg>',Ol='<svg><path d="M18.333 15.854 16.583 14.104V13.354H15.833L14.083 11.604H16.583V8.375H13.375V10.896L11.625 9.146V8.375H10.875L9.125 6.625H11.625V3.417H8.396V5.896L6.646 4.146V3.417H5.896L4.146 1.667H16.583Q17.312 1.667 17.823 2.177Q18.333 2.688 18.333 3.417ZM13.375 6.625H16.583V3.417Q16.583 3.417 16.583 3.417Q16.583 3.417 16.583 3.417H13.375ZM16.771 19.229 15.854 18.333H3.417Q2.688 18.333 2.177 17.823Q1.667 17.312 1.667 16.583V4.125L0.812 3.271L2.042 2.021L18 18ZM13.375 16.583H14.104L13.375 15.833ZM8.396 11.604H9.125L8.396 10.854ZM8.396 16.583H11.625V14.083L10.875 13.354H8.396ZM3.417 6.625H4.167L3.417 5.875ZM3.417 11.604H6.646V9.104L5.917 8.375H3.417ZM6.646 16.583V13.354H3.417V16.583Q3.417 16.583 3.417 16.583Q3.417 16.583 3.417 16.583Z"/></svg>',hu='<svg><path d="M7.521 17.5Q6.125 17.5 5.146 16.51Q4.167 15.521 4.167 14.125V7.417Q3.438 7.125 2.969 6.49Q2.5 5.854 2.5 5.042Q2.5 3.979 3.24 3.24Q3.979 2.5 5.042 2.5Q6.104 2.5 6.844 3.24Q7.583 3.979 7.583 5.042Q7.583 5.854 7.115 6.49Q6.646 7.125 5.917 7.417V14.125Q5.917 14.792 6.385 15.271Q6.854 15.75 7.521 15.75Q8.188 15.75 8.656 15.271Q9.125 14.792 9.125 14.125V5.875Q9.125 4.479 10.104 3.49Q11.083 2.5 12.479 2.5Q13.875 2.5 14.854 3.49Q15.833 4.479 15.833 5.875V12.583Q16.562 12.875 17.031 13.51Q17.5 14.146 17.5 14.958Q17.5 16.021 16.76 16.76Q16.021 17.5 14.958 17.5Q13.896 17.5 13.156 16.76Q12.417 16.021 12.417 14.958Q12.417 14.146 12.885 13.5Q13.354 12.854 14.083 12.583V5.875Q14.083 5.208 13.615 4.729Q13.146 4.25 12.479 4.25Q11.812 4.25 11.344 4.729Q10.875 5.208 10.875 5.875V14.125Q10.875 15.521 9.896 16.51Q8.917 17.5 7.521 17.5Z"/></svg>',gu='<svg><path d="M5.833 15V3.333H10.375Q11.812 3.333 12.885 4.156Q13.958 4.979 13.958 6.375Q13.958 7.375 13.49 7.969Q13.021 8.562 12.396 8.875V9.042Q13.312 9.354 13.844 10.021Q14.375 10.688 14.375 11.75Q14.375 13.312 13.229 14.156Q12.083 15 10.5 15ZM8.125 8.042H10.188Q10.854 8.042 11.302 7.656Q11.75 7.271 11.75 6.708Q11.75 6.167 11.302 5.771Q10.854 5.375 10.188 5.375H8.125ZM8.125 12.917H10.354Q11.167 12.917 11.625 12.51Q12.083 12.104 12.083 11.458Q12.083 10.812 11.625 10.406Q11.167 10 10.354 10H8.125Z"/></svg>',vu='<svg><path d="M4.167 16.667V14.083H6.979L10.229 5.917H7.5V3.333H15.833V5.917H13.021L9.771 14.083H12.5V16.667Z"/></svg>',yu='<svg><path d="M3.021 16V15H17V16ZM3.021 13.5V12H17V13.5ZM3 10.5V8.5H16.979V10.5ZM3.021 7V4H17V7Z"/></svg>',Dl='<svg><path d="M3 16V14.5H4.5V16ZM6.125 16V14.5H7.625V16ZM9.25 16V14.5H10.75V16ZM12.375 16V14.5H13.875V16ZM15.5 16V14.5H17V16ZM3 13V11.5H6.5V13ZM8.25 13V11.5H11.75V13ZM13.5 13V11.5H17V13ZM3 10V8.5H9.25V10ZM10.75 10V8.5H17V10ZM3 7V4H17V7Z"/></svg>',Wl='<svg><path d="M5.312 14.979H7.125L8.042 12.479H11.979L12.896 14.979H14.708L10.917 5H9.083ZM8.542 10.958 9.958 6.958H10.042L11.458 10.958ZM3.417 18.333Q2.688 18.333 2.177 17.823Q1.667 17.312 1.667 16.583V3.417Q1.667 2.688 2.177 2.177Q2.688 1.667 3.417 1.667H16.583Q17.312 1.667 17.823 2.177Q18.333 2.688 18.333 3.417V16.583Q18.333 17.312 17.823 17.823Q17.312 18.333 16.583 18.333ZM3.417 16.583H16.583Q16.583 16.583 16.583 16.583Q16.583 16.583 16.583 16.583V3.417Q16.583 3.417 16.583 3.417Q16.583 3.417 16.583 3.417H3.417Q3.417 3.417 3.417 3.417Q3.417 3.417 3.417 3.417V16.583Q3.417 16.583 3.417 16.583Q3.417 16.583 3.417 16.583ZM3.417 3.417Q3.417 3.417 3.417 3.417Q3.417 3.417 3.417 3.417V16.583Q3.417 16.583 3.417 16.583Q3.417 16.583 3.417 16.583Q3.417 16.583 3.417 16.583Q3.417 16.583 3.417 16.583V3.417Q3.417 3.417 3.417 3.417Q3.417 3.417 3.417 3.417Z"/></svg>',Vl='<svg><path d="M6 17 2 13 6 9 7.062 10.062 4.875 12.25H17V13.75H4.875L7.062 15.938ZM14 11 12.938 9.938 15.125 7.75H3V6.25H15.125L12.938 4.062L14 3L18 7Z"/></svg>',Ml='<svg><path d="M2.5 15.833V14.083H7.667V15.833ZM2.5 5.917V4.167H10.771V5.917ZM9.208 17.5V12.438H10.958V14.083H17.5V15.833H10.958V17.5ZM5.917 12.542V10.875H2.5V9.125H5.917V7.479H7.667V12.542ZM9.208 10.875V9.125H17.5V10.875ZM12.333 7.562V2.5H14.083V4.167H17.5V5.917H14.083V7.562Z"/></svg>',mu='<svg><path d="M16.354 18.833 14.521 17Q13.542 17.646 12.396 17.99Q11.25 18.333 10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.729 2.01 7.594Q2.354 6.458 3 5.458L1.167 3.625L2.396 2.396L17.583 17.604ZM10 16.583Q10.896 16.583 11.708 16.365Q12.521 16.146 13.25 15.729L4.292 6.75Q3.875 7.479 3.646 8.292Q3.417 9.104 3.417 10Q3.417 12.729 5.344 14.656Q7.271 16.583 10 16.583ZM17 14.562 15.708 13.271Q16.125 12.542 16.354 11.719Q16.583 10.896 16.583 10Q16.583 7.271 14.656 5.344Q12.729 3.417 10 3.417Q9.104 3.417 8.292 3.646Q7.479 3.875 6.75 4.292L5.458 3Q6.458 2.354 7.594 2.01Q8.729 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.271 17.979 12.417Q17.625 13.562 17 14.562ZM11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771ZM8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Z"/></svg>',_u='<svg ><path d="M16.354 18.833 14.521 17Q13.542 17.646 12.396 17.99Q11.25 18.333 10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.729 2.01 7.594Q2.354 6.458 3 5.458L1.167 3.625L2.396 2.396L17.583 17.604ZM17 14.562 5.458 3Q6.458 2.354 7.594 2.01Q8.729 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.271 17.979 12.417Q17.625 13.562 17 14.562Z"/></svg>',ae="react-paint-",Nl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"transparent"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0}},Hl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"transparent"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0}},Bl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"transparent"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0}},Fl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"transparent"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0}},Zl={opacity:{min:0,max:100,step:1,default:100}},Ul={strokeColor:{values:me,default:"black"},opacity:{min:0,max:100,step:1,default:100},fontFamily:{values:yc,default:jn},fontBold:{values:[!1,!0],default:!1},fontItalic:{values:[!1,!0],default:!1}},zl={strokeColor:{values:me,default:"black"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:6,max:20,step:2,default:10},lineDash:{values:jr,default:0}},Pl={strokeColor:{values:me,default:"black"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0},lineArrow:{values:vc,default:0}},Sl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"black"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0},pointsCount:{min:3,max:10,step:1,default:3}},Yl={strokeColor:{values:me,default:"black"},fillColor:{values:me,default:"black"},opacity:{min:0,max:100,step:1,default:100},lineWidth:{min:1,max:20,step:1,default:1},lineDash:{values:jr,default:0},pointsCount:{min:3,max:10,step:1,default:3}},pi={type:"picture",id:`${ae}picture`,icon:di,label:"Image",settings:Zl},bu={type:"brush",id:`${ae}brush`,icon:cu,label:"Brosse",settings:zl},xu={type:"line",id:`${ae}line`,icon:pu,label:"Ligne",settings:Pl},Qu={type:"polygon",id:`${ae}polygon`,icon:fi,label:"Polygone",settings:Sl},wu={type:"curve",id:`${ae}curve`,icon:hu,label:"Courbe",settings:Yl},Cu={type:"rect",id:`${ae}rect`,icon:so,label:"Rectangle",settings:Nl},Eu={type:"square",id:`${ae}square`,icon:so,label:"Carré",settings:Hl},Au={type:"circle",id:`${ae}circle`,icon:co,label:"Cercle",settings:Bl},Lu={type:"ellipse",id:`${ae}ellipse`,icon:co,label:"Ellipse",settings:Fl},ku={type:"text",id:`${ae}text`,icon:du,label:"Texte",settings:Ul},Gl=[bu,xu,Qu,wu,Cu,Eu,Au,Lu,pi,ku],yr={id:`${ae}selection`,type:"selection",icon:El,label:"Sélection"},an={id:`${ae}undo`,type:"undo",icon:ml,label:"Undo"},un={id:`${ae}redo`,type:"redo",icon:_l,label:"Redo"},sn={id:`${ae}clear`,type:"clear",icon:xl,label:"Clear"},hi={id:`${ae}export`,type:"export",icon:wl,label:"Export PNG"},ju={id:`${ae}load`,type:"loadfile",icon:Cl,label:"Load project"},gi={id:`${ae}save`,type:"savefile",icon:Ql,label:"Save project"},Iu={id:`${ae}upload-picture`,type:"uploadpicture",icon:di,label:"Upload picture"},Ru=(n,o,a,s)=>{const[l,p]=Fc(n.width,n.height,a,s,!0);return{toolId:pi.id,type:"picture",id:C.uniqueId("picture_"),x:(a-l)/2,y:(s-p)/2,width:l,height:p,src:o,img:n,rotation:0}},Xl=(n,o,a,s,l)=>{const p=URL.createObjectURL(a);n.onload=()=>gr(this,null,function*(){if(URL.revokeObjectURL(n.src),iu(a)&&!n.width&&!n.height){const d=yield a.text(),x=ou(d);if(p===n.src){n.src=x;return}}const h=Ru(n,n.src,s,l);o(h)}),n.src=p},Kl=(n,o,a,s,l)=>{n.onload=()=>{URL.revokeObjectURL(n.src);const p=Ru(n,a,s,l);o(p)},au(a).then(p=>{n.src=p}).catch(()=>{n.src=""})},Jl=(n,o,a)=>new Promise((s,l)=>{const p=new Image;p.onerror=()=>{l(new Error("Some images could not be loaded"))},setTimeout(()=>{l(new Error("Timeout while loading images"))},4e3),n instanceof File?Xl(p,s,n,o,a):Kl(p,s,n,o,a)}),ql=(n,o)=>{ur(n,o.style),n.globalAlpha!==0&&(n.beginPath(),n.drawImage(o.img,o.x,o.y,o.width,o.height))},$l=(n,o)=>Xa(n,o),tf=(n,o,a,s,l,p)=>si(n,o,a,s,l,p),ef=({ctx:n,shape:o,withAnchors:a,selectionPadding:s,selectionWidth:l,selectionColor:p,currentScale:h=1})=>{const{borders:d}=qt(o,s/h);if(ao(n,_t(it({},d),{style:{fillColor:"transparent",strokeColor:p,lineWidth:l/h}})),!(!a||o.locked)){$a(n,{points:[[d.x+d.width/2,d.y],[d.x+d.width/2,d.y-Gt/2-ri/h]],style:{fillColor:"transparent",strokeColor:p,lineWidth:l/h}});for(const x of Na)uo(n,{x:d.x+d.width*x[0],y:d.y+d.height*x[1],radius:Gt/2/h,style:{fillColor:"rgb(255,255,255)",strokeColor:"rgb(150,150,150)",lineWidth:l/h}});uo(n,{x:d.x+d.width/2,y:d.y-Gt/2-ri/h,radius:Gt/2/h,style:{fillColor:"rgb(255,255,255)",strokeColor:"rgb(150,150,150)",lineWidth:l/h}})}},Tu=(n,o,a,s)=>{const l=[Qe(a[0],s),Qe(a[1],s)];switch(o.type){case"brush":return Oc(o,l);case"line":return Pc(o,l);case"polygon":return Xc(o,l);case"curve":return Jc(o,l);case"rect":case"square":return Tc(o,l);case"text":return tl(n,o,l);case"ellipse":return al(o,l);case"circle":return Zc(o,l)}},Ou=(n,o,a,s,l)=>{if(o.visible===!1)return;const{center:p}=qt(o,l);switch(Za(n,a,s,o.rotation,p),o.type){case"brush":Dc(n,o);break;case"text":el(n,o);break;case"line":$a(n,o);break;case"polygon":Kc(n,o);break;case"curve":qc(n,o);break;case"circle":uo(n,o);break;case"ellipse":ul(n,o);break;case"rect":case"square":ao(n,o);break;case"picture":ql(n,o);break}n.restore()},rf=(n,o)=>{switch(n.type){case"brush":return Wc(n,o);case"line":return Sc(n,o);case"polygon":return tu(n,o);case"curve":return $c(n,o);case"circle":return Uc(n,o);case"ellipse":return sl(n,o);case"rect":case"square":default:return Xa(n,o);case"text":return rl(n,o);case"picture":return $l(n,o)}},nf=n=>[n.x+n.width/2,n.y+n.height/2],qt=(n,o)=>{const a=rf(n,o),s=nf(a);return{borders:a,center:s}},of=(n,o,a,s,l,p)=>{const h=l[0]-s[0],d=l[1]-s[1],x=l[0]-o[0],L=l[1]-o[1],Q=a.rotation+Math.atan2(L,x)-Math.atan2(d,h);return _t(it({},n),{rotation:p?Q+Math.PI/ni/2-(Q+Math.PI/ni/2)%(Math.PI/ni):Q})},af=(n,o,a,s,l,p,h,d)=>{switch(o.type){case"line":case"polygon":case"curve":return Yc(a,s,l,p,h);case"brush":return Vc(a,s,l,p,h,d);case"circle":return zc(a,s,l,p,h);case"ellipse":return cl(a,s,l,p,h,d);case"rect":case"square":return si(a,s,l,p,h,o.type==="square"||d);case"text":return nl(n,a,s,l,p,h);case"picture":return tf(a,s,l,p,h,!d)}},vi=(n,o,a,s)=>{switch(o.type){case"rect":case"square":case"ellipse":case"circle":case"picture":default:return _t(it({},o),{x:Qe(o.x+n[0]-a[0],s),y:Qe(o.y+n[1]-a[1],s)});case"line":return _t(it({},o),{points:o.points.map(([l,p])=>[Qe(l+n[0]-a[0],s),Qe(p+n[1]-a[1],s)])});case"polygon":case"curve":if(s){const{borders:l}=qt(o,0),p=Qe(l.x+n[0]-a[0],s)-l.x,h=Qe(l.y+n[1]-a[1],s)-l.y;return _t(it({},o),{points:o.points.map(([d,x])=>[d+p,x+h])})}else return _t(it({},o),{points:o.points.map(([l,p])=>[Qe(l+n[0]-a[0],s),Qe(p+n[1]-a[1],s)])});case"brush":if(s){const{borders:l}=qt(o,0),p=Qe(l.x+n[0]-a[0],s)-l.x,h=Qe(l.y+n[1]-a[1],s)-l.y;return _t(it({},o),{points:o.points.map(d=>d.map(([x,L])=>[x+p,L+h]))})}else return _t(it({},o),{points:o.points.map(l=>l.map(([p,h])=>[p+n[0]-a[0],h+n[1]-a[1]]))})}},uf=({ctx:n,shape:o,scaleRatio:a=1,canvasOffset:s,selectionPadding:l,selectionWidth:p,selectionColor:h,withAnchors:d=!0})=>{const{center:x}=qt(o,l);switch(Za(n,a,s,o.rotation,x),o.type){case"polygon":case"line":case"curve":Gc({ctx:n,shape:o,withAnchors:d,selectionPadding:l,selectionWidth:p,selectionColor:h,currentScale:a});break;default:ef({ctx:n,shape:o,withAnchors:d,selectionPadding:l,selectionWidth:p,selectionColor:h,currentScale:a});break}n.restore()},sf=(n,o)=>_t(it({},vi([20,20],n,[0,0],o)),{id:C.uniqueId(`${n.type}_`)}),ch="",cf=({disabled:n=!1,scaleRatio:o,shape:a,defaultValue:s,updateValue:l,saveShapes:p,selectionPadding:h})=>{var k,V,N,O,Y,M,T,z,K,ct;const d=A.useRef(null),x=A.useRef(p),L=at=>{l(Rc(at.target.innerHTML))};A.useEffect(()=>{if(!d.current)return;const at=d.current,H=J=>{var et;J.preventDefault();const F=(et=J.clipboardData)==null?void 0:et.getData("text/plain");document.execCommand("insertText",!1,F)};return at.addEventListener("paste",H),at.innerHTML=jc(s),at.focus(),()=>{at.removeEventListener("paste",H)}},[s]),A.useEffect(()=>{const at=x.current;return()=>{at()}},[]);const Q=A.useMemo(()=>{const{borders:at,center:H}=qt(a,h);return rn({point:[at.x,at.y],rotation:-a.rotation,origin:H})},[a,h]);return _.jsx("div",{className:"react-paint-editor-toolbox-edittextbox",ref:d,"data-fontbold":(V=(k=a.style)==null?void 0:k.fontBold)!=null?V:!1,"data-fontitalic":(O=(N=a.style)==null?void 0:N.fontItalic)!=null?O:!1,contentEditable:!n,onInput:L,style:{"--react-paint-editor-toolbox-edittextbox-transform":`translate3D(${Q[0]*o}px, ${Q[1]*o}px, 0) rotate(${Ya(a.rotation)}deg)`,"--react-paint-editor-toolbox-edittextbox-fontsize":`${a.fontSize*o}px`,"--react-paint-editor-toolbox-edittextbox-padding":`${h*o}px`,"--react-paint-editor-toolbox-edittextbox-color":(M=(Y=a.style)==null?void 0:Y.strokeColor)!=null?M:"inherit","--react-paint-editor-toolbox-edittextbox-opacity":((z=(T=a.style)==null?void 0:T.globalAlpha)!=null?z:100)/100,"--react-paint-editor-toolbox-edittextbox-fontfamily":(ct=(K=a.style)==null?void 0:K.fontFamily)!=null?ct:jn}})},lf=(n,o,a,s)=>{if(n.mode==="translate")return{mode:"translate",cursorStartPosition:a,originalShape:o};if(n.mode==="rotate"){const{center:l}=qt(o,s),p=[l[0],l[1]];return{mode:"rotate",cursorStartPosition:a,originalShape:o,center:p}}else if(n.mode==="resize")return{mode:"resize",cursorStartPosition:a,originalShape:o,anchor:n.anchor}},ff=(n,o,a,s,l,p)=>{if(l){const d=io(l,o,s,p,a,!0)||{mode:"default"},x=lf(d,l,o,p);if((x==null?void 0:x.mode)==="resize"||(x==null?void 0:x.mode)==="rotate")return{shape:l,mode:x}}const h=C.find(d=>!!io(d,o,s,p,a,!1),n);return h?{shape:h,mode:{mode:"translate",cursorStartPosition:o,originalShape:h}}:{shape:void 0,mode:{mode:"default"}}},df=300,pf=()=>{const n=A.useRef(void 0),o=A.useRef(void 0),a=p=>{var d;const h=new Date().getTime();n.current&&h<n.current+df&&((d=o.current)==null||d.call(o,p)),n.current=new Date().getTime()};return{registerDoubleClickEvent:(p,h)=>{o.current=h,p.addEventListener("click",a),p.addEventListener("touchend",a)},unRegisterDoubleClickEvent:p=>{p.removeEventListener("click",a),p.removeEventListener("touchend",a)}}},hf=(n,o,a,s,l,p,h,d,x,L,Q,k,V,N,O,Y,M)=>{var z;if(a.type==="move"&&d!==void 0){const K=oo(n,o.current,x,L,Q);N([K[0]-d[0],K[1]-d[1]])}if(p==null||p.locked)return;const T=oo(n,o.current,x,L,Q);if(h.mode==="default"||h.mode==="textedition"){const K=io(p,T,l,Y,Q,!0)||{mode:"default"};k(K)}else{const K=(z=o.current)==null?void 0:z.getContext("2d");if(!K)return;const ct=Bc(K,p,T,s,l,h,Y,M);V(ct),O(ct)}},gf=({disabled:n=!1,addShape:o,canvasSize:a,drawCanvasRef:s,setActiveTool:l,shapes:p,selectionMode:h,activeTool:d,isInsideComponent:x,setCanvasOffset:L,selectedShape:Q,selectionCanvasRef:k,canvasOffsetStartPosition:V,setSelectedShape:N,setCanvasOffsetStartPosition:O,updateSingleShape:Y,gridFormat:M,canvasOffset:T,saveShapes:z,setSelectionMode:K,selectionPadding:ct,isShiftPressed:at})=>{const{width:H,height:J,scaleRatio:F}=a,[et,yt]=A.useState({mode:"default"}),{registerDoubleClickEvent:It,unRegisterDoubleClickEvent:Ut}=pf();return A.useEffect(()=>{const ut=pt=>window.requestAnimationFrame(()=>hf(pt,k,d,M,T,Q,h,V,H,J,F,yt,Y,L,N,ct,at));return x&&(document.addEventListener("mousemove",ut),document.addEventListener("touchmove",ut)),()=>{x&&(document.removeEventListener("mousemove",ut),document.removeEventListener("touchmove",ut))}},[x,k,Q,h,yt,M,T,V,H,J,F,Y,d,L,N,ct,at]),A.useEffect(()=>{const ut=()=>{h.mode!=="textedition"&&h.mode!=="default"&&(K({mode:"default"}),z())};return x&&(document.addEventListener("mouseup",ut),document.addEventListener("touchend",ut)),()=>{x&&(document.removeEventListener("mouseup",ut),document.removeEventListener("touchend",ut))}},[x,h,z,K]),A.useEffect(()=>{const ut=k.current;if(!ut||n)return;const pt=lt=>{var Tt;lt.preventDefault();const Ct=oo(lt,k.current,H,J,F);if(d.type==="selection"){const{shape:Mt,mode:Rt}=ff(p,Ct,F,T,Q,ct);N(Mt),K(Rt)}else d.type==="move"&&O(Ct);if(Ha.includes(d.type)){const Mt=(Tt=s.current)==null?void 0:Tt.getContext("2d");if(!Mt)return;if(d.type==="brush"){if(Q){const Rt=Nc(Q,Ct);Y(Rt),N(Rt)}else{const Rt=Tu(Mt,d,Ct,M);if(!Rt)return;o(Rt),N(Rt)}K({mode:"brush"})}else{const Rt=Tu(Mt,d,Ct,M);if(!Rt)return;o(Rt),l(yr),N(Rt),K({mode:"resize",cursorStartPosition:Ct,originalShape:Rt,anchor:d.type==="line"||d.type==="polygon"||d.type==="curve"?0:[1,1]})}}};return ut.addEventListener("mousedown",pt,{passive:!1}),ut.addEventListener("touchstart",pt,{passive:!1}),()=>{ut.removeEventListener("mousedown",pt),ut.removeEventListener("touchstart",pt)}},[n,k,s,Q,d,T,O,p,H,J,F,Y,o,l,N,K,ct,M]),A.useEffect(()=>{const ut=k.current;if(!ut)return;const pt=lt=>{if(d.type==="selection"&&(Q==null?void 0:Q.type)==="text"){const Ct=oo(lt,k.current,H,J,F);io(Q,Ct,T,ct)&&K({mode:"textedition",defaultValue:Q.value})}};if(x)return It(ut,pt),()=>{Ut(ut)}},[It,Ut,x,k,d,Q,H,J,F,T,K,ct]),{hoverMode:et}},vf=(n,o,a,s,l,p)=>{n.strokeStyle="rgb(220,220,220)",n.lineWidth=1,n.save(),n.scale(s,s),n.beginPath();const h=Fr[p-1],d=-l[0]%h,x=-l[1]%h,L=Math.ceil(o/s/h),Q=Math.ceil(a/s/h);for(let k=0;k<L;k++)n.moveTo(d+(k+1)*h,x),n.lineTo(d+(k+1)*h,x+a/s);for(let k=0;k<Q;k++)n.moveTo(d,x+(k+1)*h),n.lineTo(d+o/s,x+(k+1)*h);n.stroke(),n.restore()},lh="",yf=(n,o,a,s,l,p,h,d)=>{const{width:x,height:L,scaleRatio:Q}=a;n.clearRect(0,0,x,L),Fa(n),s&&vf(n,x,L,Q,l,s);for(let k=p.length-1;k>=0;k--)(o.mode!=="textedition"||p[k]!==d)&&Ou(n,p[k],Q,l,h)},mf=(n,o,a,s,l,p,h,d,x)=>{const{width:L,height:Q,scaleRatio:k}=a;n.clearRect(0,0,L,Q),x&&s.type!=="brush"&&uf({ctx:n,shape:x,scaleRatio:k,canvasOffset:l,selectionPadding:p,selectionWidth:h,selectionColor:d,withAnchors:o.mode!=="textedition"})},_f=A.forwardRef(({gridFormat:n,canGrow:o,disabled:a=!1,canvasSize:s,shapes:l,addShape:p,updateSingleShape:h,selectedShape:d,setSelectedShape:x,saveShapes:L,activeTool:Q,setActiveTool:k,canvasOffsetStartPosition:V,setCanvasOffsetStartPosition:N,canvasOffset:O,setCanvasOffset:Y,isInsideComponent:M,selectionMode:T,setSelectionMode:z,selectionWidth:K,selectionColor:ct,selectionPadding:at,isEditMode:H,isShiftPressed:J},F)=>{const et=A.useRef(null),yt=A.useRef(null);A.useImperativeHandle(F,()=>et.current);const{hoverMode:It}=gf({disabled:a,addShape:p,canvasSize:s,drawCanvasRef:et,setActiveTool:k,shapes:l,selectionMode:T,activeTool:Q,isInsideComponent:M,setCanvasOffset:Y,selectedShape:d,selectionCanvasRef:yt,canvasOffsetStartPosition:V,setSelectedShape:x,setCanvasOffsetStartPosition:N,updateSingleShape:h,gridFormat:n,canvasOffset:O,saveShapes:L,setSelectionMode:z,selectionPadding:at,isShiftPressed:J}),Ut=A.useCallback(ut=>{var Ct;if((d==null?void 0:d.type)!=="text")return;const pt=(Ct=et.current)==null?void 0:Ct.getContext("2d");if(!pt)return;const lt=il(pt,d,ut,O);h(lt)},[h,d,O]);return A.useEffect(()=>{var pt;const ut=(pt=et.current)==null?void 0:pt.getContext("2d");ut&&window.requestAnimationFrame(()=>yf(ut,T,s,n,O,l,at,d))},[l,n,T,d,O,s,at]),A.useEffect(()=>{var pt;const ut=(pt=yt.current)==null?void 0:pt.getContext("2d");ut&&window.requestAnimationFrame(()=>mf(ut,T,s,Q,O,at,K,ct,d))},[T,d,Q,O,s,at,K,ct]),_.jsx("div",{className:"react-paint-editor-canvas-box",children:_.jsxs("div",{className:"react-paint-editor-canvas-container","data-grow":o,children:[_.jsx("canvas",{className:"react-paint-editor-canvas-drawcanvas",ref:et,"data-grow":o,width:s.width,height:s.height}),H&&_.jsx("canvas",{className:"react-paint-editor-canvas-selectioncanvas",ref:yt,width:s.width,height:s.height,"data-grow":o,style:{"--react-paint-editor-canvas-cursor":Q.type!=="selection"&&Q.type!=="move"||It.mode==="resize"?"crosshair":Q.type==="move"||It.mode==="translate"?"move":It.mode==="rotate"?"grab":"default"}}),H&&T.mode==="textedition"&&(d==null?void 0:d.type)==="text"&&_.jsx(cf,{scaleRatio:s.scaleRatio,disabled:a,shape:d,defaultValue:T.defaultValue,updateValue:Ut,saveShapes:L,selectionPadding:at})]})})}),bf=({disabled:n=!1,ref:o,shape:a,layoutDragging:s,setLayoutDragging:l,handleSelect:p,onMoveShapes:h})=>{const[d,x]=A.useState(!1);return A.useEffect(()=>{s||x(!1)},[s]),A.useEffect(()=>{const L=o.current;if(!L)return;const Q=()=>{l(void 0)},k=M=>(M.preventDefault&&M.preventDefault(),!1),V=M=>{p(a),M.dataTransfer&&(M.dataTransfer.effectAllowed="move",M.dataTransfer.setData("draggableShapeId",a.id),l(a.id))},N=()=>{s!==a.id&&x(!0)},O=()=>{x(!1)},Y=M=>(M.stopPropagation(),M.dataTransfer&&h(M.dataTransfer.getData("draggableShapeId"),a.id),!1);return n||(L.addEventListener("dragstart",V),L.addEventListener("dragend",Q),L.addEventListener("dragover",k),L.addEventListener("dragenter",N),L.addEventListener("dragleave",O),L.addEventListener("drop",Y)),()=>{n||(L.removeEventListener("dragstart",V),L.removeEventListener("dragend",Q),L.removeEventListener("dragover",k),L.removeEventListener("dragenter",N),L.removeEventListener("dragleave",O),L.removeEventListener("drop",Y))}},[n,o,a,l,p,h,s]),{isOver:d}},xf=n=>{switch(n){case"brush":return cu;case"line":return pu;case"polygon":return fi;case"curve":return hu;case"rect":return so;case"square":return so;case"circle":return co;case"ellipse":return co;case"text":return du;case"picture":return di}},fh="",Ft=A.forwardRef((n,o)=>{if(n.type==="file"||n.type==="color"){const a=n,{hidden:l=!1,disabled:p=!1,selected:h=!1,icon:d,children:x,className:L="",title:Q,onClick:k}=a,V=Wa(a,["hidden","disabled","selected","icon","children","className","title","onClick"]);return _.jsxs("label",{className:`react-paint-editor-button ${L}`,title:Q,onClick:k,"data-disabled":+p,"data-selected":+h,"data-hidden":+l,children:[_.jsx("input",it({ref:o,disabled:p},V)),_.jsxs("span",{className:"react-paint-editor-button-content",children:[x&&_.jsx("span",{className:"react-paint-editor-button-children",children:x}),d&&_.jsx("span",{className:"react-paint-editor-button-icon",dangerouslySetInnerHTML:{__html:d}})]})]})}else{const s=n,{hidden:l=!1,disabled:p=!1,selected:h=!1,icon:d,children:x,type:L="button",className:Q=""}=s,k=Wa(s,["hidden","disabled","selected","icon","children","type","className"]);return _.jsx("button",_t(it({className:`react-paint-editor-button ${Q}`,ref:o,disabled:p,"data-disabled":+p,"data-selected":+h,"data-hidden":+l,type:L},k),{children:_.jsxs("span",{className:"react-paint-editor-button-content",children:[x&&_.jsx("span",{className:"react-paint-editor-button-children",children:x}),d&&_.jsx("span",{className:"react-paint-editor-button-icon",dangerouslySetInnerHTML:{__html:d}})]})}))}}),dh="",cn=({children:n,title:o="",className:a="",position:s="bottom",fitContainer:l=!1,alignment:p="center"})=>_.jsxs("div",{className:`react-paint-editor-panel ${a}`,"data-fitcontainer":l,"data-position":s,"data-alignment":p,style:{"--react-paint-editor-panel-zindex":In.PANEL},children:[o&&_.jsx("h3",{className:"react-paint-editor-panel-title",children:o}),n]}),ph="",Qf=({disabled:n=!1,shape:o,selected:a,layoutDragging:s,toggleShapeVisibility:l,toggleShapeLock:p,setLayoutDragging:h,handleRemove:d,handleSelect:x,onMoveShapes:L})=>{const Q=A.useRef(null),k=M=>{n||(M.preventDefault(),M.stopPropagation(),d(o))},V=M=>{n||(M.preventDefault(),M.stopPropagation(),x(o))},N=M=>{n||(M.preventDefault(),M.stopPropagation(),l(o))},O=M=>{n||(M.preventDefault(),M.stopPropagation(),p(o))},{isOver:Y}=bf({disabled:n,ref:Q,shape:o,layoutDragging:s,setLayoutDragging:h,handleSelect:x,onMoveShapes:L});return _.jsxs("div",{className:"react-paint-editor-layout","data-disabled":+n,draggable:!n,"data-is-dragging":+(s===o.id),"data-is-over":+Y,onClick:V,"data-selected":+a,ref:Q,children:[_.jsx("span",{dangerouslySetInnerHTML:{__html:xf(o.type)}}),_.jsx("span",{children:o.id}),_.jsx("div",{className:"react-paint-editor-layouts-separator"}),_.jsx(Ft,{className:"react-paint-editor-layouts-visible-button",title:o.visible?"Hide":"Show","data-visible":o.visible!==!1,disabled:n,selected:a,onClick:N,icon:o.visible===!1?kl:Ll}),_.jsx(Ft,{className:"react-paint-editor-layouts-locked-button",title:o.locked?"Locked":"Unlocked","data-locked":!!o.locked,disabled:n,selected:a,onClick:O,icon:o.locked?Rl:Tl}),_.jsx(Ft,{className:"react-paint-editor-layouts-remove-button",title:"Remove",disabled:n,onClick:k,icon:lu})]})},wf=({gridFormat:n,setGridFormat:o,disabled:a=!1,shapes:s,removeShape:l,toggleShapeVisibility:p,toggleShapeLock:h,selectedShape:d,moveShapes:x,selectShape:L,isLayoutPanelShown:Q})=>{const[k,V]=A.useState(void 0);return Q?_.jsx(cn,{alignment:"right",className:"react-paint-editor-layouts-panel",children:_.jsx("div",{className:"react-paint-editor-layouts-panel-content",children:_.jsxs("div",{className:"react-paint-editor-layouts-scrolling-content",children:[_.jsxs("div",{className:"react-paint-editor-layouts-row",children:[_.jsx("span",{className:"react-paint-editor-layouts-subtitle",children:"Grid"}),_.jsx(Ft,{icon:Ol,className:"react-paint-editor-layouts-grid-button",selected:n===0,disabled:a,onClick:()=>o(0)}),["S","M","L"].map((N,O)=>_.jsx(Ft,{className:"react-paint-editor-layouts-grid-button",selected:n===O+1,disabled:a,onClick:()=>o(O+1),children:N},N))]}),_.jsx("hr",{}),_.jsx("div",{className:"react-paint-editor-layouts",children:s.length===0?_.jsx("div",{className:"react-paint-editor-layouts-placeholder",children:"No layer yet"}):C.map(N=>_.jsx(Qf,{shape:N,disabled:a,layoutDragging:k,setLayoutDragging:V,selected:(d==null?void 0:d.id)===N.id,handleSelect:L,handleRemove:l,onMoveShapes:x,toggleShapeVisibility:p,toggleShapeLock:h},N.id),s)})]})})}):null},Cf=(n,o)=>C.flow(C.flatMap(a=>{if(!C.isObject(a))return C.filter({type:a},n);const s=C.filter(l=>C.includes(l.type,a.toolsType),n);return s?_t(it({},a),{toolsType:s}):null}),C.compact)(o),Du=(n,o=!1)=>{const a=(s,l)=>{if(C.isArray(s))return l};return C.flow(C.map(s=>{if(!C.isObject(s))return null;switch(C.get("type",s)){case"brush":return C.mergeWith(a,bu,s);case"circle":return C.mergeWith(a,Au,s);case"curve":return C.mergeWith(a,wu,s);case"ellipse":return C.mergeWith(a,Lu,s);case"line":return C.mergeWith(a,xu,s);case"polygon":return C.mergeWith(a,Qu,s);case"rect":return C.mergeWith(a,Cu,s);case"square":return C.mergeWith(a,Eu,s);case"text":return C.mergeWith(a,ku,s)}return null}),s=>o?[...s,pi]:s,C.compact)(n)},De=({type:n,img:o,isActive:a,withText:s=!1,disabled:l=!1,setActive:p})=>{var d;const h=()=>{p(n)};return _.jsx(Ft,{disabled:l,selected:a,onClick:h,title:(d=n.label)!=null?d:n.type,icon:o,children:s?n.label:void 0})},Wu=(n,o)=>!(n.target instanceof Node)||!o?!1:o.contains(n.target),hh="",Ef=({activeTool:n,alignment:o,group:a,disabled:s=!1,setActiveToolFromId:l})=>{var Y,M;const p=A.useRef(null),[h,d]=A.useState(!1),[,x]=A.useTransition(),[L,Q]=A.useState(void 0),k=T=>{Q(T),l(T.id)};if(A.useEffect(()=>{if(!h)return;const T=z=>{!Wu(z,p.current)&&d(!1)};return document.addEventListener("mousedown",T,{passive:!1}),document.addEventListener("touchstart",T,{passive:!1}),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("touchstart",T)}},[h]),"type"in a)return _.jsx(De,{disabled:s,type:a,img:a.icon,isActive:n.id===a.id,setActive:k});if(C.isEmpty(a.toolsType))return null;if(((Y=a.toolsType)==null?void 0:Y.length)===1)return _.jsx(De,{disabled:s,type:a.toolsType[0],img:a.toolsType[0].icon,isActive:n.id===a.toolsType[0].id,setActive:k});const V=C.find({type:n.type},a==null?void 0:a.toolsType)!==void 0,N=(M=L?L.icon:a.toolsType&&a.toolsType[0]&&a.toolsType[0].icon)!=null?M:a.title,O=()=>{L?l(L.id):a.toolsType&&a.toolsType[0]&&k(a.toolsType[0]),x(()=>{d(!0)})};return _.jsxs("div",{className:"react-paint-editor-toolbargroup-relative",children:[_.jsx(Ft,{selected:V,title:a.title,disabled:s,onClick:O,icon:N}),h&&_.jsx(cn,{alignment:o,position:"top",children:_.jsx("div",{className:"react-paint-editor-toolbargroup-panel-content","data-vertical":+a.vertical,ref:p,children:a.toolsType.map((T,z)=>_.jsx(De,{disabled:s,type:T,img:T.icon,isActive:n.id===T.id,setActive:k},z))})})]})},Vu=({disabled:n=!1,withText:o=!1,loadFile:a,type:s,img:l,accept:p})=>{var L;const h=A.useRef(null),d=Q=>{Q.stopPropagation(),h.current&&(h.current.value="")},x=Q=>{var V;const k=(V=Q.target.files)==null?void 0:V.item(0);k&&a(k)};return _.jsx(Ft,{ref:h,type:"file",onClick:d,onChange:x,accept:p,title:(L=s.label)!=null?L:s.type,icon:l,children:o?s.label:void 0,disabled:n})},gh="",Af=({activeTool:n,withActionsInMenu:o,hasActionToUndo:a=!1,hasActionToRedo:s=!1,hasActionToClear:l=!1,undoAction:p,redoAction:h,clearCanvas:d,alignment:x,group:L,vertical:Q=!1,disabled:k=!1,withLoadAndSave:V,withExport:N,addPicture:O,loadFile:Y,togglePictureUrlModal:M,saveFile:T,exportCanvasInFile:z,withUploadPicture:K,withUrlPicture:ct})=>{var pt;const[at,H]=A.useState(!1),[,J]=A.useTransition(),F=lt=>{H(!1),Y(lt)},et=lt=>gr(this,null,function*(){H(!1),yield O(lt)}),yt=()=>{J(()=>{H(!0)})},It=C.includes(n.type,L==null?void 0:L.tools),Ut=(pt=It?n.icon:L.img)!=null?pt:L.title;return A.useEffect(()=>{if(!at)return;const lt=()=>{H(!1)};return document.addEventListener("click",lt),()=>{document.removeEventListener("click",lt)}},[at]),o||K||ct||V||N?_.jsxs("div",{className:"react-paint-editor-toolbox-relative",children:[_.jsx(Ft,{selected:It,title:L.title,disabled:k,onClick:yt,icon:Ut}),at&&_.jsx(cn,{alignment:x,position:"top",children:_.jsxs("div",{className:"react-paint-editor-toolbox-panel-content","data-vertical":+Q,children:[o&&_.jsxs(_.Fragment,{children:[_.jsx(De,{withText:!0,type:an,disabled:k||!a,img:an.icon,isActive:n.id===an.id,setActive:p}),_.jsx(De,{withText:!0,type:un,disabled:k||!s,img:un.icon,isActive:n.id===un.id,setActive:h}),_.jsx(De,{withText:!0,type:sn,disabled:k||!l,img:sn.icon,isActive:n.id===sn.id,setActive:d}),(K||ct||V)&&_.jsx("hr",{})]}),K&&_.jsx(Vu,{withText:!0,type:Iu,disabled:k,loadFile:et,img:Iu.icon,accept:"image/png, image/gif, image/jpeg, image/svg+xml"}),ct&&_.jsx(Ft,{disabled:k,selected:!1,onClick:M,title:"Add picture from URL",icon:Il,children:"Add picture from URL"}),(K||ct)&&V&&_.jsx("hr",{}),V&&_.jsxs(_.Fragment,{children:[_.jsx(Vu,{withText:!0,type:ju,disabled:k,loadFile:F,img:ju.icon,accept:"application/JSON"}),_.jsx(De,{withText:!0,disabled:k,type:gi,img:gi.icon,isActive:n.id===gi.id,setActive:T})]}),N&&_.jsx(De,{withText:!0,disabled:k,type:hi,img:hi.icon,isActive:n.id===hi.id,setActive:z})]})})]}):null},vh="",yi=({children:n,onClose:o,position:a="center",className:s=""})=>_.jsxs("div",{className:"react-paint-editor-modal","data-position":a,style:{"--react-paint-editor-modal-zindex":In.PANEL},children:[_.jsx("div",{className:"react-paint-editor-modal-mask",onClick:o}),_.jsx("div",{className:`react-paint-editor-modal-panel ${s}`,children:n})]}),yh="",Lf=({togglePictureUrlModal:n,addPicture:o})=>{const a=A.useRef(null),s=l=>gr(this,null,function*(){var h;l.preventDefault();const p=(h=a.current)==null?void 0:h.value;p&&(yield o(p),n())});return A.useEffect(()=>{a.current&&a.current.focus()},[]),_.jsx(yi,{className:"react-paint-editor-toolbox-pictureinput-modal",onClose:n,children:_.jsxs("form",{onSubmit:s,children:[_.jsxs("label",{children:["URL ",_.jsx("input",{type:"text",ref:a})]}),_.jsx(Ft,{onClick:n,children:"Annuler"}),_.jsx(Ft,{type:"submit",selected:!0,children:"Ajouter"})]})})},mh="",Mu=40,kf=[{title:"brush",toolsType:["brush"],vertical:!1},{title:"lines",toolsType:["line","curve","polygon"],vertical:!1},{title:"shapes",toolsType:["rect","square","circle","ellipse"],vertical:!1},"text"],jf=({width:n,disabled:o=!1,activeTool:a,hasActionToUndo:s=!1,hasActionToRedo:l=!1,hasActionToClear:p=!1,withLoadAndSave:h,withExport:d,clearCanvas:x,setActiveTool:L,undoAction:Q,redoAction:k,addPicture:V,loadFile:N,saveFile:O,exportCanvasInFile:Y,availableTools:M,withUrlPicture:T,withUploadPicture:z})=>{const K=Cf(M,kf),ct=(5+K.length)*Mu,at=(2+K.length)*Mu,[H,J]=A.useState(!1),[F,et]=A.useState(!1),[yt,It]=A.useState(n<ct),[Ut,ut]=A.useState(n<at),pt=()=>{J(Ot=>!Ot)},lt=()=>{et(!0)},Ct=()=>{et(Ot=>!Ot)},Tt=Ot=>{L(Ot),J(!1)},Mt=Ot=>{var Xt;Tt((Xt=M.find($e=>$e.id===Ot))!=null?Xt:a)};A.useEffect(()=>{It(n<ct),ut(n<at)},[n,ct,at]);const Rt=C.find({type:a},M)!==void 0;return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"react-paint-editor-toolbar-toolbox",children:[_.jsxs("div",{className:"react-paint-editor-toolbar-shrinkable",children:[_.jsx(De,{type:yr,disabled:o,img:yr.icon,isActive:a.id===yr.id,setActive:Tt}),Ut?_.jsx(Ft,{disabled:o,onClick:pt,title:"Toggle tools",icon:yl,selected:Rt}):K.map((Ot,Xt)=>_.jsx(Ef,{disabled:o,activeTool:a,group:Ot,setActiveToolFromId:Mt},Xt))]}),!yt&&_.jsxs(_.Fragment,{children:[_.jsx(De,{type:an,disabled:o||!s,img:an.icon,isActive:a.id===an.id,setActive:Q}),_.jsx(De,{type:un,disabled:o||!l,img:un.icon,isActive:a.id===un.id,setActive:k}),_.jsx(De,{type:sn,disabled:o||!p,img:sn.icon,isActive:a.id===sn.id,setActive:x})]}),_.jsx(Af,{withActionsInMenu:yt,disabled:o,vertical:!0,alignment:"right",group:{title:"Menu",img:Al},activeTool:a,addPicture:V,loadFile:N,saveFile:O,togglePictureUrlModal:lt,exportCanvasInFile:Y,withUploadPicture:z,withUrlPicture:T,withLoadAndSave:h,withExport:d,hasActionToUndo:s,hasActionToRedo:l,hasActionToClear:p,undoAction:Q,redoAction:k,clearCanvas:x})]}),H&&_.jsx(yi,{className:"react-paint-editor-toolbar-modal",onClose:pt,children:M.map((Ot,Xt)=>Ot.type==="picture"?null:_.jsx(De,{disabled:o,type:Ot,img:Ot.icon,withText:!1,isActive:a.id===Ot.id,setActive:Tt},Xt))}),F&&_.jsx(Lf,{togglePictureUrlModal:Ct,addPicture:V})]})},_h="",lo=({selectedSettings:n,setSelectedSettings:o,title:a="Choisissez une couleur",mode:s="fill",disabled:l=!1,values:p,field:h,value:d="",valueChanged:x})=>{const[L]=A.useState(C.uniqueId("settings_")),Q=O=>{const Y=C.toNumber(O.target.value);x(h,C.isNaN(Y)?O.target.value:Y)},k=O=>{x(h,O)},V=()=>{o(O=>O===L?void 0:L)},N=n===L;return C.isEmpty(p)?null:_.jsxs(_.Fragment,{children:[_.jsx(Ft,{selected:N,title:a,disabled:l,onClick:V,icon:d==="transparent"?s==="fill"?_u:mu:void 0,children:d!=="transparent"&&_.jsx("div",{className:"react-paint-editor-colorfield-color","data-mode":s,style:{"--react-paint-editor-colorfield-color-value":d}})}),N&&_.jsx(cn,{title:a,alignment:"left",children:_.jsxs("div",{className:"react-paint-editor-colorfield-wrapper",children:[p.map((O,Y)=>_.jsx(Ft,{title:O,selected:O===d,color:O,icon:O==="transparent"?s==="fill"?_u:mu:void 0,onClick:()=>k(O),children:O!=="transparent"&&_.jsx("div",{className:"react-paint-editor-colorfield-color",color:O,"data-mode":s,style:{"--react-paint-editor-colorfield-color-value":O}})},Y)),_.jsx(Ft,{type:"color",title:"Custom color",selected:!C.includes(d,p),value:d,onChange:Q,children:_.jsx("div",{className:"react-paint-editor-colorfield-customcolor",style:{"--react-paint-editor-colorfield-color-value":C.includes(d,p)?"var(--react-paint-editor-app-font-color)":d},children:_.jsx("span",{dangerouslySetInnerHTML:{__html:jl}})})})]})})]})},If=({disabled:n=!1,selectedShape:o,removeShape:a})=>{const s=()=>{a(o)};return _.jsx(Ft,{title:"Delete",disabled:n,"data-disabled":+n,onClick:s,icon:lu})},bh="",Rf=({disabled:n,toggleLayoutPanel:o})=>_.jsx(Ft,{title:"Toggle layers panel",disabled:n,onClick:o,icon:bl,className:"react-paint-editor-layout-button"}),xh="",Rn=({selectedSettings:n,setSelectedSettings:o,title:a="Choisissez l'intervalle",icon:s,disabled:l=!1,field:p,value:h=1,min:d=1,max:x=20,step:L=1,unity:Q="",valueChanged:k})=>{const V=Math.round(h),[N]=A.useState(C.uniqueId("settings_")),O=T=>{const z=C.toNumber(T.target.value);k(p,C.isNaN(z)?T.target.value:z)},Y=()=>{o(T=>T===N?void 0:N)},M=n===N;return d===x?null:_.jsxs(_.Fragment,{children:[_.jsx(Ft,{selected:M,title:a,disabled:l,icon:s,onClick:Y}),M&&_.jsx(cn,{title:a,alignment:"left",fitContainer:!0,children:_.jsx("div",{children:_.jsxs("label",{className:"react-paint-editor-rangefield",children:[_.jsx("input",{type:"range",min:d,max:x,step:L,value:h,onChange:O}),_.jsxs("span",{children:[V,Q]})]})})})]})},Qh="",mi=({CustomOption:n,selectedSettings:o,setSelectedSettings:a,title:s="Choisissez l'option",disabled:l=!1,field:p,icon:h,values:d,defaultValue:x,valueChanged:L})=>{const[Q]=A.useState(C.uniqueId("settings_")),k=O=>{L(p,O)},V=()=>{a(O=>O===Q?void 0:Q)},N=o===Q;return C.isEmpty(d)?null:_.jsxs(_.Fragment,{children:[_.jsx(Ft,{selected:N,title:s,icon:h,disabled:l,onClick:V}),N&&_.jsx(cn,{title:s,alignment:"left",fitContainer:!0,children:_.jsx("div",{className:"react-paint-editor-selectfield-wrapper",children:d.map(O=>_.jsx(Ft,{title:`${O}`,onClick:()=>k(O),selected:x==O,style:{"--react-paint-editor-button-padding":"16px"},children:_.jsx(n,{children:O})},O))})})]})},wh="",Tf=({children:n})=>_.jsx("span",{className:"react-paint-editor-fontfamily-option",style:{"--react-paint-editor-fontfamily-family":n},children:n}),Nu=({selectedSettings:n,setSelectedSettings:o,disabled:a=!1,values:s,defaultValue:l,valueChanged:p})=>C.isEmpty(s)?null:_.jsx(mi,{selectedSettings:n,setSelectedSettings:o,CustomOption:Tf,title:"Police",icon:Wl,disabled:a,field:"fontFamily",values:s,defaultValue:l,valueChanged:p}),Hu=({selectedSettings:n,setSelectedSettings:o,disabled:a=!1,min:s,max:l,step:p,value:h,valueChanged:d})=>s===l?null:_.jsx(Rn,{selectedSettings:n,setSelectedSettings:o,icon:fi,title:"Nombre de points",disabled:a,field:"pointsCount",min:s,max:l,step:p,unity:"",value:h,valueChanged:d}),Ch="",Of=({children:n})=>_.jsxs("span",{className:"react-paint-editor-linetype-option","data-type":n,children:[_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{})]}),Bu=({selectedSettings:n,setSelectedSettings:o,disabled:a=!1,values:s,defaultValue:l,valueChanged:p})=>C.isEmpty(s)?null:_.jsx(mi,{selectedSettings:n,setSelectedSettings:o,CustomOption:Of,icon:Dl,title:"Type de traits",disabled:a,field:"lineDash",values:s,defaultValue:l,valueChanged:p}),Eh="",Df=({children:n})=>_.jsxs("span",{className:"react-paint-editor-linearrow-option","data-type":n,children:[_.jsx("span",{className:"react-paint-editor-linearrow-left"}),_.jsx("span",{className:"react-paint-editor-linearrow-right"})]}),Fu=({selectedSettings:n,setSelectedSettings:o,disabled:a=!1,values:s,defaultValue:l,valueChanged:p})=>C.isEmpty(s)?null:_.jsx(mi,{selectedSettings:n,setSelectedSettings:o,CustomOption:Df,title:"Flèches",icon:Vl,disabled:a,field:"lineArrow",values:s,defaultValue:l,valueChanged:p}),fo=({setSelectedSettings:n,disabled:o=!1,field:a,icon:s,values:l,value:p=!1,valueChanged:h})=>{const[d]=A.useState(C.uniqueId("settings_")),x=()=>{n(L=>L===d?void 0:d),h(a,!p)};return l.length!==2?null:_.jsx(Ft,{onClick:x,selected:p,disabled:o,icon:s})},Ah="",Wf=40,_i=({activeTool:n,selectedShape:o,selectedShapeTool:a,disabled:s,selectedSettings:l,setSelectedSettings:p,handleShapeStyleChange:h,handlePolygonLinesCount:d,handleShapeFontFamilyChange:x})=>{var L,Q,k,V,N,O,Y,M,T,z,K;return o?_.jsx(_.Fragment,{children:a&&_.jsxs(_.Fragment,{children:["strokeColor"in a.settings&&_.jsx(lo,{selectedSettings:l,setSelectedSettings:p,title:"Couleur du trait",mode:"stroke",disabled:s,field:"strokeColor",value:(L=o.style)==null?void 0:L.strokeColor,valueChanged:h,values:a.settings.strokeColor.values}),"fillColor"in a.settings&&_.jsx(lo,{selectedSettings:l,setSelectedSettings:p,title:"Couleur de fond",disabled:s,field:"fillColor",value:(Q=o.style)==null?void 0:Q.fillColor,valueChanged:h,values:a.settings.fillColor.values}),"lineWidth"in a.settings&&_.jsx(Rn,{selectedSettings:l,setSelectedSettings:p,title:"Epaisseur du trait",icon:yu,disabled:s,field:"lineWidth",value:(k=o.style)==null?void 0:k.lineWidth,valueChanged:h,unity:"px",min:a.settings.lineWidth.min,max:a.settings.lineWidth.max,step:a.settings.lineWidth.step}),"lineDash"in a.settings&&_.jsx(Bu,{selectedSettings:l,setSelectedSettings:p,disabled:s,defaultValue:(V=o.style)==null?void 0:V.lineDash,valueChanged:h,values:a.settings.lineDash.values}),"lineArrow"in a.settings&&_.jsx(Fu,{selectedSettings:l,setSelectedSettings:p,disabled:s,defaultValue:(N=o.style)==null?void 0:N.lineArrow,valueChanged:h,values:a.settings.lineArrow.values}),"pointsCount"in a.settings&&_.jsx(Hu,{selectedSettings:l,setSelectedSettings:p,disabled:s,valueChanged:d,min:a.settings.pointsCount.min,max:a.settings.pointsCount.max,step:a.settings.pointsCount.step,value:(O=o.style)==null?void 0:O.pointsCount}),"fontFamily"in a.settings&&_.jsx(Nu,{selectedSettings:l,setSelectedSettings:p,disabled:s,valueChanged:x,values:a.settings.fontFamily.values,defaultValue:(Y=o.style)==null?void 0:Y.fontFamily}),"fontBold"in a.settings&&_.jsx(fo,{setSelectedSettings:p,disabled:s,field:"fontBold",icon:gu,valueChanged:x,values:a.settings.fontBold.values,value:(M=o.style)==null?void 0:M.fontBold}),"fontItalic"in a.settings&&_.jsx(fo,{setSelectedSettings:p,disabled:s,field:"fontItalic",icon:vu,valueChanged:x,values:a.settings.fontItalic.values,value:(T=o.style)==null?void 0:T.fontItalic}),"opacity"in a.settings&&_.jsx(Rn,{selectedSettings:l,setSelectedSettings:p,title:"Opacité",icon:fu,min:a.settings.opacity.min,max:a.settings.opacity.max,step:a.settings.opacity.step,unity:"%",disabled:s,field:"globalAlpha",value:(K=(z=o.style)==null?void 0:z.globalAlpha)!=null?K:100,valueChanged:h})]})}):"settings"in n?_.jsxs(_.Fragment,{children:["strokeColor"in n.settings&&_.jsx(lo,{selectedSettings:l,setSelectedSettings:p,title:"Couleur du trait",mode:"stroke",disabled:s,field:"strokeColor",value:n.settings.strokeColor.default,valueChanged:h,values:n.settings.strokeColor.values}),"fillColor"in n.settings&&_.jsx(lo,{selectedSettings:l,setSelectedSettings:p,title:"Couleur de fond",disabled:s,field:"fillColor",value:n.settings.fillColor.default,valueChanged:h,values:n.settings.fillColor.values}),"lineWidth"in n.settings&&_.jsx(Rn,{selectedSettings:l,setSelectedSettings:p,title:"Epaisseur du trait",disabled:s,field:"lineWidth",icon:yu,value:n.settings.lineWidth.default,valueChanged:h,unity:"px",min:n.settings.lineWidth.min,max:n.settings.lineWidth.max,step:n.settings.lineWidth.step}),"lineDash"in n.settings&&_.jsx(Bu,{selectedSettings:l,setSelectedSettings:p,disabled:s,defaultValue:n.settings.lineDash.default,valueChanged:h,values:n.settings.lineDash.values}),"lineArrow"in n.settings&&_.jsx(Fu,{selectedSettings:l,setSelectedSettings:p,disabled:s,defaultValue:n.settings.lineArrow.default,valueChanged:h,values:n.settings.lineArrow.values}),"pointsCount"in n.settings&&_.jsx(Hu,{selectedSettings:l,setSelectedSettings:p,disabled:s,valueChanged:d,min:n.settings.pointsCount.min,max:n.settings.pointsCount.max,step:n.settings.pointsCount.step,value:n.settings.pointsCount.default}),"fontFamily"in n.settings&&_.jsx(Nu,{selectedSettings:l,setSelectedSettings:p,disabled:s,valueChanged:x,values:n.settings.fontFamily.values,defaultValue:n.settings.fontFamily.default}),"fontBold"in n.settings&&_.jsx(fo,{setSelectedSettings:p,disabled:s,field:"fontBold",icon:gu,valueChanged:x,values:n.settings.fontBold.values,value:n.settings.fontBold.default}),"fontItalic"in n.settings&&_.jsx(fo,{setSelectedSettings:p,disabled:s,field:"fontItalic",icon:vu,valueChanged:x,values:n.settings.fontItalic.values,value:n.settings.fontItalic.default}),"opacity"in n.settings&&_.jsx(Rn,{selectedSettings:l,setSelectedSettings:p,title:"Opacité",icon:fu,min:n.settings.opacity.min,max:n.settings.opacity.max,step:n.settings.opacity.step,unity:"%",disabled:s,field:"opacity",value:n.settings.opacity.default,valueChanged:h})]}):null},Vf=({width:n,disabled:o=!1,availableTools:a,updateToolSettings:s,layersManipulation:l,toggleLayoutPanel:p,activeTool:h,selectedShape:d,canvas:x,updateShape:L,removeShape:Q})=>{const[k,V]=A.useState(void 0),[N,O]=A.useState(!1),Y=()=>{O(F=>!F)},M=d?C.find({id:d.toolId},a)||C.find({type:d.type},a):void 0,T=(M?C.size(M.settings)+1:"settings"in h?C.size(h.settings):0)+(l?1:0),z=T*Wf,[K,ct]=A.useState(n<z),at=(F,et)=>{d?(L(C.set(["style",F],et,d),!0),s(d.toolId||h.id,F,et)):s(h.id,F,et)},H=(F,et)=>{var yt,It,Ut,ut,pt;if(d){const lt=x==null?void 0:x.getContext("2d");if(!lt)return;const Ct=C.set(["style",F],et,d),Tt=li(lt,Ct.value,Ct.width,(It=(yt=Ct.style)==null?void 0:yt.fontBold)!=null?It:!1,(ut=(Ut=Ct.style)==null?void 0:Ut.fontItalic)!=null?ut:!1,(pt=Ct.style)==null?void 0:pt.fontFamily),Mt=_t(it({},Ct),{fontSize:Tt,height:Tt*Ct.value.length});L(Mt,!0),s(d.toolId||h.id,F,et)}else s(h.id,F,et)},J=(F,et)=>{d?(L(Hc(d,et),!0),s(d.toolId||h.id,F,et)):s(h.id,F,et)};return A.useEffect(()=>{ct(n<z)},[n,z]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"react-paint-editor-settings-bar",children:[K&&T>2&&_.jsx(Ft,{disabled:o,onClick:Y,title:"Toggle settings",icon:Ml}),d?_.jsx(_.Fragment,{children:M&&_.jsxs(_.Fragment,{children:[!K&&_.jsx(_i,{activeTool:h,selectedShape:d,selectedShapeTool:M,disabled:o,selectedSettings:k,setSelectedSettings:V,handleShapeStyleChange:at,handlePolygonLinesCount:J,handleShapeFontFamilyChange:H}),_.jsx(If,{disabled:o,selectedShape:d,removeShape:Q})]})}):!K&&_.jsx(_i,{activeTool:h,selectedShape:d,selectedShapeTool:M,disabled:o,selectedSettings:k,setSelectedSettings:V,handleShapeStyleChange:at,handlePolygonLinesCount:J,handleShapeFontFamilyChange:H}),_.jsx("div",{className:"react-paint-editor-settings-separator"}),l&&_.jsx(Rf,{disabled:o,toggleLayoutPanel:p})]}),N&&_.jsx(yi,{className:"react-paint-editor-settings-modal",onClose:Y,position:"bottom",children:_.jsx(_i,{activeTool:h,selectedShape:d,selectedShapeTool:M,disabled:o,selectedSettings:k,setSelectedSettings:V,handleShapeStyleChange:at,handlePolygonLinesCount:J,handleShapeFontFamilyChange:H})})]})},le={ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Delete:"Delete",Backspace:"Backspace",Escape:"Escape",Shift:"Shift",z:"z",Z:"Z",y:"y",Y:"Y"},po={Copy:"copy",Paste:"paste"},Mf=({gridFormat:n,isInsideComponent:o,selectedShape:a,isEditingText:s,setSelectedShape:l,removeShape:p,pasteShape:h,updateShape:d,backwardShape:x,forwardShape:L,setShiftPressed:Q})=>{const[k,V]=A.useState(void 0);return A.useEffect(()=>{const N=T=>{a&&(s||(T.preventDefault(),V(it({},a))))},O=T=>{k&&(s||(T.preventDefault(),h(sf(k,n))))},Y=T=>{switch(T.key){case le.Shift:Q(!1);break}},M=T=>{if(T.metaKey||T.ctrlKey){if(T.key===le.Z||T.key===le.z){T.preventDefault(),T.stopPropagation(),x();return}else if(T.key===le.Y||T.key===le.y){T.preventDefault(),T.stopPropagation(),L();return}}if(T.key===le.Shift){Q(!0);return}if(!a)return;if(T.key===le.Escape){l(void 0);return}if(s)return;const z={[le.ArrowLeft]:[n?-Fr[n-1]:-1,0],[le.ArrowRight]:[n?Fr[n-1]:1,0],[le.ArrowDown]:[0,n?Fr[n-1]:1],[le.ArrowUp]:[0,n?-Fr[n-1]:-1]};switch(T.key){case le.ArrowLeft:case le.ArrowRight:case le.ArrowDown:case le.ArrowUp:d(vi(z[T.key],a,[0,0],n));break;case le.Delete:case le.Backspace:p(a);break}};return o&&(document.addEventListener("keydown",M),document.addEventListener("keyup",Y),document.addEventListener(po.Copy,N),document.addEventListener(po.Paste,O)),()=>{o&&(document.removeEventListener("keydown",M),document.removeEventListener("keyup",Y),document.removeEventListener(po.Copy,N),document.removeEventListener(po.Paste,O))}},[o,n,k,s,a,d,p,l,h,x,L,Q]),{}},Nf=({disabled:n,componentRef:o})=>{const[a,s]=A.useState(!1);return A.useEffect(()=>{const l=p=>{s(Wu(p,o.current))};return n?s(!1):(document.addEventListener("mousedown",l,{passive:!0}),document.addEventListener("touchstart",l,{passive:!0})),()=>{n||(document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l))}},[n,o]),{isInsideComponent:a}},Hf=(n=C.noop)=>{const o=A.useRef([]),a=A.useRef(n);a.current=n;const[s,l]=A.useState(void 0),[p,h]=A.useState({states:[{shapes:[],selectedShape:void 0}],cursor:0}),d=p.cursor>0,x=p.cursor<p.states.length-1,L=o.current.length>0,Q=A.useCallback(()=>{h(H=>C.isEqual(C.get([H.cursor,"shapes"],H.states),o.current)?H:{states:[...H.states.slice(0,H.cursor+1),{shapes:o.current,selectedShape:s}],cursor:H.cursor+1})},[s]),k=A.useCallback(H=>{o.current=[H,...o.current]},[]),V=A.useCallback((et,...yt)=>gr(this,[et,...yt],function*(H,J=Ir,F=Ir){const It=yield Jl(H,J,F);return k(It),Q(),It}),[k,Q]),N=A.useCallback((H,J=!1)=>{o.current=o.current.map(F=>F.id===(s==null?void 0:s.id)?H:F),l(F=>(F==null?void 0:F.id)===H.id?H:F),J&&Q()},[s,Q]),O=A.useCallback(H=>{const J=H.map(F=>C.omit(["chosen"],F));o.current=J,Q()},[Q]),Y=A.useCallback(H=>{l(J=>(J==null?void 0:J.id)===H.id?void 0:J),o.current=C.remove({id:H.id},o.current),Q()},[Q]),M=A.useCallback(()=>{h(H=>{const J=Math.max(0,H.cursor-1);return o.current=C.get([J,"shapes"],H.states),l(C.get([J,"selectedShape"],H.states)),C.set("cursor",J,H)})},[]),T=A.useCallback(()=>{h(H=>{const J=Math.min(H.states.length-1,H.cursor+1);return o.current=C.get([J,"shapes"],H.states),l(C.get([J,"selectedShape"],H.states)),C.set("cursor",J,H)})},[]),z=A.useCallback((H=[],J=!1)=>{l(void 0),o.current=H,h(F=>J?{states:[{shapes:H,selectedShape:void 0}],cursor:0}:{states:[...F.states.slice(0,F.cursor+1),{shapes:H,selectedShape:void 0}],cursor:F.cursor+1})},[]),K=A.useCallback((H,J)=>{const F=o.current,et=C.findIndex({id:H},F),yt=C.findIndex({id:J},F);et<yt?O([...C.slice(0,et,F),...C.slice(et+1,yt+1,F),F[et],...C.slice(yt+1,F.length,F)]):O([...C.slice(0,yt,F),F[et],...C.slice(yt,et,F),...C.slice(et+1,F.length,F)])},[O]),ct=A.useCallback(H=>{const J=o.current,F=C.findIndex({id:H.id},J);if(F<0)return;const et=C.set("visible",H.visible===!1,H);l(yt=>(yt==null?void 0:yt.id)===et.id?et:yt),O(C.set(F,et,J))},[O]),at=A.useCallback(H=>{const J=o.current,F=C.findIndex({id:H.id},J);if(F<0)return;const et=C.set("locked",!H.locked,H);l(yt=>(yt==null?void 0:yt.id)===et.id?et:yt),O(C.set(F,et,J))},[O]);return A.useEffect(()=>{a.current()},[p]),{shapesRef:o,selectedShape:s,addShape:k,addPictureShape:V,moveShapes:K,saveShapes:Q,setSelectedShape:l,toggleShapeVisibility:ct,toggleShapeLock:at,removeShape:Y,updateShape:N,backwardShape:M,forwardShape:T,clearShapes:z,canGoBackward:d,canGoForward:x,canClear:L}},Zu={type:"infos",duration:4e3},Uu=500,zu=100,Lh="",Bf=({type:n,text:o,duration:a})=>{const[s,l]=A.useState(!1);return A.useEffect(()=>{const p=setTimeout(()=>{l(!0)},zu),h=setTimeout(()=>{l(!1)},a-Uu-zu);return()=>{clearTimeout(p),clearTimeout(h)}},[a]),_.jsx("div",{className:"react-paint-editor-snackbar","data-is-shown":+s,"data-type":n,style:{"--react-paint-editor-panel-transition-duration":`${Uu}ms`},children:o})},Ff=({snackbarList:n})=>_.jsx("div",{className:"react-paint-editor-snackbar-container",style:{"--react-paint-editor-snackbar-zindex":In.PANEL},children:n.map(o=>_.jsx(Bf,it({},o),o.id))}),Zf=()=>{const n=A.useRef([]),[o,a]=A.useState([]),s=p=>{a(h=>C.remove({id:p},h))},l=({type:p=Zu.type,duration:h=Zu.duration,text:d})=>{const x={id:C.uniqueId("snackbar_"),duration:h,type:p,text:d};a(L=>[...L,x]),n.current=[...n.current,setTimeout(()=>s(x.id),h)]};return A.useEffect(()=>()=>{for(const p of n.current)clearTimeout(p)},[]),{snackbarList:o,addSnackbar:l}},Pu=300,kh="",Uf=({isLoading:n=!1})=>{const[o,a]=A.useState("hidden");return A.useEffect(()=>{if(n)a("visible");else{a("fadeOut");const s=setTimeout(()=>a("hidden"),Pu);return()=>{clearTimeout(s)}}},[n]),o==="hidden"?null:_.jsx("div",{className:"react-paint-editor-loading","data-loading":o,style:{"--react-paint-editor-loading-zindex":In.LOADING,"--react-paint-editor-loading-transition-duration":`${Pu}ms`},children:_.jsxs("div",{className:"react-paint-editor-loader",children:[_.jsx("div",{}),_.jsx("div",{}),_.jsx("div",{}),_.jsx("div",{})]})})},zf=({onResized:n,element:o})=>{A.useEffect(()=>{const a=o.current;if(!a)return;const s=new ResizeObserver(l=>{const{width:p,height:h}=C.get("0.borderBoxSize",l)?C.flow(C.get("0.borderBoxSize"),C.castArray,C.first,d=>({width:C.get("inlineSize",d),height:C.get("blockSize",d)}))(l):C.get("0.contentRect",l);n(p,h)});return s.observe(a),()=>{s.unobserve(a)}},[o,n])},bi={layersManipulation:!0,grid:0,canGrow:!1,canShrink:!0,withExport:!0,withLoadAndSave:!0,withUploadPicture:!0,withUrlPicture:!1,availableTools:Gl,clearCallback:"empty",uiStyle:{toolbarBackgroundColor:"white",dividerColor:"#36418129",fontRadius:8,fontDisabledColor:"#3641812b",fontDisabledBackgroundColor:"transparent",fontColor:"#364181",fontBackgroundColor:"transparent",fontSelectedColor:"white",fontSelectedBackgroundColor:"#364181",fontHoverColor:"#364181",fontHoverBackgroundColor:"#afd8d8",canvasBackgroundColor:"white",canvasSelectionColor:Ma,canvasSelectionWidth:Va,canvasSelectionPadding:gc}},Ih="";return({width:n=1e3,height:o=600,shapes:a,className:s="",mode:l="editor",disabled:p=!1,onDataChanged:h,apiRef:d,options:x=bi})=>{var y;const{layersManipulation:L,grid:Q,canGrow:k,canShrink:V,withExport:N,withLoadAndSave:O,withUploadPicture:Y,withUrlPicture:M,clearCallback:T,availableTools:z}=it(it({},bi),x),{toolbarBackgroundColor:K,dividerColor:ct,fontRadius:at,fontDisabledColor:H,fontDisabledBackgroundColor:J,fontColor:F,fontBackgroundColor:et,fontSelectedColor:yt,fontSelectedBackgroundColor:It,fontHoverColor:Ut,fontHoverBackgroundColor:ut,canvasBackgroundColor:pt,canvasSelectionColor:lt,canvasSelectionWidth:Ct}=it(it({},bi.uiStyle),(y=x==null?void 0:x.uiStyle)!=null?y:{}),Tt=l!=="viewer",Mt=p||!Tt,Rt=A.useRef(null),Ot=A.useRef(null),[Xt,$e]=A.useState({width:n,height:o,scaleRatio:1}),Lt=0,[He,q]=A.useState(Du(z,Y||M));A.useEffect(()=>{q(Du(z,Y||M))},[z,Y,M]);const{isInsideComponent:B}=Nf({disabled:Mt,componentRef:Rt}),[U,P]=A.useState(!1),[st,Nt]=A.useState(!1),[$t,te]=A.useState([0,0]),[Kt,ue]=A.useState(void 0),[We,tr]=A.useState(yr),[Zr,ln]=A.useState({mode:"default"}),[g,Tn]=A.useState(Q),[Ur,zr]=A.useState(!1),{shapesRef:Ht,selectedShape:Rr,addShape:sr,addPictureShape:Pr,moveShapes:Be,setSelectedShape:ne,removeShape:mr,updateShape:Ve,backwardShape:we,forwardShape:cr,clearShapes:fe,saveShapes:er,toggleShapeVisibility:fn,toggleShapeLock:Ce,canGoBackward:lr,canGoForward:Ee,canClear:Fe}=Hf(h),{snackbarList:Ae,addSnackbar:zt}=Zf(),_e=A.useCallback(E=>{ne(void 0),tr(E)},[ne]),Sr=A.useCallback((E,D,rt)=>{q(ft=>ft.map(Qt=>Qt.id===E?C.set(["settings",D,"default"],rt,Qt):Qt)),tr(ft=>ft.id===E?C.set(["settings",D,"default"],rt,ft):ft)},[]),dn=A.useCallback(()=>{_e(yr),we()},[_e,we]),On=A.useCallback(()=>{_e(yr),cr()},[_e,cr]),_r=A.useCallback((E=[],D=!1)=>{fe(E,D),_e(yr),te([0,0])},[_e,fe]),Ze=A.useCallback((E,D=!0)=>gr(this,null,function*(){const rt=yield vl(E);_r(rt,D)}),[_r]),pn=A.useCallback(()=>{typeof T!="string"?Ze({shapes:T()},!1):T==="defaultShapes"&&a!==void 0?Ze({shapes:a},!1):_r()},[_r,Ze,a,T]),fr=A.useCallback(E=>{tr(yr),ne(E)},[ne]),rr=A.useCallback(E=>{sr(E),fr(E)},[sr,fr]),Ue=A.useCallback(()=>{P(!0);try{const E=Ot.current&&su(Ht.current,$t,n,o,Lt);if(!E)throw new Error;uu(E,"drawing.png"),P(!1)}catch(E){E instanceof Error&&zt({type:"error",text:"L'export a échoué"}),console.warn(E)}finally{P(!1)}},[zt,Ht,$t,n,o,Lt]),hn=A.useCallback(()=>{P(!0);try{const E=hl(Ht.current,n,o);if(!E)throw new Error("L'encodage a échoué");uu(E,"drawing.json"),P(!1)}catch(E){E instanceof Error&&zt({type:"error",text:"L'enregistrement a échoué"}),console.warn(E)}finally{P(!1)}},[Ht,zt,n,o]),Tr=A.useCallback(E=>gr(this,null,function*(){P(!0);try{const D=yield gl(E);yield Ze(D),zt({type:"success",text:"Fichier chargé !"})}catch(D){D instanceof Error&&zt({type:"error",text:"Le chargement a échoué"}),console.warn(D)}finally{P(!1)}}),[Ze,zt]),Le=A.useCallback(E=>gr(this,null,function*(){P(!0);try{const D=yield Pr(E,n,o);fr(D)}catch(D){D instanceof Error&&zt({type:"error",text:"Le chargement a échoué"}),console.warn(D)}finally{P(!1)}}),[Pr,fr,zt,n,o]),Dn=A.useCallback(E=>{const D=E/n;$e({width:E,height:o*D,scaleRatio:D})},[n,o]);Mf({isInsideComponent:B,gridFormat:g,isEditingText:Zr.mode==="textedition",selectedShape:Rr,setSelectedShape:ne,removeShape:mr,pasteShape:rr,updateShape:Ve,backwardShape:we,forwardShape:cr,setShiftPressed:zr}),zf({element:Rt,onResized:Dn}),A.useEffect(()=>{B||ne(void 0)},[B,ne]),A.useEffect(()=>{a!==void 0&&Ze({shapes:a})},[Ze,a]),A.useEffect(()=>{d&&(d.current={getCurrentImage:()=>Ot.current?su(Ht.current,$t,n,o,Lt):void 0,getCurrentData:()=>ru(Ht.current,n,o)})},[d,Ht,$t,n,o,Lt]);const Wn=`${s}${st?" react-paint-editor-layout-opened":""} react-paint-editor-app`;return _.jsxs("div",{ref:Rt,className:Wn,"data-grow":k,"data-shrink":V,style:{"--react-paint-editor-app-canvaswidth":`${n}px`,"--react-paint-editor-app-toolbar-bg":K,"--react-paint-editor-app-divider-color":ct,"--react-paint-editor-app-font-radius":at,"--react-paint-editor-app-font-disabled-color":H,"--react-paint-editor-app-font-disabled-bg":J,"--react-paint-editor-app-font-color":F,"--react-paint-editor-app-font-bg":et,"--react-paint-editor-app-font-selected-color":yt,"--react-paint-editor-app-font-selected-bg":It,"--react-paint-editor-app-font-hover-color":Ut,"--react-paint-editor-app-font-hover-bg":ut,"--react-paint-editor-app-canvas-bg":pt},children:[Tt&&_.jsx(jf,{width:Xt.width,disabled:Mt,activeTool:We,clearCanvas:pn,setActiveTool:_e,exportCanvasInFile:Ue,saveFile:hn,loadFile:Tr,addPicture:Le,hasActionToUndo:lr,hasActionToRedo:Ee,hasActionToClear:Fe,undoAction:dn,redoAction:On,availableTools:He,withExport:N,withLoadAndSave:O,withUploadPicture:Y,withUrlPicture:M}),_.jsxs("div",{className:"react-paint-editor-app-row","data-grow":k,style:{"--react-paint-editor-app-row-zindex":In.APP,"--react-paint-editor-app-row-width":Xt.width,"--react-paint-editor-app-row-aspectratio":`calc(${Xt.width} / ${Xt.height})`},children:[_.jsx(_f,{canGrow:k,gridFormat:g,disabled:Mt,isInsideComponent:B,activeTool:We,setActiveTool:tr,canvasOffsetStartPosition:Kt,setCanvasOffsetStartPosition:ue,shapes:Ht.current,addShape:sr,updateSingleShape:Ve,selectedShape:Rr,setSelectedShape:ne,canvasOffset:$t,setCanvasOffset:te,saveShapes:er,ref:Ot,canvasSize:Xt,selectionMode:Zr,setSelectionMode:ln,selectionColor:lt,selectionWidth:Ct,selectionPadding:Lt,isEditMode:Tt,isShiftPressed:Ur}),Tt&&L&&_.jsx(wf,{gridFormat:g,setGridFormat:Tn,disabled:Mt,shapes:Ht.current,moveShapes:Be,selectedShape:Rr,removeShape:mr,selectShape:fr,toggleShapeVisibility:fn,toggleShapeLock:Ce,isLayoutPanelShown:st})]}),Tt&&_.jsxs(_.Fragment,{children:[_.jsx(Vf,{width:Xt.width,disabled:Mt,activeTool:We,availableTools:He,selectedShape:Rr,removeShape:mr,updateShape:Ve,canvas:Ot.current,layersManipulation:L,toggleLayoutPanel:()=>{Nt(E=>!E)},updateToolSettings:Sr}),_.jsx(Uf,{isLoading:U}),_.jsx(Ff,{snackbarList:Ae})]})]})}});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Point, DrawableShape } from './Shapes';
|
|
2
|
+
export type SelectionModeDefault = {
|
|
3
|
+
mode: 'default';
|
|
4
|
+
};
|
|
5
|
+
export type SelectionModeBrush = {
|
|
6
|
+
mode: 'brush';
|
|
7
|
+
};
|
|
8
|
+
export type SelectionModeEditText = {
|
|
9
|
+
mode: 'textedition';
|
|
10
|
+
defaultValue: string[];
|
|
11
|
+
};
|
|
12
|
+
export type SelectionModeResize<AnchorType extends Point | number = Point> = {
|
|
13
|
+
mode: 'resize';
|
|
14
|
+
cursorStartPosition: Point;
|
|
15
|
+
originalShape: DrawableShape;
|
|
16
|
+
anchor: AnchorType;
|
|
17
|
+
};
|
|
18
|
+
export type SelectionModeRotate = {
|
|
19
|
+
mode: 'rotate';
|
|
20
|
+
cursorStartPosition: Point;
|
|
21
|
+
originalShape: DrawableShape;
|
|
22
|
+
center: Point;
|
|
23
|
+
};
|
|
24
|
+
export type SelectionModeTranslate = {
|
|
25
|
+
mode: 'translate';
|
|
26
|
+
cursorStartPosition: Point;
|
|
27
|
+
originalShape: DrawableShape;
|
|
28
|
+
};
|
|
29
|
+
export type SelectionModeData<AnchorType extends Point | number> = SelectionModeDefault | SelectionModeBrush | SelectionModeResize<AnchorType> | SelectionModeRotate | SelectionModeTranslate | SelectionModeEditText;
|
|
30
|
+
export type HoverModeData = {
|
|
31
|
+
mode: 'default';
|
|
32
|
+
} | {
|
|
33
|
+
mode: 'resize';
|
|
34
|
+
anchor: Point | number;
|
|
35
|
+
} | {
|
|
36
|
+
mode: 'brush';
|
|
37
|
+
} | {
|
|
38
|
+
mode: 'rotate';
|
|
39
|
+
} | {
|
|
40
|
+
mode: 'translate';
|
|
41
|
+
} | {
|
|
42
|
+
mode: 'textedition';
|
|
43
|
+
};
|