@carandesign/drawui 0.1.2 → 0.2.2
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/CHANGELOG.md +6 -0
- package/README.md +1 -0
- package/dist/components/button/DrawuiButton.types.d.ts +2 -1
- package/dist/components/card/DrawuiCard.types.d.ts +2 -1
- package/dist/components/collapse/DrawuiCollapse.types.d.ts +2 -1
- package/dist/components/divider/DrawuiDivider.types.d.ts +2 -1
- package/dist/components/iconButton/DrawuiIconButton.types.d.ts +2 -1
- package/dist/components/input/DrawuiInput.types.d.ts +2 -1
- package/dist/drawui.cjs.js +11 -11
- package/dist/drawui.es.js +1021 -983
- package/dist/theme/types.d.ts +1 -0
- package/package.json +5 -2
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { RadiusToken, SizeToken, StrokeWeight } from '../../theme/types';
|
|
1
|
+
import { FillStyles, RadiusToken, SizeToken, StrokeWeight } from '../../theme/types';
|
|
2
2
|
export interface DrawuiButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
3
|
strokeWeight?: StrokeWeight;
|
|
4
4
|
size?: SizeToken;
|
|
5
5
|
radius?: RadiusToken;
|
|
6
6
|
backgroundColor?: string;
|
|
7
|
+
fillStyle?: FillStyles;
|
|
7
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RadiusToken, StrokeWeight } from '../../theme/types';
|
|
1
|
+
import { FillStyles, RadiusToken, StrokeWeight } from '../../theme/types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export interface DrawuiCardProps {
|
|
4
4
|
strokeWeight?: StrokeWeight;
|
|
@@ -6,6 +6,7 @@ export interface DrawuiCardProps {
|
|
|
6
6
|
width?: number;
|
|
7
7
|
height?: number;
|
|
8
8
|
backgroundColor?: string;
|
|
9
|
+
fillStyle?: FillStyles;
|
|
9
10
|
header?: ReactNode;
|
|
10
11
|
footer?: ReactNode;
|
|
11
12
|
children?: ReactNode;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { RadiusToken, StrokeWeight } from '../../theme/types';
|
|
2
|
+
import { FillStyles, RadiusToken, StrokeWeight } from '../../theme/types';
|
|
3
3
|
export interface DrawuiCollapseProps {
|
|
4
4
|
header: ReactNode;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
strokeWeight?: StrokeWeight;
|
|
7
|
+
fillStyle?: FillStyles;
|
|
7
8
|
radius?: RadiusToken;
|
|
8
9
|
className?: string;
|
|
9
10
|
width?: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { StrokeWeight } from '../../theme/types';
|
|
1
|
+
import { FillStyles, StrokeWeight } from '../../theme/types';
|
|
2
2
|
export interface DrawuiDividerProps {
|
|
3
3
|
strokeWeight?: StrokeWeight;
|
|
4
4
|
width?: number | string;
|
|
5
5
|
vertical?: boolean;
|
|
6
6
|
className?: string;
|
|
7
|
+
fillStyle?: FillStyles;
|
|
7
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { RadiusToken, SizeToken, StrokeWeight } from '../../theme/types';
|
|
1
|
+
import { FillStyles, RadiusToken, SizeToken, StrokeWeight } from '../../theme/types';
|
|
2
2
|
export interface DrawuiIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
3
|
strokeWeight?: StrokeWeight;
|
|
4
4
|
size?: SizeToken;
|
|
5
5
|
icon: React.ReactNode;
|
|
6
|
+
fillStyle?: FillStyles;
|
|
6
7
|
radius?: RadiusToken;
|
|
7
8
|
backgroundColor?: string;
|
|
8
9
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { StrokeWeight, RadiusToken, SizeToken } from '../../theme/types';
|
|
1
|
+
import { StrokeWeight, RadiusToken, SizeToken, FillStyles } from '../../theme/types';
|
|
2
2
|
import { InputHTMLAttributes } from 'react';
|
|
3
3
|
export interface DrawuiInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
4
|
strokeWeight?: StrokeWeight;
|
|
5
5
|
radius?: RadiusToken;
|
|
6
6
|
inputSize: SizeToken;
|
|
7
|
+
fillStyle?: FillStyles;
|
|
7
8
|
backgroundColor?: string;
|
|
8
9
|
}
|
package/dist/drawui.cjs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react");var ae={exports:{}},B={};var Ae;function et(){if(Ae)return B;Ae=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(t,n,r){var i=null;if(r!==void 0&&(i=""+r),n.key!==void 0&&(i=""+n.key),"key"in n){r={};for(var a in n)a!=="key"&&(r[a]=n[a])}else r=n;return n=r.ref,{$$typeof:o,type:t,key:i,ref:n!==void 0?n:null,props:r}}return B.Fragment=e,B.jsx=s,B.jsxs=s,B}var Y={};var je;function tt(){return je||(je=1,process.env.NODE_ENV!=="production"&&(function(){function o(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===se?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case b:return"Fragment";case _:return"Profiler";case v:return"StrictMode";case J:return"Suspense";case K:return"SuspenseList";case te:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case m:return"Portal";case $:return p.displayName||"Context";case C:return(p._context.displayName||"Context")+".Consumer";case I:var w=p.render;return p=p.displayName,p||(p=w.displayName||w.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case ee:return w=p.displayName||null,w!==null?w:o(p.type)||"Memo";case D:w=p._payload,p=p._init;try{return o(p(w))}catch{}}return null}function e(p){return""+p}function s(p){try{e(p);var w=!1}catch{w=!0}if(w){w=console;var S=w.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return S.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(p)}}function t(p){if(p===b)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===D)return"<...>";try{var w=o(p);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function n(){var p=T.A;return p===null?null:p.getOwner()}function r(){return Error("react-stack-top-frame")}function i(p){if(P.call(p,"key")){var w=Object.getOwnPropertyDescriptor(p,"key").get;if(w&&w.isReactWarning)return!1}return p.key!==void 0}function a(p,w){function S(){z||(z=!0,console.error("%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://react.dev/link/special-props)",w))}S.isReactWarning=!0,Object.defineProperty(p,"key",{get:S,configurable:!0})}function c(){var p=o(this.type);return F[p]||(F[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function l(p,w,S,E,oe,ve){var R=S.ref;return p={$$typeof:g,type:p,key:w,props:S,_owner:E},(R!==void 0?R:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:c}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,w,S,E,oe,ve){var R=w.children;if(R!==void 0)if(E)if(j(R)){for(E=0;E<R.length;E++)h(R[E]);Object.freeze&&Object.freeze(R)}else console.error("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 h(R);if(P.call(w,"key")){R=o(p);var q=Object.keys(w).filter(function(Ke){return Ke!=="key"});E=0<q.length?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}",V[R+E]||(q=0<q.length?"{"+q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,T,E,F,E),G[E+T]=!0)}if(E=null,S!==void 0&&(n(S),E=""+S),i(w)&&(n(w.key),E=""+w.key),"key"in w){S={};for(var we in w)we!=="key"&&(S[we]=w[we])}else S=w;return E&&a(S,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,E,S,t(),oe,ve)}function h(p){f(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===j&&(p._payload.status==="fulfilled"?f(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function f(p){return typeof p=="object"&&p!==null&&p.$$typeof===g}var d=y,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),q=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),R=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,A=Array.isArray,z=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(p){return p()}};var $,W={},ne=d.react_stack_bottom_frame.bind(d,r)(),re=z(s(r)),G={};B.Fragment=b,B.jsx=function(p,w,S){var T=1e4>R.recentlyCreatedOwnerStacks++;return c(p,w,S,!1,T?Error("react-stack-top-frame"):ne,T?z(s(p)):re)},B.jsxs=function(p,w,S){var T=1e4>R.recentlyCreatedOwnerStacks++;return c(p,w,S,!0,T?Error("react-stack-top-frame"):ne,T?z(s(p)):re)}})()),B}var $e;function st(){return $e||($e=1,process.env.NODE_ENV==="production"?ae.exports=et():ae.exports=tt()),ae.exports}var M=st();function Se(o,e,n){if(o&&o.length){const[s,t]=e,r=Math.PI/180*n,i=Math.cos(r),a=Math.sin(r);for(const u of o){const[l,c]=u;u[0]=(l-s)*i-(c-t)*a+s,u[1]=(l-s)*a+(c-t)*i+t}}}function nt(o,e,n){const s=[];o.forEach(t=>s.push(...t)),Se(s,e,n)}function rt(o,e){return o[0]===e[0]&&o[1]===e[1]}function ot(o,e,n,s=1){const t=n,r=Math.max(e,.1),i=o[0]&&o[0][0]&&typeof o[0][0]=="number"?[o]:o,a=[0,0];if(t)for(const l of i)Se(l,a,t);const u=at(i,r,s);if(t){for(const l of i)Se(l,a,-t);nt(u,a,-t)}return u}function at(o,e,n){const s=[];for(const l of o){const c=[...l];rt(c[0],c[c.length-1])||c.push([c[0][0],c[0][1]]),c.length>2&&s.push(c)}const t=[];e=Math.max(e,.1);const r=[];for(const l of s)for(let c=0;c<l.length-1;c++){const h=l[c],f=l[c+1];if(h[1]!==f[1]){const d=Math.min(h[1],f[1]);r.push({ymin:d,ymax:Math.max(h[1],f[1]),x:d===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(r.sort((l,c)=>l.ymin<c.ymin?-1:l.ymin>c.ymin?1:l.x<c.x?-1:l.x>c.x?1:l.ymax===c.ymax?0:(l.ymax-c.ymax)/Math.abs(l.ymax-c.ymax)),!r.length)return t;let i=[],a=r[0].ymin,u=0;for(;i.length||r.length;){if(r.length){let l=-1;for(let h=0;h<r.length&&!(r[h].ymin>a);h++)l=h;r.splice(0,l+1).forEach(h=>{i.push({s:a,edge:h})})}if(i=i.filter(l=>!(l.edge.ymax<=a)),i.sort((l,c)=>l.edge.x===c.edge.x?0:(l.edge.x-c.edge.x)/Math.abs(l.edge.x-c.edge.x)),(n!==1||u%e===0)&&i.length>1)for(let l=0;l<i.length;l=l+2){const c=l+1;if(c>=i.length)break;const h=i[l].edge,f=i[c].edge;t.push([[Math.round(h.x),a],[Math.round(f.x),a]])}a+=n,i.forEach(l=>{l.edge.x=l.edge.x+n*l.edge.islope}),u++}return t}function U(o,e){var n;const s=e.hachureAngle+90;let t=e.hachureGap;t<0&&(t=e.strokeWidth*4),t=Math.round(Math.max(t,.1));let r=1;return e.roughness>=1&&(((n=e.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(r=t),ot(o,t,s,r||1)}class Ce{constructor(e){this.helper=e}fillPolygons(e,n){return this._fillPolygons(e,n)}_fillPolygons(e,n){const s=U(e,n);return{type:"fillSketch",ops:this.renderLines(s,n)}}renderLines(e,n){const s=[];for(const t of e)s.push(...this.helper.doubleLineOps(t[0][0],t[0][1],t[1][0],t[1][1],n));return s}}function be(o){const e=o[0],n=o[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}class it extends Ce{fillPolygons(e,n){let s=n.hachureGap;s<0&&(s=n.strokeWidth*4),s=Math.max(s,.1);const t=Object.assign({},n,{hachureGap:s}),r=U(e,t),i=Math.PI/180*n.hachureAngle,a=[],u=s*.5*Math.cos(i),l=s*.5*Math.sin(i);for(const[h,f]of r)be([h,f])&&a.push([[h[0]-u,h[1]+l],[...f]],[[h[0]+u,h[1]-l],[...f]]);return{type:"fillSketch",ops:this.renderLines(a,n)}}}class ct extends Ce{fillPolygons(e,n){const s=this._fillPolygons(e,n),t=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),r=this._fillPolygons(e,t);return s.ops=s.ops.concat(r.ops),s}}class ut{constructor(e){this.helper=e}fillPolygons(e,n){n=Object.assign({},n,{hachureAngle:0});const s=U(e,n);return this.dotsOnLines(s,n)}dotsOnLines(e,n){const s=[];let t=n.hachureGap;t<0&&(t=n.strokeWidth*4),t=Math.max(t,.1);let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=t/4;for(const a of e){const u=be(a),l=u/t,c=Math.ceil(l)-1,h=u-c*t,f=(a[0][0]+a[1][0])/2-t/4,d=Math.min(a[0][1],a[1][1]);for(let g=0;g<c;g++){const m=d+h+g*t,b=f-i+Math.random()*2*i,v=m-i+Math.random()*2*i,_=this.helper.ellipse(b,v,r,r,n);s.push(..._.ops)}}return{type:"fillSketch",ops:s}}}class lt{constructor(e){this.helper=e}fillPolygons(e,n){const s=U(e,n);return{type:"fillSketch",ops:this.dashedLine(s,n)}}dashedLine(e,n){const s=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,t=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,r=[];return e.forEach(i=>{const a=be(i),u=Math.floor(a/(s+t)),l=(a+t-u*(s+t))/2;let c=i[0],h=i[1];c[0]>h[0]&&(c=i[1],h=i[0]);const f=Math.atan((h[1]-c[1])/(h[0]-c[0]));for(let d=0;d<u;d++){const g=d*(s+t),m=g+s,b=[c[0]+g*Math.cos(f)+l*Math.cos(f),c[1]+g*Math.sin(f)+l*Math.sin(f)],v=[c[0]+m*Math.cos(f)+l*Math.cos(f),c[1]+m*Math.sin(f)+l*Math.sin(f)];r.push(...this.helper.doubleLineOps(b[0],b[1],v[0],v[1],n))}}),r}}class ht{constructor(e){this.helper=e}fillPolygons(e,n){const s=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,t=n.zigzagOffset<0?s:n.zigzagOffset;n=Object.assign({},n,{hachureGap:s+t});const r=U(e,n);return{type:"fillSketch",ops:this.zigzagLines(r,t,n)}}zigzagLines(e,n,s){const t=[];return e.forEach(r=>{const i=be(r),a=Math.round(i/(2*n));let u=r[0],l=r[1];u[0]>l[0]&&(u=r[1],l=r[0]);const c=Math.atan((l[1]-u[1])/(l[0]-u[0]));for(let h=0;h<a;h++){const f=h*2*n,d=(h+1)*2*n,g=Math.sqrt(2*Math.pow(n,2)),m=[u[0]+f*Math.cos(c),u[1]+f*Math.sin(c)],b=[u[0]+d*Math.cos(c),u[1]+d*Math.sin(c)],v=[m[0]+g*Math.cos(c+Math.PI/4),m[1]+g*Math.sin(c+Math.PI/4)];t.push(...this.helper.doubleLineOps(m[0],m[1],v[0],v[1],s),...this.helper.doubleLineOps(v[0],v[1],b[0],b[1],s))}}),t}}const x={};function ft(o,e){let n=o.fillStyle||"hachure";if(!x[n])switch(n){case"zigzag":x[n]||(x[n]=new it(e));break;case"cross-hatch":x[n]||(x[n]=new ct(e));break;case"dots":x[n]||(x[n]=new ut(e));break;case"dashed":x[n]||(x[n]=new lt(e));break;case"zigzag-line":x[n]||(x[n]=new ht(e));break;default:n="hachure",x[n]||(x[n]=new Ce(e));break}return x[n]}function dt(){return Math.floor(Math.random()*2**31)}class pt{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const gt=0,Pe=1,Ve=2,ie={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function mt(o){const e=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:gt,text:RegExp.$1},o=o.substr(RegExp.$1.length);else if(o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))e[e.length]={type:Pe,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length);else return[];return e[e.length]={type:Ve,text:""},e}function Me(o,e){return o.type===e}function Le(o){const e=[],n=mt(o);let s="BOD",t=0,r=n[t];for(;!Me(r,Ve);){let i=0;const a=[];if(s==="BOD")if(r.text==="M"||r.text==="m")t++,i=ie[r.text],s=r.text;else return Le("M0,0"+o);else Me(r,Pe)?i=ie[s]:(t++,i=ie[r.text],s=r.text);if(t+i<n.length){for(let u=t;u<t+i;u++){const l=n[u];if(Me(l,Pe))a[a.length]=+l.text;else throw new Error("Param not a number: "+s+","+l.text)}if(typeof ie[s]=="number"){const u={key:s,data:a};e.push(u),t+=i,r=n[t],s==="M"&&(s="L"),s==="m"&&(s="l")}else throw new Error("Bad segment: "+s)}else throw new Error("Path data ended short")}return e}function Be(o){let e=0,n=0,s=0,t=0;const r=[];for(const{key:i,data:a}of o)switch(i){case"M":r.push({key:"M",data:[...a]}),[e,n]=a,[s,t]=a;break;case"m":e+=a[0],n+=a[1],r.push({key:"M",data:[e,n]}),s=e,t=n;break;case"L":r.push({key:"L",data:[...a]}),[e,n]=a;break;case"l":e+=a[0],n+=a[1],r.push({key:"L",data:[e,n]});break;case"C":r.push({key:"C",data:[...a]}),e=a[4],n=a[5];break;case"c":{const u=a.map((l,c)=>c%2?l+n:l+e);r.push({key:"C",data:u}),e=u[4],n=u[5];break}case"Q":r.push({key:"Q",data:[...a]}),e=a[2],n=a[3];break;case"q":{const u=a.map((l,c)=>c%2?l+n:l+e);r.push({key:"Q",data:u}),e=u[2],n=u[3];break}case"A":r.push({key:"A",data:[...a]}),e=a[5],n=a[6];break;case"a":e+=a[5],n+=a[6],r.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,n]});break;case"H":r.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],r.push({key:"H",data:[e]});break;case"V":r.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],r.push({key:"V",data:[n]});break;case"S":r.push({key:"S",data:[...a]}),e=a[2],n=a[3];break;case"s":{const u=a.map((l,c)=>c%2?l+n:l+e);r.push({key:"S",data:u}),e=u[2],n=u[3];break}case"T":r.push({key:"T",data:[...a]}),e=a[0],n=a[1];break;case"t":e+=a[0],n+=a[1],r.push({key:"T",data:[e,n]});break;case"Z":case"z":r.push({key:"Z",data:[]}),e=s,n=t;break}return r}function Ye(o){const e=[];let n="",s=0,t=0,r=0,i=0,a=0,u=0;for(const{key:l,data:c}of o){switch(l){case"M":e.push({key:"M",data:[...c]}),[s,t]=c,[r,i]=c;break;case"C":e.push({key:"C",data:[...c]}),s=c[4],t=c[5],a=c[2],u=c[3];break;case"L":e.push({key:"L",data:[...c]}),[s,t]=c;break;case"H":s=c[0],e.push({key:"L",data:[s,t]});break;case"V":t=c[0],e.push({key:"L",data:[s,t]});break;case"S":{let h=0,f=0;n==="C"||n==="S"?(h=s+(s-a),f=t+(t-u)):(h=s,f=t),e.push({key:"C",data:[h,f,...c]}),a=c[0],u=c[1],s=c[2],t=c[3];break}case"T":{const[h,f]=c;let d=0,g=0;n==="Q"||n==="T"?(d=s+(s-a),g=t+(t-u)):(d=s,g=t);const m=s+2*(d-s)/3,b=t+2*(g-t)/3,v=h+2*(d-h)/3,_=f+2*(g-f)/3;e.push({key:"C",data:[m,b,v,_,h,f]}),a=d,u=g,s=h,t=f;break}case"Q":{const[h,f,d,g]=c,m=s+2*(h-s)/3,b=t+2*(f-t)/3,v=d+2*(h-d)/3,_=g+2*(f-g)/3;e.push({key:"C",data:[m,b,v,_,d,g]}),a=h,u=f,s=d,t=g;break}case"A":{const h=Math.abs(c[0]),f=Math.abs(c[1]),d=c[2],g=c[3],m=c[4],b=c[5],v=c[6];h===0||f===0?(e.push({key:"C",data:[s,t,b,v,b,v]}),s=b,t=v):(s!==b||t!==v)&&(Ze(s,t,b,v,h,f,d,g,m).forEach(function(D){e.push({key:"C",data:D})}),s=b,t=v);break}case"Z":e.push({key:"Z",data:[]}),s=r,t=i;break}n=l}return e}function kt(o){return Math.PI*o/180}function Y(o,e,n){const s=o*Math.cos(n)-e*Math.sin(n),t=o*Math.sin(n)+e*Math.cos(n);return[s,t]}function Ze(o,e,n,s,t,r,i,a,u,l){const c=kt(i);let h=[],f=0,d=0,g=0,m=0;if(l)[f,d,g,m]=l;else{[o,e]=Y(o,e,-c),[n,s]=Y(n,s,-c);const R=(o-n)/2,P=(e-s)/2;let A=R*R/(t*t)+P*P/(r*r);A>1&&(A=Math.sqrt(A),t=A*t,r=A*r);const z=a===u?-1:1,$=t*t,W=r*r,ne=$*W-$*P*P-W*R*R,re=$*P*P+W*R*R,G=z*Math.sqrt(Math.abs(ne/re));g=G*t*P/r+(o+n)/2,m=G*-r*R/t+(e+s)/2,f=Math.asin(parseFloat(((e-m)/r).toFixed(9))),d=Math.asin(parseFloat(((s-m)/r).toFixed(9))),o<g&&(f=Math.PI-f),n<g&&(d=Math.PI-d),f<0&&(f=Math.PI*2+f),d<0&&(d=Math.PI*2+d),u&&f>d&&(f=f-Math.PI*2),!u&&d>f&&(d=d-Math.PI*2)}let b=d-f;if(Math.abs(b)>Math.PI*120/180){const R=d,P=n,A=s;u&&d>f?d=f+Math.PI*120/180*1:d=f+Math.PI*120/180*-1,n=g+t*Math.cos(d),s=m+r*Math.sin(d),h=Ze(n,s,P,A,t,r,i,0,u,[d,R,g,m])}b=d-f;const v=Math.cos(f),_=Math.sin(f),D=Math.cos(d),q=Math.sin(d),Q=Math.tan(b/4),J=4/3*t*Q,K=4/3*r*Q,ee=[o,e],j=[o+J*_,e-K*v],te=[n+J*q,s-K*D],se=[n,s];if(j[0]=2*ee[0]-j[0],j[1]=2*ee[1]-j[1],l)return[j,te,se].concat(h);{h=[j,te,se].concat(h);const R=[];for(let P=0;P<h.length;P+=3){const A=Y(h[P][0],h[P][1],c),z=Y(h[P+1][0],h[P+1][1],c),$=Y(h[P+2][0],h[P+2][1],c);R.push([A[0],A[1],z[0],z[1],$[0],$[1]])}return R}}const bt={randOffset:_t,randOffsetWithRange:St,ellipse:Mt,doubleLineOps:Pt};function Ue(o,e,n,s,t){return{type:"path",ops:I(o,e,n,s,t)}}function he(o,e,n){const s=(o||[]).length;if(s>2){const t=[];for(let r=0;r<s-1;r++)t.push(...I(o[r][0],o[r][1],o[r+1][0],o[r+1][1],n));return e&&t.push(...I(o[s-1][0],o[s-1][1],o[0][0],o[0][1],n)),{type:"path",ops:t}}else if(s===2)return Ue(o[0][0],o[0][1],o[1][0],o[1][1],n);return{type:"path",ops:[]}}function vt(o,e){return he(o,!0,e)}function wt(o,e,n,s,t){const r=[[o,e],[o+n,e],[o+n,e+s],[o,e+s]];return vt(r,t)}function De(o,e){if(o.length){const s=typeof o[0][0]=="number"?[o]:o,t=ce(s[0],1*(1+e.roughness*.2),e),r=e.disableMultiStroke?[]:ce(s[0],1.5*(1+e.roughness*.22),Ne(e));for(let i=1;i<s.length;i++){const a=s[i];if(a.length){const u=ce(a,1*(1+e.roughness*.2),e),l=e.disableMultiStroke?[]:ce(a,1.5*(1+e.roughness*.22),Ne(e));for(const c of u)c.op!=="move"&&t.push(c);for(const c of l)c.op!=="move"&&r.push(c)}}return{type:"path",ops:t.concat(r)}}return{type:"path",ops:[]}}function Mt(o,e,n,s,t){const r=Xe(n,s,t);return Te(o,e,t,r).opset}function Xe(o,e,n){const s=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(o/2,2)+Math.pow(e/2,2))/2)),t=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*s)),r=Math.PI*2/t;let i=Math.abs(o/2),a=Math.abs(e/2);const u=1-n.curveFitting;return i+=k(i*u,n),a+=k(a*u,n),{increment:r,rx:i,ry:a}}function Te(o,e,n,s){const[t,r]=We(s.increment,o,e,s.rx,s.ry,1,s.increment*pe(.1,pe(.4,1,n),n),n);let i=ge(t,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=We(s.increment,o,e,s.rx,s.ry,1.5,0,n),u=ge(a,null,n);i=i.concat(u)}return{estimatedPoints:r,opset:{type:"path",ops:i}}}function ze(o,e,n,s,t,r,i,a,u){const l=o,c=e;let h=Math.abs(n/2),f=Math.abs(s/2);h+=k(h*.01,u),f+=k(f*.01,u);let d=t,g=r;for(;d<0;)d+=Math.PI*2,g+=Math.PI*2;g-d>Math.PI*2&&(d=0,g=Math.PI*2);const m=Math.PI*2/u.curveStepCount,b=Math.min(m/2,(g-d)/2),v=Fe(b,l,c,h,f,d,g,1,u);if(!u.disableMultiStroke){const _=Fe(b,l,c,h,f,d,g,1.5,u);v.push(..._)}return i&&(a?v.push(...I(l,c,l+h*Math.cos(d),c+f*Math.sin(d),u),...I(l,c,l+h*Math.cos(g),c+f*Math.sin(g),u)):v.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+h*Math.cos(d),c+f*Math.sin(d)]})),{type:"path",ops:v}}function Ie(o,e){const n=Ye(Be(Le(o))),s=[];let t=[0,0],r=[0,0];for(const{key:i,data:a}of n)switch(i){case"M":{r=[a[0],a[1]],t=[a[0],a[1]];break}case"L":s.push(...I(r[0],r[1],a[0],a[1],e)),r=[a[0],a[1]];break;case"C":{const[u,l,c,h,f,d]=a;s.push(...Tt(u,l,c,h,f,d,r,e)),r=[f,d];break}case"Z":s.push(...I(r[0],r[1],t[0],t[1],e)),r=[t[0],t[1]];break}return{type:"path",ops:s}}function ye(o,e){const n=[];for(const s of o)if(s.length){const t=e.maxRandomnessOffset||0,r=s.length;if(r>2){n.push({op:"move",data:[s[0][0]+k(t,e),s[0][1]+k(t,e)]});for(let i=1;i<r;i++)n.push({op:"lineTo",data:[s[i][0]+k(t,e),s[i][1]+k(t,e)]})}}return{type:"fillPath",ops:n}}function H(o,e){return ft(e,bt).fillPolygons(o,e)}function yt(o,e,n,s,t,r,i){const a=o,u=e;let l=Math.abs(n/2),c=Math.abs(s/2);l+=k(l*.01,i),c+=k(c*.01,i);let h=t,f=r;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const d=(f-h)/i.curveStepCount,g=[];for(let m=h;m<=f;m=m+d)g.push([a+l*Math.cos(m),u+c*Math.sin(m)]);return g.push([a+l*Math.cos(f),u+c*Math.sin(f)]),g.push([a,u]),H([g],i)}function _t(o,e){return k(o,e)}function St(o,e,n){return pe(o,e,n)}function Pt(o,e,n,s,t){return I(o,e,n,s,t,!0)}function Ne(o){const e=Object.assign({},o);return e.randomizer=void 0,o.seed&&(e.seed=o.seed+1),e}function Qe(o){return o.randomizer||(o.randomizer=new pt(o.seed||0)),o.randomizer.next()}function pe(o,e,n,s=1){return n.roughness*s*(Qe(n)*(e-o)+o)}function k(o,e,n=1){return pe(-o,o,e,n)}function I(o,e,n,s,t,r=!1){const i=r?t.disableMultiStrokeFill:t.disableMultiStroke,a=Ee(o,e,n,s,t,!0,!1);if(i)return a;const u=Ee(o,e,n,s,t,!0,!0);return a.concat(u)}function Ee(o,e,n,s,t,r,i){const a=Math.pow(o-n,2)+Math.pow(e-s,2),u=Math.sqrt(a);let l=1;u<200?l=1:u>500?l=.4:l=-.0016668*u+1.233334;let c=t.maxRandomnessOffset||0;c*c*100>a&&(c=u/10);const h=c/2,f=.2+Qe(t)*.2;let d=t.bowing*t.maxRandomnessOffset*(s-e)/200,g=t.bowing*t.maxRandomnessOffset*(o-n)/200;d=k(d,t,l),g=k(g,t,l);const m=[],b=()=>k(h,t,l),v=()=>k(c,t,l),_=t.preserveVertices;return i?m.push({op:"move",data:[o+(_?0:b()),e+(_?0:b())]}):m.push({op:"move",data:[o+(_?0:k(c,t,l)),e+(_?0:k(c,t,l))]}),i?m.push({op:"bcurveTo",data:[d+o+(n-o)*f+b(),g+e+(s-e)*f+b(),d+o+2*(n-o)*f+b(),g+e+2*(s-e)*f+b(),n+(_?0:b()),s+(_?0:b())]}):m.push({op:"bcurveTo",data:[d+o+(n-o)*f+v(),g+e+(s-e)*f+v(),d+o+2*(n-o)*f+v(),g+e+2*(s-e)*f+v(),n+(_?0:v()),s+(_?0:v())]}),m}function ce(o,e,n){if(!o.length)return[];const s=[];s.push([o[0][0]+k(e,n),o[0][1]+k(e,n)]),s.push([o[0][0]+k(e,n),o[0][1]+k(e,n)]);for(let t=1;t<o.length;t++)s.push([o[t][0]+k(e,n),o[t][1]+k(e,n)]),t===o.length-1&&s.push([o[t][0]+k(e,n),o[t][1]+k(e,n)]);return ge(s,null,n)}function ge(o,e,n){const s=o.length,t=[];if(s>3){const r=[],i=1-n.curveTightness;t.push({op:"move",data:[o[1][0],o[1][1]]});for(let a=1;a+2<s;a++){const u=o[a];r[0]=[u[0],u[1]],r[1]=[u[0]+(i*o[a+1][0]-i*o[a-1][0])/6,u[1]+(i*o[a+1][1]-i*o[a-1][1])/6],r[2]=[o[a+1][0]+(i*o[a][0]-i*o[a+2][0])/6,o[a+1][1]+(i*o[a][1]-i*o[a+2][1])/6],r[3]=[o[a+1][0],o[a+1][1]],t.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else s===3?(t.push({op:"move",data:[o[1][0],o[1][1]]}),t.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[2][0],o[2][1]]})):s===2&&t.push(...Ee(o[0][0],o[0][1],o[1][0],o[1][1],n,!0,!0));return t}function We(o,e,n,s,t,r,i,a){const u=a.roughness===0,l=[],c=[];if(u){o=o/4,c.push([e+s*Math.cos(-o),n+t*Math.sin(-o)]);for(let h=0;h<=Math.PI*2;h=h+o){const f=[e+s*Math.cos(h),n+t*Math.sin(h)];l.push(f),c.push(f)}c.push([e+s*Math.cos(0),n+t*Math.sin(0)]),c.push([e+s*Math.cos(o),n+t*Math.sin(o)])}else{const h=k(.5,a)-Math.PI/2;c.push([k(r,a)+e+.9*s*Math.cos(h-o),k(r,a)+n+.9*t*Math.sin(h-o)]);const f=Math.PI*2+h-.01;for(let d=h;d<f;d=d+o){const g=[k(r,a)+e+s*Math.cos(d),k(r,a)+n+t*Math.sin(d)];l.push(g),c.push(g)}c.push([k(r,a)+e+s*Math.cos(h+Math.PI*2+i*.5),k(r,a)+n+t*Math.sin(h+Math.PI*2+i*.5)]),c.push([k(r,a)+e+.98*s*Math.cos(h+i),k(r,a)+n+.98*t*Math.sin(h+i)]),c.push([k(r,a)+e+.9*s*Math.cos(h+i*.5),k(r,a)+n+.9*t*Math.sin(h+i*.5)])}return[c,l]}function Fe(o,e,n,s,t,r,i,a,u){const l=r+k(.1,u),c=[];c.push([k(a,u)+e+.9*s*Math.cos(l-o),k(a,u)+n+.9*t*Math.sin(l-o)]);for(let h=l;h<=i;h=h+o)c.push([k(a,u)+e+s*Math.cos(h),k(a,u)+n+t*Math.sin(h)]);return c.push([e+s*Math.cos(i),n+t*Math.sin(i)]),c.push([e+s*Math.cos(i),n+t*Math.sin(i)]),ge(c,null,u)}function Tt(o,e,n,s,t,r,i,a){const u=[],l=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const h=a.disableMultiStroke?1:2,f=a.preserveVertices;for(let d=0;d<h;d++)d===0?u.push({op:"move",data:[i[0],i[1]]}):u.push({op:"move",data:[i[0]+(f?0:k(l[0],a)),i[1]+(f?0:k(l[0],a))]}),c=f?[t,r]:[t+k(l[d],a),r+k(l[d],a)],u.push({op:"bcurveTo",data:[o+k(l[d],a),e+k(l[d],a),n+k(l[d],a),s+k(l[d],a),c[0],c[1]]});return u}function Z(o){return[...o]}function He(o,e=0){const n=o.length;if(n<3)throw new Error("A curve must have at least three points.");const s=[];if(n===3)s.push(Z(o[0]),Z(o[1]),Z(o[2]),Z(o[2]));else{const t=[];t.push(o[0],o[0]);for(let a=1;a<o.length;a++)t.push(o[a]),a===o.length-1&&t.push(o[a]);const r=[],i=1-e;s.push(Z(t[0]));for(let a=1;a+2<t.length;a++){const u=t[a];r[0]=[u[0],u[1]],r[1]=[u[0]+(i*t[a+1][0]-i*t[a-1][0])/6,u[1]+(i*t[a+1][1]-i*t[a-1][1])/6],r[2]=[t[a+1][0]+(i*t[a][0]-i*t[a+2][0])/6,t[a+1][1]+(i*t[a][1]-i*t[a+2][1])/6],r[3]=[t[a+1][0],t[a+1][1]],s.push(r[1],r[2],r[3])}}return s}function Et(o,e){return Math.sqrt(fe(o,e))}function fe(o,e){return Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)}function Rt(o,e,n){const s=fe(e,n);if(s===0)return fe(o,e);let t=((o[0]-e[0])*(n[0]-e[0])+(o[1]-e[1])*(n[1]-e[1]))/s;return t=Math.max(0,Math.min(1,t)),fe(o,N(e,n,t))}function N(o,e,n){return[o[0]+(e[0]-o[0])*n,o[1]+(e[1]-o[1])*n]}function xt(o,e){const n=o[e+0],s=o[e+1],t=o[e+2],r=o[e+3];let i=3*s[0]-2*n[0]-r[0];i*=i;let a=3*s[1]-2*n[1]-r[1];a*=a;let u=3*t[0]-2*r[0]-n[0];u*=u;let l=3*t[1]-2*r[1]-n[1];return l*=l,i<u&&(i=u),a<l&&(a=l),i+a}function Re(o,e,n,s){const t=s||[];if(xt(o,e)<n){const r=o[e+0];t.length?Et(t[t.length-1],r)>1&&t.push(r):t.push(r),t.push(o[e+3])}else{const i=o[e+0],a=o[e+1],u=o[e+2],l=o[e+3],c=N(i,a,.5),h=N(a,u,.5),f=N(u,l,.5),d=N(c,h,.5),g=N(h,f,.5),m=N(d,g,.5);Re([i,c,d,m],0,n,t),Re([m,g,f,l],0,n,t)}return t}function Ot(o,e){return me(o,0,o.length,e)}function me(o,e,n,s,t){const r=t||[],i=o[e],a=o[n-1];let u=0,l=1;for(let c=e+1;c<n-1;++c){const h=Rt(o[c],i,a);h>u&&(u=h,l=c)}return Math.sqrt(u)>s?(me(o,e,l+1,s,r),me(o,l,n,s,r)):(r.length||r.push(i),r.push(a)),r}function xe(o,e=.15,n){const s=[],t=(o.length-1)/3;for(let r=0;r<t;r++){const i=r*3;Re(o,i,e,s)}return n&&n>0?me(s,0,s.length,n):s}function Ct(o,e,n){const s=Le(o),t=Ye(Be(s)),r=[];let i=[],a=[0,0],u=[];const l=()=>{u.length>=4&&i.push(...xe(u,e)),u=[]},c=()=>{l(),i.length&&(r.push(i),i=[])};for(const{key:f,data:d}of t)switch(f){case"M":c(),a=[d[0],d[1]],i.push(a);break;case"L":l(),i.push([d[0],d[1]]);break;case"C":if(!u.length){const g=i.length?i[i.length-1]:a;u.push([g[0],g[1]])}u.push([d[0],d[1]]),u.push([d[2],d[3]]),u.push([d[4],d[5]]);break;case"Z":l(),i.push([a[0],a[1]]);break}if(c(),!n)return r;const h=[];for(const f of r){const d=Ot(f,n);d.length&&h.push(d)}return h}const C="none";class ke{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return dt()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,n,s){return{shape:e,sets:n||[],options:s||this.defaultOptions}}line(e,n,s,t,r){const i=this._o(r);return this._d("line",[Ue(e,n,s,t,i)],i)}rectangle(e,n,s,t,r){const i=this._o(r),a=[],u=wt(e,n,s,t,i);if(i.fill){const l=[[e,n],[e+s,n],[e+s,n+t],[e,n+t]];i.fillStyle==="solid"?a.push(ye([l],i)):a.push(H([l],i))}return i.stroke!==C&&a.push(u),this._d("rectangle",a,i)}ellipse(e,n,s,t,r){const i=this._o(r),a=[],u=Xe(s,t,i),l=Te(e,n,i,u);if(i.fill)if(i.fillStyle==="solid"){const c=Te(e,n,i,u).opset;c.type="fillPath",a.push(c)}else a.push(H([l.estimatedPoints],i));return i.stroke!==C&&a.push(l.opset),this._d("ellipse",a,i)}circle(e,n,s,t){const r=this.ellipse(e,n,s,s,t);return r.shape="circle",r}linearPath(e,n){const s=this._o(n);return this._d("linearPath",[he(e,!1,s)],s)}arc(e,n,s,t,r,i,a=!1,u){const l=this._o(u),c=[],h=ze(e,n,s,t,r,i,a,!0,l);if(a&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=ze(e,n,s,t,r,i,!0,!1,f);d.type="fillPath",c.push(d)}else c.push(yt(e,n,s,t,r,i,l));return l.stroke!==C&&c.push(h),this._d("arc",c,l)}curve(e,n){const s=this._o(n),t=[],r=De(e,s);if(s.fill&&s.fill!==C)if(s.fillStyle==="solid"){const i=De(e,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));t.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{const i=[],a=e;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?i.push(...c):c.length===3?i.push(...xe(He([c[0],c[0],c[1],c[2]]),10,(1+s.roughness)/2)):i.push(...xe(He(c),10,(1+s.roughness)/2))}i.length&&t.push(H([i],s))}return s.stroke!==C&&t.push(r),this._d("curve",t,s)}polygon(e,n){const s=this._o(n),t=[],r=he(e,!0,s);return s.fill&&(s.fillStyle==="solid"?t.push(ye([e],s)):t.push(H([e],s))),s.stroke!==C&&t.push(r),this._d("polygon",t,s)}path(e,n){const s=this._o(n),t=[];if(!e)return this._d("path",t,s);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=s.fill&&s.fill!=="transparent"&&s.fill!==C,i=s.stroke!==C,a=!!(s.simplification&&s.simplification<1),u=a?4-4*(s.simplification||1):(1+s.roughness)/2,l=Ct(e,1,u),c=Ie(e,s);if(r)if(s.fillStyle==="solid")if(l.length===1){const h=Ie(e,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));t.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else t.push(ye(l,s));else t.push(H(l,s));return i&&(a?l.forEach(h=>{t.push(he(h,!1,s))}):t.push(c)),this._d("path",t,s)}opsToPath(e,n){let s="";for(const t of e.ops){const r=typeof n=="number"&&n>=0?t.data.map(i=>+i.toFixed(n)):t.data;switch(t.op){case"move":s+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":s+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":s+=`L${r[0]} ${r[1]} `;break}}return s.trim()}toPaths(e){const n=e.sets||[],s=e.options||this.defaultOptions,t=[];for(const r of n){let i=null;switch(r.type){case"path":i={d:this.opsToPath(r),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:C};break;case"fillPath":i={d:this.opsToPath(r),stroke:C,strokeWidth:0,fill:s.fill||C};break;case"fillSketch":i=this.fillSketch(r,s);break}i&&t.push(i)}return t}fillSketch(e,n){let s=n.fillWeight;return s<0&&(s=n.strokeWidth/2),{d:this.opsToPath(e),stroke:n.fill||C,strokeWidth:s,fill:C}}_mergedShape(e){return e.filter((n,s)=>s===0?!0:n.op!=="move")}}class Lt{constructor(e,n){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ke(n)}draw(e){const n=e.sets||[],s=e.options||this.getDefaultOptions(),t=this.ctx,r=e.options.fixedDecimalPlaceDigits;for(const i of n)switch(i.type){case"path":t.save(),t.strokeStyle=s.stroke==="none"?"transparent":s.stroke,t.lineWidth=s.strokeWidth,s.strokeLineDash&&t.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(t.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(t,i,r),t.restore();break;case"fillPath":{t.save(),t.fillStyle=s.fill||"";const a=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(t,i,r,a),t.restore();break}case"fillSketch":this.fillSketch(t,i,s);break}}fillSketch(e,n,s){let t=s.fillWeight;t<0&&(t=s.strokeWidth/2),e.save(),s.fillLineDash&&e.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(e.lineDashOffset=s.fillLineDashOffset),e.strokeStyle=s.fill||"",e.lineWidth=t,this._drawToContext(e,n,s.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,n,s,t="nonzero"){e.beginPath();for(const r of n.ops){const i=typeof s=="number"&&s>=0?r.data.map(a=>+a.toFixed(s)):r.data;switch(r.op){case"move":e.moveTo(i[0],i[1]);break;case"bcurveTo":e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case"lineTo":e.lineTo(i[0],i[1]);break}}n.type==="fillPath"?e.fill(t):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,n,s,t,r){const i=this.gen.line(e,n,s,t,r);return this.draw(i),i}rectangle(e,n,s,t,r){const i=this.gen.rectangle(e,n,s,t,r);return this.draw(i),i}ellipse(e,n,s,t,r){const i=this.gen.ellipse(e,n,s,t,r);return this.draw(i),i}circle(e,n,s,t){const r=this.gen.circle(e,n,s,t);return this.draw(r),r}linearPath(e,n){const s=this.gen.linearPath(e,n);return this.draw(s),s}polygon(e,n){const s=this.gen.polygon(e,n);return this.draw(s),s}arc(e,n,s,t,r,i,a=!1,u){const l=this.gen.arc(e,n,s,t,r,i,a,u);return this.draw(l),l}curve(e,n){const s=this.gen.curve(e,n);return this.draw(s),s}path(e,n){const s=this.gen.path(e,n);return this.draw(s),s}}const ue="http://www.w3.org/2000/svg";class At{constructor(e,n){this.svg=e,this.gen=new ke(n)}draw(e){const n=e.sets||[],s=e.options||this.getDefaultOptions(),t=this.svg.ownerDocument||window.document,r=t.createElementNS(ue,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of n){let u=null;switch(a.type){case"path":{u=t.createElementNS(ue,"path"),u.setAttribute("d",this.opsToPath(a,i)),u.setAttribute("stroke",s.stroke),u.setAttribute("stroke-width",s.strokeWidth+""),u.setAttribute("fill","none"),s.strokeLineDash&&u.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break}case"fillPath":{u=t.createElementNS(ue,"path"),u.setAttribute("d",this.opsToPath(a,i)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",s.fill||""),(e.shape==="curve"||e.shape==="polygon")&&u.setAttribute("fill-rule","evenodd");break}case"fillSketch":{u=this.fillSketch(t,a,s);break}}u&&r.appendChild(u)}return r}fillSketch(e,n,s){let t=s.fillWeight;t<0&&(t=s.strokeWidth/2);const r=e.createElementNS(ue,"path");return r.setAttribute("d",this.opsToPath(n,s.fixedDecimalPlaceDigits)),r.setAttribute("stroke",s.fill||""),r.setAttribute("stroke-width",t+""),r.setAttribute("fill","none"),s.fillLineDash&&r.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,n){return this.gen.opsToPath(e,n)}line(e,n,s,t,r){const i=this.gen.line(e,n,s,t,r);return this.draw(i)}rectangle(e,n,s,t,r){const i=this.gen.rectangle(e,n,s,t,r);return this.draw(i)}ellipse(e,n,s,t,r){const i=this.gen.ellipse(e,n,s,t,r);return this.draw(i)}circle(e,n,s,t){const r=this.gen.circle(e,n,s,t);return this.draw(r)}linearPath(e,n){const s=this.gen.linearPath(e,n);return this.draw(s)}polygon(e,n){const s=this.gen.polygon(e,n);return this.draw(s)}arc(e,n,s,t,r,i,a=!1,u){const l=this.gen.arc(e,n,s,t,r,i,a,u);return this.draw(l)}curve(e,n){const s=this.gen.curve(e,n);return this.draw(s)}path(e,n){const s=this.gen.path(e,n);return this.draw(s)}}const L={canvas(o,e){return new Lt(o,e)},svg(o,e){return new At(o,e)},generator(o){return new ke(o)},newSeed(){return ke.newSeed()}},X=(o,e,n,s,t)=>`M${o+t},${e}
|
|
7
|
-
H${o+n
|
|
8
|
-
A${
|
|
9
|
-
V${e+
|
|
10
|
-
A${
|
|
11
|
-
H${o+
|
|
12
|
-
A${
|
|
13
|
-
V${e+
|
|
14
|
-
A${
|
|
15
|
-
Z`,jt={"drawui-button":"_drawui-button_1nx7z_1"},de={stroke:{thin:{color:"#333",width:1.5},medium:{color:"#333",width:2.5},thick:{color:"#333",width:4}},roughness:{roughness:1.8,bowing:2},fill:{background:"#ccccccff"},radius:{none:0,sm:6,md:10,lg:16,full:30},buttonSize:{sm:{width:100,height:40,fontSize:12},md:{width:130,height:50,fontSize:15},lg:{width:150,height:60,fontSize:18},xl:{width:170,height:70,fontSize:20}},inputSize:{sm:{height:32,fontSize:12,paddingX:8},md:{height:40,fontSize:14,paddingX:12},lg:{height:48,fontSize:16,paddingX:16},xl:{height:48,fontSize:16,paddingX:16}}},Je=y.createContext(de),$t=({theme:o,children:e})=>{const n={...de,...o,stroke:{...de.stroke,...o?.stroke},radius:{...de.radius,...o?.radius}};return M.jsx(Je.Provider,{value:n,children:e})},O=()=>y.useContext(Je),Dt=({strokeWeight:o="medium",radius:e="md",size:n="sm",backgroundColor:s,children:t,...r})=>{const i=O(),a=y.useRef(null),[u,l]=y.useState(!1),c=i.buttonSize[n].width,h=i.buttonSize[n].height,f=i.buttonSize[n].fontSize;return y.useEffect(()=>{if(!a.current)return;const d=L.svg(a.current);a.current.innerHTML="";const g=i.stroke[o],m=d.path(X(0,0,c,h,i.radius[e]),{stroke:g.color,strokeWidth:g.width,fill:s??i.fill.background,roughness:u?i.roughness.roughness+1:i.roughness.roughness,bowing:i.roughness.bowing});a.current.appendChild(m)},[u,o,e,i]),M.jsxs("button",{...r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`${jt["drawui-button"]} ${r.className??""}`,style:{position:"relative",width:c,height:h,border:"none",background:"transparent",cursor:"pointer"},children:[M.jsx("svg",{ref:a,width:c,height:h,style:{position:"absolute",inset:0}}),M.jsx("span",{style:{position:"relative",fontSize:f,pointerEvents:"none"},children:t})]})},le={"drawui-card":"_drawui-card_vhoat_1","drawui-card-header":"_drawui-card-header_vhoat_7","drawui-card-body":"_drawui-card-body_vhoat_12","drawui-card-footer":"_drawui-card-footer_vhoat_17"},zt="_vertical_1tdom_6",It="_horizontal_1tdom_11",_e={"drawui-divider":"_drawui-divider_1tdom_1",vertical:zt,horizontal:It},Oe=({strokeWeight:o="medium",width:e="100%",vertical:n=!1,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;r.current.innerHTML="";const i=L.svg(r.current),a=t.stroke[o];if(n){const u=typeof e=="number"?e:100,l=i.line(0,0,0,u,{stroke:a.color,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(l)}else{const u=typeof e=="number"?e:300,l=i.line(0,0,u,0,{stroke:a.color,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(l)}},[t,o,e,n]),M.jsx("div",{className:`${_e["drawui-divider"]} ${n?_e.vertical:_e.horizontal} ${s??""}`,style:{width:n?void 0:e},children:M.jsx("svg",{ref:r,width:n?2:e,height:n?e:2,style:{display:"block"}})})},Nt=({strokeWeight:o="medium",radius:e="md",width:n=300,height:s=200,backgroundColor:t,header:r,footer:i,children:a,...u})=>{const l=O(),c=y.useRef(null),[h,f]=y.useState(!1);return y.useEffect(()=>{if(!c.current)return;const d=L.svg(c.current);c.current.innerHTML="";const g=l.stroke[o],m=d.path(X(0,0,n,s,l.radius[e]),{stroke:g.color,strokeWidth:g.width,fill:t??l.fill.background,roughness:h?l.roughness.roughness+1:l.roughness.roughness,bowing:l.roughness.bowing});c.current.appendChild(m)},[o,e,n,s,t,l]),M.jsxs("div",{...u,className:`${le["drawui-card"]} ${u.className??""}`,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{position:"relative",width:n,height:s,cursor:"default",display:"flex",flexDirection:"column",overflow:"hidden"},children:[M.jsx("svg",{ref:c,width:n,height:s,style:{position:"absolute",inset:0,pointerEvents:"none"}}),r&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:le["drawui-card-header"],style:{position:"relative",zIndex:1},children:r}),M.jsx(Oe,{width:n,strokeWeight:"thick"})]}),M.jsx("div",{className:le["drawui-card-body"],style:{position:"relative",zIndex:1,flex:1},children:a}),i&&M.jsxs(M.Fragment,{children:[M.jsx(Oe,{width:n,strokeWeight:"thick"}),M.jsx("div",{className:le["drawui-card-footer"],style:{position:"relative",zIndex:1},children:i})]})]})},qe={"drawui-collapse":"_drawui-collapse_mgu8u_1","drawui-collapse-content":"_drawui-collapse-content_mgu8u_22"},Wt=({header:o,children:e,strokeWeight:n="medium",radius:s="md",width:t=300,className:r})=>{const i=O(),a=y.useRef(null);return y.useEffect(()=>{if(!a.current)return;const u=L.svg(a.current);a.current.innerHTML="";const l=i.stroke[n],c=u.path(X(0,0,t,40,i.radius[s]),{stroke:l.color,strokeWidth:l.width,fill:"transparent",roughness:i.roughness.roughness,bowing:i.roughness.bowing});a.current.appendChild(c)},[i,n,s,t]),M.jsx("div",{className:`${qe["drawui-collapse"]} ${r??""}`,style:{width:t},children:M.jsxs("details",{children:[M.jsxs("summary",{style:{position:"relative"},children:[M.jsx("svg",{ref:a,width:t,height:40,style:{position:"absolute",inset:0,pointerEvents:"none"}}),M.jsx("span",{style:{position:"relative",zIndex:1},children:o})]}),M.jsx("div",{className:qe["drawui-collapse-content"],children:e})]})})},Ft={},Ht=({strokeWeight:o="medium",radius:e="md",size:n="sm",icon:s,backgroundColor:t,...r})=>{const i=O(),a=y.useRef(null),[u,l]=y.useState(!1),c=i.buttonSize[n].height;return y.useEffect(()=>{if(!a.current)return;const h=L.svg(a.current);a.current.innerHTML="";const f=i.stroke[o],d=h.path(X(0,0,c,c,i.radius[e]),{stroke:f.color,strokeWidth:f.width,fill:t??i.fill.background,roughness:u?i.roughness.roughness+1:i.roughness.roughness,bowing:i.roughness.bowing});a.current.appendChild(d)},[u,o,e,i,c,t]),M.jsxs("button",{...r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`${Ft["drawui-button"]} ${r.className??""}`,style:{position:"relative",width:c,height:c,border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:[M.jsx("svg",{ref:a,width:c,height:c,style:{position:"absolute",inset:0,pointerEvents:"none"}}),M.jsx("span",{style:{position:"relative",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:s})]})},Ge={"drawui-input":"_drawui-input_15az9_1","drawui-input-field":"_drawui-input-field_15az9_8"},qt=({strokeWeight:o="medium",backgroundColor:e,radius:n="md",inputSize:s="md",className:t,style:r,...i})=>{const a=O(),u=y.useRef(null),l=y.useRef(null),[c,h]=y.useState(!1),[f,d]=y.useState(!1),g=a.inputSize[s].height,m=a.inputSize[s].fontSize,b=a.inputSize[s].paddingX;return y.useEffect(()=>{if(!u.current||!l.current)return;const v=l.current.offsetWidth,_=L.svg(u.current);u.current.innerHTML="";const D=a.stroke[o],q=_.path(X(0,0,v,g,a.radius[n]),{stroke:D.color,strokeWidth:D.width,fill:e??a.fill.background,roughness:c?a.roughness.roughness+1:a.roughness.roughness,bowing:a.roughness.bowing});u.current.appendChild(q)},[c,f,o,n,s,a,e]),M.jsxs("div",{ref:l,className:`${Ge["drawui-input"]} ${t??""}`,style:{height:g,...r},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[M.jsx("svg",{ref:u,width:"100%",height:g,style:{position:"absolute",inset:0}}),M.jsx("input",{...i,className:Ge["drawui-input-field"],style:{height:g,fontSize:m,paddingLeft:b,paddingRight:b},onFocus:v=>{h(!0),i.onFocus?.(v)},onBlur:v=>{h(!1),i.onBlur?.(v)}})]})},Gt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.path("M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const c=i.circle(12,18,2,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(c)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Vt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.path("M2 12 L12 2 L22 12 V22 H2 Z",{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(l)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Bt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.line(4,12,20,12,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(l)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Yt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.line(12,4,12,20,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing}),c=i.line(4,12,20,12,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(l),r.current.appendChild(c)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Zt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.circle(10,10,14,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"}),c=i.line(16,16,22,22,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(l),r.current.appendChild(c)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Ut=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.circle(12,12,14,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(l);for(let c=0;c<8;c++){const h=c*Math.PI*2/8,f=12+7*Math.cos(h),d=12+7*Math.sin(h),g=12+10*Math.cos(h),m=12+10*Math.sin(h),b=i.line(f,d,g,m,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing});r.current.appendChild(b)}},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})},Xt=({size:o=24,strokeWeight:e="medium",color:n,className:s})=>{const t=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=t.stroke[e],u=n??a.color,l=i.circle(12,8,6,{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const c=i.path("M4 20 Q12 16 20 20",{stroke:u,strokeWidth:a.width,roughness:t.roughness.roughness,bowing:t.roughness.bowing,fill:"transparent"});r.current.appendChild(c)},[t,e,n]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:s})};exports.DrawuiButton=Dt;exports.DrawuiCard=Nt;exports.DrawuiCollapse=Wt;exports.DrawuiDivider=Oe;exports.DrawuiIconButton=Ht;exports.DrawuiInput=qt;exports.DrawuiThemeProvider=$t;exports.IconBell=Gt;exports.IconHome=Vt;exports.IconMinus=Bt;exports.IconPlus=Yt;exports.IconSearch=Zt;exports.IconSettings=Ut;exports.IconUser=Xt;exports.useDrawuiTheme=O;
|
|
6
|
+
<%s key={someKey} {...props} />`,E,R,q,R),V[R+E]=!0)}if(R=null,S!==void 0&&(s(S),R=""+S),i(w)&&(s(w.key),R=""+w.key),"key"in w){S={};for(var we in w)we!=="key"&&(S[we]=w[we])}else S=w;return R&&a(S,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,R,S,n(),oe,ve)}function h(p){f(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===D&&(p._payload.status==="fulfilled"?f(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function f(p){return typeof p=="object"&&p!==null&&p.$$typeof===g}var d=M,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),$=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),T=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,j=Array.isArray,N=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(p){return p()}};var z,F={},ne=d.react_stack_bottom_frame.bind(d,r)(),re=N(t(r)),V={};Y.Fragment=b,Y.jsx=function(p,w,S){var E=1e4>T.recentlyCreatedOwnerStacks++;return u(p,w,S,!1,E?Error("react-stack-top-frame"):ne,E?N(t(p)):re)},Y.jsxs=function(p,w,S){var E=1e4>T.recentlyCreatedOwnerStacks++;return u(p,w,S,!0,E?Error("react-stack-top-frame"):ne,E?N(t(p)):re)}})()),Y}var $e;function st(){return $e||($e=1,process.env.NODE_ENV==="production"?ae.exports=et():ae.exports=tt()),ae.exports}var y=st();function Se(o,e,s){if(o&&o.length){const[t,n]=e,r=Math.PI/180*s,i=Math.cos(r),a=Math.sin(r);for(const c of o){const[l,u]=c;c[0]=(l-t)*i-(u-n)*a+t,c[1]=(l-t)*a+(u-n)*i+n}}}function nt(o,e,s){const t=[];o.forEach(n=>t.push(...n)),Se(t,e,s)}function rt(o,e){return o[0]===e[0]&&o[1]===e[1]}function ot(o,e,s,t=1){const n=s,r=Math.max(e,.1),i=o[0]&&o[0][0]&&typeof o[0][0]=="number"?[o]:o,a=[0,0];if(n)for(const l of i)Se(l,a,n);const c=at(i,r,t);if(n){for(const l of i)Se(l,a,-n);nt(c,a,-n)}return c}function at(o,e,s){const t=[];for(const l of o){const u=[...l];rt(u[0],u[u.length-1])||u.push([u[0][0],u[0][1]]),u.length>2&&t.push(u)}const n=[];e=Math.max(e,.1);const r=[];for(const l of t)for(let u=0;u<l.length-1;u++){const h=l[u],f=l[u+1];if(h[1]!==f[1]){const d=Math.min(h[1],f[1]);r.push({ymin:d,ymax:Math.max(h[1],f[1]),x:d===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(r.sort((l,u)=>l.ymin<u.ymin?-1:l.ymin>u.ymin?1:l.x<u.x?-1:l.x>u.x?1:l.ymax===u.ymax?0:(l.ymax-u.ymax)/Math.abs(l.ymax-u.ymax)),!r.length)return n;let i=[],a=r[0].ymin,c=0;for(;i.length||r.length;){if(r.length){let l=-1;for(let h=0;h<r.length&&!(r[h].ymin>a);h++)l=h;r.splice(0,l+1).forEach(h=>{i.push({s:a,edge:h})})}if(i=i.filter(l=>!(l.edge.ymax<=a)),i.sort((l,u)=>l.edge.x===u.edge.x?0:(l.edge.x-u.edge.x)/Math.abs(l.edge.x-u.edge.x)),(s!==1||c%e===0)&&i.length>1)for(let l=0;l<i.length;l=l+2){const u=l+1;if(u>=i.length)break;const h=i[l].edge,f=i[u].edge;n.push([[Math.round(h.x),a],[Math.round(f.x),a]])}a+=s,i.forEach(l=>{l.edge.x=l.edge.x+s*l.edge.islope}),c++}return n}function X(o,e){var s;const t=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=e.strokeWidth*4),n=Math.round(Math.max(n,.1));let r=1;return e.roughness>=1&&(((s=e.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(r=n),ot(o,n,t,r||1)}class Ce{constructor(e){this.helper=e}fillPolygons(e,s){return this._fillPolygons(e,s)}_fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.renderLines(t,s)}}renderLines(e,s){const t=[];for(const n of e)t.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return t}}function be(o){const e=o[0],s=o[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class it extends Ce{fillPolygons(e,s){let t=s.hachureGap;t<0&&(t=s.strokeWidth*4),t=Math.max(t,.1);const n=Object.assign({},s,{hachureGap:t}),r=X(e,n),i=Math.PI/180*s.hachureAngle,a=[],c=t*.5*Math.cos(i),l=t*.5*Math.sin(i);for(const[h,f]of r)be([h,f])&&a.push([[h[0]-c,h[1]+l],[...f]],[[h[0]+c,h[1]-l],[...f]]);return{type:"fillSketch",ops:this.renderLines(a,s)}}}class ct extends Ce{fillPolygons(e,s){const t=this._fillPolygons(e,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),r=this._fillPolygons(e,n);return t.ops=t.ops.concat(r.ops),t}}class ut{constructor(e){this.helper=e}fillPolygons(e,s){s=Object.assign({},s,{hachureAngle:0});const t=X(e,s);return this.dotsOnLines(t,s)}dotsOnLines(e,s){const t=[];let n=s.hachureGap;n<0&&(n=s.strokeWidth*4),n=Math.max(n,.1);let r=s.fillWeight;r<0&&(r=s.strokeWidth/2);const i=n/4;for(const a of e){const c=be(a),l=c/n,u=Math.ceil(l)-1,h=c-u*n,f=(a[0][0]+a[1][0])/2-n/4,d=Math.min(a[0][1],a[1][1]);for(let g=0;g<u;g++){const m=d+h+g*n,b=f-i+Math.random()*2*i,v=m-i+Math.random()*2*i,_=this.helper.ellipse(b,v,r,r,s);t.push(..._.ops)}}return{type:"fillSketch",ops:t}}}class lt{constructor(e){this.helper=e}fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.dashedLine(t,s)}}dashedLine(e,s){const t=s.dashOffset<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashOffset,n=s.dashGap<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashGap,r=[];return e.forEach(i=>{const a=be(i),c=Math.floor(a/(t+n)),l=(a+n-c*(t+n))/2;let u=i[0],h=i[1];u[0]>h[0]&&(u=i[1],h=i[0]);const f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d<c;d++){const g=d*(t+n),m=g+t,b=[u[0]+g*Math.cos(f)+l*Math.cos(f),u[1]+g*Math.sin(f)+l*Math.sin(f)],v=[u[0]+m*Math.cos(f)+l*Math.cos(f),u[1]+m*Math.sin(f)+l*Math.sin(f)];r.push(...this.helper.doubleLineOps(b[0],b[1],v[0],v[1],s))}}),r}}class ht{constructor(e){this.helper=e}fillPolygons(e,s){const t=s.hachureGap<0?s.strokeWidth*4:s.hachureGap,n=s.zigzagOffset<0?t:s.zigzagOffset;s=Object.assign({},s,{hachureGap:t+n});const r=X(e,s);return{type:"fillSketch",ops:this.zigzagLines(r,n,s)}}zigzagLines(e,s,t){const n=[];return e.forEach(r=>{const i=be(r),a=Math.round(i/(2*s));let c=r[0],l=r[1];c[0]>l[0]&&(c=r[1],l=r[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let h=0;h<a;h++){const f=h*2*s,d=(h+1)*2*s,g=Math.sqrt(2*Math.pow(s,2)),m=[c[0]+f*Math.cos(u),c[1]+f*Math.sin(u)],b=[c[0]+d*Math.cos(u),c[1]+d*Math.sin(u)],v=[m[0]+g*Math.cos(u+Math.PI/4),m[1]+g*Math.sin(u+Math.PI/4)];n.push(...this.helper.doubleLineOps(m[0],m[1],v[0],v[1],t),...this.helper.doubleLineOps(v[0],v[1],b[0],b[1],t))}}),n}}const x={};function ft(o,e){let s=o.fillStyle||"hachure";if(!x[s])switch(s){case"zigzag":x[s]||(x[s]=new it(e));break;case"cross-hatch":x[s]||(x[s]=new ct(e));break;case"dots":x[s]||(x[s]=new ut(e));break;case"dashed":x[s]||(x[s]=new lt(e));break;case"zigzag-line":x[s]||(x[s]=new ht(e));break;default:s="hachure",x[s]||(x[s]=new Ce(e));break}return x[s]}function dt(){return Math.floor(Math.random()*2**31)}class pt{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const gt=0,Pe=1,Ve=2,ie={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function mt(o){const e=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:gt,text:RegExp.$1},o=o.substr(RegExp.$1.length);else if(o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))e[e.length]={type:Pe,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length);else return[];return e[e.length]={type:Ve,text:""},e}function Me(o,e){return o.type===e}function Le(o){const e=[],s=mt(o);let t="BOD",n=0,r=s[n];for(;!Me(r,Ve);){let i=0;const a=[];if(t==="BOD")if(r.text==="M"||r.text==="m")n++,i=ie[r.text],t=r.text;else return Le("M0,0"+o);else Me(r,Pe)?i=ie[t]:(n++,i=ie[r.text],t=r.text);if(n+i<s.length){for(let c=n;c<n+i;c++){const l=s[c];if(Me(l,Pe))a[a.length]=+l.text;else throw new Error("Param not a number: "+t+","+l.text)}if(typeof ie[t]=="number"){const c={key:t,data:a};e.push(c),n+=i,r=s[n],t==="M"&&(t="L"),t==="m"&&(t="l")}else throw new Error("Bad segment: "+t)}else throw new Error("Path data ended short")}return e}function Be(o){let e=0,s=0,t=0,n=0;const r=[];for(const{key:i,data:a}of o)switch(i){case"M":r.push({key:"M",data:[...a]}),[e,s]=a,[t,n]=a;break;case"m":e+=a[0],s+=a[1],r.push({key:"M",data:[e,s]}),t=e,n=s;break;case"L":r.push({key:"L",data:[...a]}),[e,s]=a;break;case"l":e+=a[0],s+=a[1],r.push({key:"L",data:[e,s]});break;case"C":r.push({key:"C",data:[...a]}),e=a[4],s=a[5];break;case"c":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"C",data:c}),e=c[4],s=c[5];break}case"Q":r.push({key:"Q",data:[...a]}),e=a[2],s=a[3];break;case"q":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"Q",data:c}),e=c[2],s=c[3];break}case"A":r.push({key:"A",data:[...a]}),e=a[5],s=a[6];break;case"a":e+=a[5],s+=a[6],r.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,s]});break;case"H":r.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],r.push({key:"H",data:[e]});break;case"V":r.push({key:"V",data:[...a]}),s=a[0];break;case"v":s+=a[0],r.push({key:"V",data:[s]});break;case"S":r.push({key:"S",data:[...a]}),e=a[2],s=a[3];break;case"s":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"S",data:c}),e=c[2],s=c[3];break}case"T":r.push({key:"T",data:[...a]}),e=a[0],s=a[1];break;case"t":e+=a[0],s+=a[1],r.push({key:"T",data:[e,s]});break;case"Z":case"z":r.push({key:"Z",data:[]}),e=t,s=n;break}return r}function Ye(o){const e=[];let s="",t=0,n=0,r=0,i=0,a=0,c=0;for(const{key:l,data:u}of o){switch(l){case"M":e.push({key:"M",data:[...u]}),[t,n]=u,[r,i]=u;break;case"C":e.push({key:"C",data:[...u]}),t=u[4],n=u[5],a=u[2],c=u[3];break;case"L":e.push({key:"L",data:[...u]}),[t,n]=u;break;case"H":t=u[0],e.push({key:"L",data:[t,n]});break;case"V":n=u[0],e.push({key:"L",data:[t,n]});break;case"S":{let h=0,f=0;s==="C"||s==="S"?(h=t+(t-a),f=n+(n-c)):(h=t,f=n),e.push({key:"C",data:[h,f,...u]}),a=u[0],c=u[1],t=u[2],n=u[3];break}case"T":{const[h,f]=u;let d=0,g=0;s==="Q"||s==="T"?(d=t+(t-a),g=n+(n-c)):(d=t,g=n);const m=t+2*(d-t)/3,b=n+2*(g-n)/3,v=h+2*(d-h)/3,_=f+2*(g-f)/3;e.push({key:"C",data:[m,b,v,_,h,f]}),a=d,c=g,t=h,n=f;break}case"Q":{const[h,f,d,g]=u,m=t+2*(h-t)/3,b=n+2*(f-n)/3,v=d+2*(h-d)/3,_=g+2*(f-g)/3;e.push({key:"C",data:[m,b,v,_,d,g]}),a=h,c=f,t=d,n=g;break}case"A":{const h=Math.abs(u[0]),f=Math.abs(u[1]),d=u[2],g=u[3],m=u[4],b=u[5],v=u[6];h===0||f===0?(e.push({key:"C",data:[t,n,b,v,b,v]}),t=b,n=v):(t!==b||n!==v)&&(Ze(t,n,b,v,h,f,d,g,m).forEach(function(C){e.push({key:"C",data:C})}),t=b,n=v);break}case"Z":e.push({key:"Z",data:[]}),t=r,n=i;break}s=l}return e}function kt(o){return Math.PI*o/180}function Z(o,e,s){const t=o*Math.cos(s)-e*Math.sin(s),n=o*Math.sin(s)+e*Math.cos(s);return[t,n]}function Ze(o,e,s,t,n,r,i,a,c,l){const u=kt(i);let h=[],f=0,d=0,g=0,m=0;if(l)[f,d,g,m]=l;else{[o,e]=Z(o,e,-u),[s,t]=Z(s,t,-u);const T=(o-s)/2,P=(e-t)/2;let j=T*T/(n*n)+P*P/(r*r);j>1&&(j=Math.sqrt(j),n=j*n,r=j*r);const N=a===c?-1:1,z=n*n,F=r*r,ne=z*F-z*P*P-F*T*T,re=z*P*P+F*T*T,V=N*Math.sqrt(Math.abs(ne/re));g=V*n*P/r+(o+s)/2,m=V*-r*T/n+(e+t)/2,f=Math.asin(parseFloat(((e-m)/r).toFixed(9))),d=Math.asin(parseFloat(((t-m)/r).toFixed(9))),o<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=Math.PI*2+f),d<0&&(d=Math.PI*2+d),c&&f>d&&(f=f-Math.PI*2),!c&&d>f&&(d=d-Math.PI*2)}let b=d-f;if(Math.abs(b)>Math.PI*120/180){const T=d,P=s,j=t;c&&d>f?d=f+Math.PI*120/180*1:d=f+Math.PI*120/180*-1,s=g+n*Math.cos(d),t=m+r*Math.sin(d),h=Ze(s,t,P,j,n,r,i,0,c,[d,T,g,m])}b=d-f;const v=Math.cos(f),_=Math.sin(f),C=Math.cos(d),$=Math.sin(d),I=Math.tan(b/4),J=4/3*n*I,K=4/3*r*I,ee=[o,e],D=[o+J*_,e-K*v],te=[s+J*$,t-K*C],se=[s,t];if(D[0]=2*ee[0]-D[0],D[1]=2*ee[1]-D[1],l)return[D,te,se].concat(h);{h=[D,te,se].concat(h);const T=[];for(let P=0;P<h.length;P+=3){const j=Z(h[P][0],h[P][1],u),N=Z(h[P+1][0],h[P+1][1],u),z=Z(h[P+2][0],h[P+2][1],u);T.push([j[0],j[1],N[0],N[1],z[0],z[1]])}return T}}const bt={randOffset:_t,randOffsetWithRange:St,ellipse:Mt,doubleLineOps:Pt};function Ue(o,e,s,t,n){return{type:"path",ops:W(o,e,s,t,n)}}function he(o,e,s){const t=(o||[]).length;if(t>2){const n=[];for(let r=0;r<t-1;r++)n.push(...W(o[r][0],o[r][1],o[r+1][0],o[r+1][1],s));return e&&n.push(...W(o[t-1][0],o[t-1][1],o[0][0],o[0][1],s)),{type:"path",ops:n}}else if(t===2)return Ue(o[0][0],o[0][1],o[1][0],o[1][1],s);return{type:"path",ops:[]}}function vt(o,e){return he(o,!0,e)}function wt(o,e,s,t,n){const r=[[o,e],[o+s,e],[o+s,e+t],[o,e+t]];return vt(r,n)}function De(o,e){if(o.length){const t=typeof o[0][0]=="number"?[o]:o,n=ce(t[0],1*(1+e.roughness*.2),e),r=e.disableMultiStroke?[]:ce(t[0],1.5*(1+e.roughness*.22),Ne(e));for(let i=1;i<t.length;i++){const a=t[i];if(a.length){const c=ce(a,1*(1+e.roughness*.2),e),l=e.disableMultiStroke?[]:ce(a,1.5*(1+e.roughness*.22),Ne(e));for(const u of c)u.op!=="move"&&n.push(u);for(const u of l)u.op!=="move"&&r.push(u)}}return{type:"path",ops:n.concat(r)}}return{type:"path",ops:[]}}function Mt(o,e,s,t,n){const r=Xe(s,t,n);return Ee(o,e,n,r).opset}function Xe(o,e,s){const t=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(o/2,2)+Math.pow(e/2,2))/2)),n=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*t)),r=Math.PI*2/n;let i=Math.abs(o/2),a=Math.abs(e/2);const c=1-s.curveFitting;return i+=k(i*c,s),a+=k(a*c,s),{increment:r,rx:i,ry:a}}function Ee(o,e,s,t){const[n,r]=We(t.increment,o,e,t.rx,t.ry,1,t.increment*pe(.1,pe(.4,1,s),s),s);let i=ge(n,null,s);if(!s.disableMultiStroke&&s.roughness!==0){const[a]=We(t.increment,o,e,t.rx,t.ry,1.5,0,s),c=ge(a,null,s);i=i.concat(c)}return{estimatedPoints:r,opset:{type:"path",ops:i}}}function ze(o,e,s,t,n,r,i,a,c){const l=o,u=e;let h=Math.abs(s/2),f=Math.abs(t/2);h+=k(h*.01,c),f+=k(f*.01,c);let d=n,g=r;for(;d<0;)d+=Math.PI*2,g+=Math.PI*2;g-d>Math.PI*2&&(d=0,g=Math.PI*2);const m=Math.PI*2/c.curveStepCount,b=Math.min(m/2,(g-d)/2),v=He(b,l,u,h,f,d,g,1,c);if(!c.disableMultiStroke){const _=He(b,l,u,h,f,d,g,1.5,c);v.push(..._)}return i&&(a?v.push(...W(l,u,l+h*Math.cos(d),u+f*Math.sin(d),c),...W(l,u,l+h*Math.cos(g),u+f*Math.sin(g),c)):v.push({op:"lineTo",data:[l,u]},{op:"lineTo",data:[l+h*Math.cos(d),u+f*Math.sin(d)]})),{type:"path",ops:v}}function Ie(o,e){const s=Ye(Be(Le(o))),t=[];let n=[0,0],r=[0,0];for(const{key:i,data:a}of s)switch(i){case"M":{r=[a[0],a[1]],n=[a[0],a[1]];break}case"L":t.push(...W(r[0],r[1],a[0],a[1],e)),r=[a[0],a[1]];break;case"C":{const[c,l,u,h,f,d]=a;t.push(...Et(c,l,u,h,f,d,r,e)),r=[f,d];break}case"Z":t.push(...W(r[0],r[1],n[0],n[1],e)),r=[n[0],n[1]];break}return{type:"path",ops:t}}function ye(o,e){const s=[];for(const t of o)if(t.length){const n=e.maxRandomnessOffset||0,r=t.length;if(r>2){s.push({op:"move",data:[t[0][0]+k(n,e),t[0][1]+k(n,e)]});for(let i=1;i<r;i++)s.push({op:"lineTo",data:[t[i][0]+k(n,e),t[i][1]+k(n,e)]})}}return{type:"fillPath",ops:s}}function G(o,e){return ft(e,bt).fillPolygons(o,e)}function yt(o,e,s,t,n,r,i){const a=o,c=e;let l=Math.abs(s/2),u=Math.abs(t/2);l+=k(l*.01,i),u+=k(u*.01,i);let h=n,f=r;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const d=(f-h)/i.curveStepCount,g=[];for(let m=h;m<=f;m=m+d)g.push([a+l*Math.cos(m),c+u*Math.sin(m)]);return g.push([a+l*Math.cos(f),c+u*Math.sin(f)]),g.push([a,c]),G([g],i)}function _t(o,e){return k(o,e)}function St(o,e,s){return pe(o,e,s)}function Pt(o,e,s,t,n){return W(o,e,s,t,n,!0)}function Ne(o){const e=Object.assign({},o);return e.randomizer=void 0,o.seed&&(e.seed=o.seed+1),e}function Qe(o){return o.randomizer||(o.randomizer=new pt(o.seed||0)),o.randomizer.next()}function pe(o,e,s,t=1){return s.roughness*t*(Qe(s)*(e-o)+o)}function k(o,e,s=1){return pe(-o,o,e,s)}function W(o,e,s,t,n,r=!1){const i=r?n.disableMultiStrokeFill:n.disableMultiStroke,a=Re(o,e,s,t,n,!0,!1);if(i)return a;const c=Re(o,e,s,t,n,!0,!0);return a.concat(c)}function Re(o,e,s,t,n,r,i){const a=Math.pow(o-s,2)+Math.pow(e-t,2),c=Math.sqrt(a);let l=1;c<200?l=1:c>500?l=.4:l=-.0016668*c+1.233334;let u=n.maxRandomnessOffset||0;u*u*100>a&&(u=c/10);const h=u/2,f=.2+Qe(n)*.2;let d=n.bowing*n.maxRandomnessOffset*(t-e)/200,g=n.bowing*n.maxRandomnessOffset*(o-s)/200;d=k(d,n,l),g=k(g,n,l);const m=[],b=()=>k(h,n,l),v=()=>k(u,n,l),_=n.preserveVertices;return i?m.push({op:"move",data:[o+(_?0:b()),e+(_?0:b())]}):m.push({op:"move",data:[o+(_?0:k(u,n,l)),e+(_?0:k(u,n,l))]}),i?m.push({op:"bcurveTo",data:[d+o+(s-o)*f+b(),g+e+(t-e)*f+b(),d+o+2*(s-o)*f+b(),g+e+2*(t-e)*f+b(),s+(_?0:b()),t+(_?0:b())]}):m.push({op:"bcurveTo",data:[d+o+(s-o)*f+v(),g+e+(t-e)*f+v(),d+o+2*(s-o)*f+v(),g+e+2*(t-e)*f+v(),s+(_?0:v()),t+(_?0:v())]}),m}function ce(o,e,s){if(!o.length)return[];const t=[];t.push([o[0][0]+k(e,s),o[0][1]+k(e,s)]),t.push([o[0][0]+k(e,s),o[0][1]+k(e,s)]);for(let n=1;n<o.length;n++)t.push([o[n][0]+k(e,s),o[n][1]+k(e,s)]),n===o.length-1&&t.push([o[n][0]+k(e,s),o[n][1]+k(e,s)]);return ge(t,null,s)}function ge(o,e,s){const t=o.length,n=[];if(t>3){const r=[],i=1-s.curveTightness;n.push({op:"move",data:[o[1][0],o[1][1]]});for(let a=1;a+2<t;a++){const c=o[a];r[0]=[c[0],c[1]],r[1]=[c[0]+(i*o[a+1][0]-i*o[a-1][0])/6,c[1]+(i*o[a+1][1]-i*o[a-1][1])/6],r[2]=[o[a+1][0]+(i*o[a][0]-i*o[a+2][0])/6,o[a+1][1]+(i*o[a][1]-i*o[a+2][1])/6],r[3]=[o[a+1][0],o[a+1][1]],n.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else t===3?(n.push({op:"move",data:[o[1][0],o[1][1]]}),n.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[2][0],o[2][1]]})):t===2&&n.push(...Re(o[0][0],o[0][1],o[1][0],o[1][1],s,!0,!0));return n}function We(o,e,s,t,n,r,i,a){const c=a.roughness===0,l=[],u=[];if(c){o=o/4,u.push([e+t*Math.cos(-o),s+n*Math.sin(-o)]);for(let h=0;h<=Math.PI*2;h=h+o){const f=[e+t*Math.cos(h),s+n*Math.sin(h)];l.push(f),u.push(f)}u.push([e+t*Math.cos(0),s+n*Math.sin(0)]),u.push([e+t*Math.cos(o),s+n*Math.sin(o)])}else{const h=k(.5,a)-Math.PI/2;u.push([k(r,a)+e+.9*t*Math.cos(h-o),k(r,a)+s+.9*n*Math.sin(h-o)]);const f=Math.PI*2+h-.01;for(let d=h;d<f;d=d+o){const g=[k(r,a)+e+t*Math.cos(d),k(r,a)+s+n*Math.sin(d)];l.push(g),u.push(g)}u.push([k(r,a)+e+t*Math.cos(h+Math.PI*2+i*.5),k(r,a)+s+n*Math.sin(h+Math.PI*2+i*.5)]),u.push([k(r,a)+e+.98*t*Math.cos(h+i),k(r,a)+s+.98*n*Math.sin(h+i)]),u.push([k(r,a)+e+.9*t*Math.cos(h+i*.5),k(r,a)+s+.9*n*Math.sin(h+i*.5)])}return[u,l]}function He(o,e,s,t,n,r,i,a,c){const l=r+k(.1,c),u=[];u.push([k(a,c)+e+.9*t*Math.cos(l-o),k(a,c)+s+.9*n*Math.sin(l-o)]);for(let h=l;h<=i;h=h+o)u.push([k(a,c)+e+t*Math.cos(h),k(a,c)+s+n*Math.sin(h)]);return u.push([e+t*Math.cos(i),s+n*Math.sin(i)]),u.push([e+t*Math.cos(i),s+n*Math.sin(i)]),ge(u,null,c)}function Et(o,e,s,t,n,r,i,a){const c=[],l=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const h=a.disableMultiStroke?1:2,f=a.preserveVertices;for(let d=0;d<h;d++)d===0?c.push({op:"move",data:[i[0],i[1]]}):c.push({op:"move",data:[i[0]+(f?0:k(l[0],a)),i[1]+(f?0:k(l[0],a))]}),u=f?[n,r]:[n+k(l[d],a),r+k(l[d],a)],c.push({op:"bcurveTo",data:[o+k(l[d],a),e+k(l[d],a),s+k(l[d],a),t+k(l[d],a),u[0],u[1]]});return c}function U(o){return[...o]}function Fe(o,e=0){const s=o.length;if(s<3)throw new Error("A curve must have at least three points.");const t=[];if(s===3)t.push(U(o[0]),U(o[1]),U(o[2]),U(o[2]));else{const n=[];n.push(o[0],o[0]);for(let a=1;a<o.length;a++)n.push(o[a]),a===o.length-1&&n.push(o[a]);const r=[],i=1-e;t.push(U(n[0]));for(let a=1;a+2<n.length;a++){const c=n[a];r[0]=[c[0],c[1]],r[1]=[c[0]+(i*n[a+1][0]-i*n[a-1][0])/6,c[1]+(i*n[a+1][1]-i*n[a-1][1])/6],r[2]=[n[a+1][0]+(i*n[a][0]-i*n[a+2][0])/6,n[a+1][1]+(i*n[a][1]-i*n[a+2][1])/6],r[3]=[n[a+1][0],n[a+1][1]],t.push(r[1],r[2],r[3])}}return t}function Rt(o,e){return Math.sqrt(fe(o,e))}function fe(o,e){return Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)}function Tt(o,e,s){const t=fe(e,s);if(t===0)return fe(o,e);let n=((o[0]-e[0])*(s[0]-e[0])+(o[1]-e[1])*(s[1]-e[1]))/t;return n=Math.max(0,Math.min(1,n)),fe(o,H(e,s,n))}function H(o,e,s){return[o[0]+(e[0]-o[0])*s,o[1]+(e[1]-o[1])*s]}function xt(o,e){const s=o[e+0],t=o[e+1],n=o[e+2],r=o[e+3];let i=3*t[0]-2*s[0]-r[0];i*=i;let a=3*t[1]-2*s[1]-r[1];a*=a;let c=3*n[0]-2*r[0]-s[0];c*=c;let l=3*n[1]-2*r[1]-s[1];return l*=l,i<c&&(i=c),a<l&&(a=l),i+a}function Te(o,e,s,t){const n=t||[];if(xt(o,e)<s){const r=o[e+0];n.length?Rt(n[n.length-1],r)>1&&n.push(r):n.push(r),n.push(o[e+3])}else{const i=o[e+0],a=o[e+1],c=o[e+2],l=o[e+3],u=H(i,a,.5),h=H(a,c,.5),f=H(c,l,.5),d=H(u,h,.5),g=H(h,f,.5),m=H(d,g,.5);Te([i,u,d,m],0,s,n),Te([m,g,f,l],0,s,n)}return n}function Ot(o,e){return me(o,0,o.length,e)}function me(o,e,s,t,n){const r=n||[],i=o[e],a=o[s-1];let c=0,l=1;for(let u=e+1;u<s-1;++u){const h=Tt(o[u],i,a);h>c&&(c=h,l=u)}return Math.sqrt(c)>t?(me(o,e,l+1,t,r),me(o,l,s,t,r)):(r.length||r.push(i),r.push(a)),r}function xe(o,e=.15,s){const t=[],n=(o.length-1)/3;for(let r=0;r<n;r++){const i=r*3;Te(o,i,e,t)}return s&&s>0?me(t,0,t.length,s):t}function Ct(o,e,s){const t=Le(o),n=Ye(Be(t)),r=[];let i=[],a=[0,0],c=[];const l=()=>{c.length>=4&&i.push(...xe(c,e)),c=[]},u=()=>{l(),i.length&&(r.push(i),i=[])};for(const{key:f,data:d}of n)switch(f){case"M":u(),a=[d[0],d[1]],i.push(a);break;case"L":l(),i.push([d[0],d[1]]);break;case"C":if(!c.length){const g=i.length?i[i.length-1]:a;c.push([g[0],g[1]])}c.push([d[0],d[1]]),c.push([d[2],d[3]]),c.push([d[4],d[5]]);break;case"Z":l(),i.push([a[0],a[1]]);break}if(u(),!s)return r;const h=[];for(const f of r){const d=Ot(f,s);d.length&&h.push(d)}return h}const L="none";class ke{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return dt()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,s,t){return{shape:e,sets:s||[],options:t||this.defaultOptions}}line(e,s,t,n,r){const i=this._o(r);return this._d("line",[Ue(e,s,t,n,i)],i)}rectangle(e,s,t,n,r){const i=this._o(r),a=[],c=wt(e,s,t,n,i);if(i.fill){const l=[[e,s],[e+t,s],[e+t,s+n],[e,s+n]];i.fillStyle==="solid"?a.push(ye([l],i)):a.push(G([l],i))}return i.stroke!==L&&a.push(c),this._d("rectangle",a,i)}ellipse(e,s,t,n,r){const i=this._o(r),a=[],c=Xe(t,n,i),l=Ee(e,s,i,c);if(i.fill)if(i.fillStyle==="solid"){const u=Ee(e,s,i,c).opset;u.type="fillPath",a.push(u)}else a.push(G([l.estimatedPoints],i));return i.stroke!==L&&a.push(l.opset),this._d("ellipse",a,i)}circle(e,s,t,n){const r=this.ellipse(e,s,t,t,n);return r.shape="circle",r}linearPath(e,s){const t=this._o(s);return this._d("linearPath",[he(e,!1,t)],t)}arc(e,s,t,n,r,i,a=!1,c){const l=this._o(c),u=[],h=ze(e,s,t,n,r,i,a,!0,l);if(a&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=ze(e,s,t,n,r,i,!0,!1,f);d.type="fillPath",u.push(d)}else u.push(yt(e,s,t,n,r,i,l));return l.stroke!==L&&u.push(h),this._d("arc",u,l)}curve(e,s){const t=this._o(s),n=[],r=De(e,t);if(t.fill&&t.fill!==L)if(t.fillStyle==="solid"){const i=De(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{const i=[],a=e;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const u of l)u.length<3?i.push(...u):u.length===3?i.push(...xe(Fe([u[0],u[0],u[1],u[2]]),10,(1+t.roughness)/2)):i.push(...xe(Fe(u),10,(1+t.roughness)/2))}i.length&&n.push(G([i],t))}return t.stroke!==L&&n.push(r),this._d("curve",n,t)}polygon(e,s){const t=this._o(s),n=[],r=he(e,!0,t);return t.fill&&(t.fillStyle==="solid"?n.push(ye([e],t)):n.push(G([e],t))),t.stroke!==L&&n.push(r),this._d("polygon",n,t)}path(e,s){const t=this._o(s),n=[];if(!e)return this._d("path",n,t);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=t.fill&&t.fill!=="transparent"&&t.fill!==L,i=t.stroke!==L,a=!!(t.simplification&&t.simplification<1),c=a?4-4*(t.simplification||1):(1+t.roughness)/2,l=Ct(e,1,c),u=Ie(e,t);if(r)if(t.fillStyle==="solid")if(l.length===1){const h=Ie(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else n.push(ye(l,t));else n.push(G(l,t));return i&&(a?l.forEach(h=>{n.push(he(h,!1,t))}):n.push(u)),this._d("path",n,t)}opsToPath(e,s){let t="";for(const n of e.ops){const r=typeof s=="number"&&s>=0?n.data.map(i=>+i.toFixed(s)):n.data;switch(n.op){case"move":t+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":t+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":t+=`L${r[0]} ${r[1]} `;break}}return t.trim()}toPaths(e){const s=e.sets||[],t=e.options||this.defaultOptions,n=[];for(const r of s){let i=null;switch(r.type){case"path":i={d:this.opsToPath(r),stroke:t.stroke,strokeWidth:t.strokeWidth,fill:L};break;case"fillPath":i={d:this.opsToPath(r),stroke:L,strokeWidth:0,fill:t.fill||L};break;case"fillSketch":i=this.fillSketch(r,t);break}i&&n.push(i)}return n}fillSketch(e,s){let t=s.fillWeight;return t<0&&(t=s.strokeWidth/2),{d:this.opsToPath(e),stroke:s.fill||L,strokeWidth:t,fill:L}}_mergedShape(e){return e.filter((s,t)=>t===0?!0:s.op!=="move")}}class Lt{constructor(e,s){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.ctx,r=e.options.fixedDecimalPlaceDigits;for(const i of s)switch(i.type){case"path":n.save(),n.strokeStyle=t.stroke==="none"?"transparent":t.stroke,n.lineWidth=t.strokeWidth,t.strokeLineDash&&n.setLineDash(t.strokeLineDash),t.strokeLineDashOffset&&(n.lineDashOffset=t.strokeLineDashOffset),this._drawToContext(n,i,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=t.fill||"";const a=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,i,r,a),n.restore();break}case"fillSketch":this.fillSketch(n,i,t);break}}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2),e.save(),t.fillLineDash&&e.setLineDash(t.fillLineDash),t.fillLineDashOffset&&(e.lineDashOffset=t.fillLineDashOffset),e.strokeStyle=t.fill||"",e.lineWidth=n,this._drawToContext(e,s,t.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,s,t,n="nonzero"){e.beginPath();for(const r of s.ops){const i=typeof t=="number"&&t>=0?r.data.map(a=>+a.toFixed(t)):r.data;switch(r.op){case"move":e.moveTo(i[0],i[1]);break;case"bcurveTo":e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case"lineTo":e.lineTo(i[0],i[1]);break}}s.type==="fillPath"?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,s,t,n,r){const i=this.gen.line(e,s,t,n,r);return this.draw(i),i}rectangle(e,s,t,n,r){const i=this.gen.rectangle(e,s,t,n,r);return this.draw(i),i}ellipse(e,s,t,n,r){const i=this.gen.ellipse(e,s,t,n,r);return this.draw(i),i}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r),r}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t),t}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t),t}arc(e,s,t,n,r,i,a=!1,c){const l=this.gen.arc(e,s,t,n,r,i,a,c);return this.draw(l),l}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t),t}path(e,s){const t=this.gen.path(e,s);return this.draw(t),t}}const ue="http://www.w3.org/2000/svg";class At{constructor(e,s){this.svg=e,this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,r=n.createElementNS(ue,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of s){let c=null;switch(a.type){case"path":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(a,i)),c.setAttribute("stroke",t.stroke),c.setAttribute("stroke-width",t.strokeWidth+""),c.setAttribute("fill","none"),t.strokeLineDash&&c.setAttribute("stroke-dasharray",t.strokeLineDash.join(" ").trim()),t.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${t.strokeLineDashOffset}`);break}case"fillPath":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(a,i)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",t.fill||""),(e.shape==="curve"||e.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(n,a,t);break}}c&&r.appendChild(c)}return r}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2);const r=e.createElementNS(ue,"path");return r.setAttribute("d",this.opsToPath(s,t.fixedDecimalPlaceDigits)),r.setAttribute("stroke",t.fill||""),r.setAttribute("stroke-width",n+""),r.setAttribute("fill","none"),t.fillLineDash&&r.setAttribute("stroke-dasharray",t.fillLineDash.join(" ").trim()),t.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${t.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,s){return this.gen.opsToPath(e,s)}line(e,s,t,n,r){const i=this.gen.line(e,s,t,n,r);return this.draw(i)}rectangle(e,s,t,n,r){const i=this.gen.rectangle(e,s,t,n,r);return this.draw(i)}ellipse(e,s,t,n,r){const i=this.gen.ellipse(e,s,t,n,r);return this.draw(i)}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r)}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t)}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t)}arc(e,s,t,n,r,i,a=!1,c){const l=this.gen.arc(e,s,t,n,r,i,a,c);return this.draw(l)}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t)}path(e,s){const t=this.gen.path(e,s);return this.draw(t)}}const A={canvas(o,e){return new Lt(o,e)},svg(o,e){return new At(o,e)},generator(o){return new ke(o)},newSeed(){return ke.newSeed()}},Q=(o,e,s,t,n)=>`M${o+n},${e}
|
|
7
|
+
H${o+s-n}
|
|
8
|
+
A${n},${n} 0 0 1 ${o+s},${e+n}
|
|
9
|
+
V${e+t-n}
|
|
10
|
+
A${n},${n} 0 0 1 ${o+s-n},${e+t}
|
|
11
|
+
H${o+n}
|
|
12
|
+
A${n},${n} 0 0 1 ${o},${e+t-n}
|
|
13
|
+
V${e+n}
|
|
14
|
+
A${n},${n} 0 0 1 ${o+n},${e}
|
|
15
|
+
Z`,jt={"drawui-button":"_drawui-button_1nx7z_1"},de={stroke:{thin:{color:"#333",width:1.5},medium:{color:"#333",width:2.5},thick:{color:"#333",width:4}},roughness:{roughness:3,bowing:2},fill:{background:"#ccccccff"},radius:{none:0,sm:6,md:10,lg:16,full:30},buttonSize:{sm:{width:100,height:40,fontSize:12},md:{width:130,height:50,fontSize:15},lg:{width:150,height:60,fontSize:18},xl:{width:170,height:70,fontSize:20}},inputSize:{sm:{height:32,fontSize:12,paddingX:8},md:{height:40,fontSize:14,paddingX:12},lg:{height:48,fontSize:16,paddingX:16},xl:{height:48,fontSize:16,paddingX:16}}},Je=M.createContext(de),$t=({theme:o,children:e})=>{const s={...de,...o,stroke:{...de.stroke,...o?.stroke},radius:{...de.radius,...o?.radius}};return y.jsx(Je.Provider,{value:s,children:e})},O=()=>M.useContext(Je),Dt=({strokeWeight:o="medium",radius:e="md",size:s="sm",backgroundColor:t,children:n,fillStyle:r,...i})=>{const a=O(),c=M.useRef(null),[l,u]=M.useState(!1),h=a.buttonSize[s].width,f=a.buttonSize[s].height,d=a.buttonSize[s].fontSize;return M.useEffect(()=>{if(!c.current)return;const g=A.svg(c.current);c.current.innerHTML="";const m=a.stroke[o],b=g.path(Q(0,0,h,f,a.radius[e]),{stroke:m.color,strokeWidth:m.width,fill:t??a.fill.background,fillStyle:r,roughness:l?a.roughness.roughness+1:a.roughness.roughness,bowing:a.roughness.bowing});c.current.appendChild(b)},[l,o,e,a]),y.jsxs("button",{...i,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${jt["drawui-button"]} ${i.className??""}`,style:{position:"relative",width:h,height:f,border:"none",background:"transparent",cursor:"pointer"},children:[y.jsx("svg",{ref:c,width:h,height:f,style:{position:"absolute",inset:0}}),y.jsx("span",{style:{position:"relative",fontSize:d,pointerEvents:"none"},children:n})]})},le={"drawui-card":"_drawui-card_vhoat_1","drawui-card-header":"_drawui-card-header_vhoat_7","drawui-card-body":"_drawui-card-body_vhoat_12","drawui-card-footer":"_drawui-card-footer_vhoat_17"},zt="_vertical_1tdom_6",It="_horizontal_1tdom_11",_e={"drawui-divider":"_drawui-divider_1tdom_1",vertical:zt,horizontal:It},Oe=({strokeWeight:o="medium",width:e="100%",vertical:s=!1,className:t,fillStyle:n})=>{const r=O(),i=M.useRef(null);return M.useEffect(()=>{if(!i.current)return;i.current.innerHTML="";const a=A.svg(i.current),c=r.stroke[o];if(s){const l=typeof e=="number"?e:100,u=a.line(0,0,0,l,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing});i.current.appendChild(u)}else{const l=typeof e=="number"?e:300,u=a.line(0,0,l,0,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing,fillStyle:n});i.current.appendChild(u)}},[r,o,e,s]),y.jsx("div",{className:`${_e["drawui-divider"]} ${s?_e.vertical:_e.horizontal} ${t??""}`,style:{width:s?void 0:e},children:y.jsx("svg",{ref:i,width:s?2:e,height:s?e:2,style:{display:"block"}})})},Nt=({strokeWeight:o="medium",radius:e="md",width:s=300,height:t,backgroundColor:n,header:r,footer:i,fillStyle:a,children:c,...l})=>{const u=O(),h=M.useRef(null),f=M.useRef(null),[d,g]=M.useState(!1),[m,b]=M.useState(t??200);M.useEffect(()=>{if(!f.current||t)return;const _=()=>{if(f.current){const $=f.current.scrollHeight;b($)}};_();const C=new ResizeObserver(_);return C.observe(f.current),()=>C.disconnect()},[c,r,i,t]),M.useEffect(()=>{if(!h.current)return;const _=A.svg(h.current);h.current.innerHTML="";const C=u.stroke[o],$=t??m,I=_.path(Q(0,0,s,$,u.radius[e]),{stroke:C.color,strokeWidth:C.width,fill:n??u.fill.background,roughness:d?u.roughness.roughness+1:u.roughness.roughness,bowing:u.roughness.bowing,fillStyle:a});h.current.appendChild(I)},[o,e,s,m,t,n,u,d,a]);const v=t??m;return y.jsxs("div",{...l,ref:f,className:`${le["drawui-card"]} ${l.className??""}`,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{position:"relative",width:s,minHeight:t||"auto",height:t||"auto",cursor:"default",display:"flex",flexDirection:"column",overflow:"hidden"},children:[y.jsx("svg",{ref:h,width:s,height:v,style:{position:"absolute",inset:0,pointerEvents:"none"}}),r&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:le["drawui-card-header"],style:{position:"relative",zIndex:1},children:r}),y.jsx(Oe,{width:s,strokeWeight:"thick"})]}),y.jsx("div",{className:le["drawui-card-body"],style:{position:"relative",zIndex:1,flex:1},children:c}),i&&y.jsxs(y.Fragment,{children:[y.jsx(Oe,{width:s,strokeWeight:"thick"}),y.jsx("div",{className:le["drawui-card-footer"],style:{position:"relative",zIndex:1},children:i})]})]})},qe={"drawui-collapse":"_drawui-collapse_mgu8u_1","drawui-collapse-content":"_drawui-collapse-content_mgu8u_22"},Wt=({header:o,children:e,strokeWeight:s="medium",radius:t="md",width:n=300,fillStyle:r,className:i})=>{const a=O(),c=M.useRef(null);return M.useEffect(()=>{if(!c.current)return;const l=A.svg(c.current);c.current.innerHTML="";const u=a.stroke[s],h=l.path(Q(0,0,n,40,a.radius[t]),{stroke:u.color,strokeWidth:u.width,fill:"transparent",roughness:a.roughness.roughness,bowing:a.roughness.bowing,fillStyle:r});c.current.appendChild(h)},[a,s,t,n]),y.jsx("div",{className:`${qe["drawui-collapse"]} ${i??""}`,style:{width:n},children:y.jsxs("details",{children:[y.jsxs("summary",{style:{position:"relative"},children:[y.jsx("svg",{ref:c,width:n,height:40,style:{position:"absolute",inset:0,pointerEvents:"none"}}),y.jsx("span",{style:{position:"relative",zIndex:1},children:o})]}),y.jsx("div",{className:qe["drawui-collapse-content"],children:e})]})})},Ht={},Ft=({strokeWeight:o="medium",radius:e="md",size:s="sm",icon:t,fillStyle:n,backgroundColor:r,...i})=>{const a=O(),c=M.useRef(null),[l,u]=M.useState(!1),h=a.buttonSize[s].height;return M.useEffect(()=>{if(!c.current)return;const f=A.svg(c.current);c.current.innerHTML="";const d=a.stroke[o],g=f.path(Q(0,0,h,h,a.radius[e]),{stroke:d.color,strokeWidth:d.width,fill:r??a.fill.background,roughness:l?a.roughness.roughness+1:a.roughness.roughness,bowing:a.roughness.bowing,fillStyle:n});c.current.appendChild(g)},[l,o,e,a,h,r]),y.jsxs("button",{...i,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${Ht["drawui-button"]} ${i.className??""}`,style:{position:"relative",width:h,height:h,border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:[y.jsx("svg",{ref:c,width:h,height:h,style:{position:"absolute",inset:0,pointerEvents:"none"}}),y.jsx("span",{style:{position:"relative",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:t})]})},Ge={"drawui-input":"_drawui-input_15az9_1","drawui-input-field":"_drawui-input-field_15az9_8"},qt=({strokeWeight:o="medium",backgroundColor:e,radius:s="md",inputSize:t="md",className:n,fillStyle:r,style:i,...a})=>{const c=O(),l=M.useRef(null),u=M.useRef(null),[h,f]=M.useState(!1),[d,g]=M.useState(!1),m=c.inputSize[t].height,b=c.inputSize[t].fontSize,v=c.inputSize[t].paddingX;return M.useEffect(()=>{if(!l.current||!u.current)return;const _=u.current.offsetWidth,C=A.svg(l.current);l.current.innerHTML="";const $=c.stroke[o],I=C.path(Q(0,0,_,m,c.radius[s]),{stroke:$.color,strokeWidth:$.width,fill:e??c.fill.background,roughness:h?c.roughness.roughness+1:c.roughness.roughness,bowing:c.roughness.bowing,fillStyle:r});l.current.appendChild(I)},[h,d,o,s,t,c,e]),y.jsxs("div",{ref:u,className:`${Ge["drawui-input"]} ${n??""}`,style:{height:m,...i},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[y.jsx("svg",{ref:l,width:"100%",height:m,style:{position:"absolute",inset:0}}),y.jsx("input",{...a,className:Ge["drawui-input-field"],style:{height:m,fontSize:b,paddingLeft:v,paddingRight:v},onFocus:_=>{f(!0),a.onFocus?.(_)},onBlur:_=>{f(!1),a.onBlur?.(_)}})]})},Gt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.path("M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=i.circle(12,18,2,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Vt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.path("M2 12 L12 2 L22 12 V22 H2 Z",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Bt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.line(4,12,20,12,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Yt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.line(12,4,12,20,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing}),u=i.line(4,12,20,12,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Zt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(10,10,14,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"}),u=i.line(16,16,22,22,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Ut=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(12,12,14,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);for(let u=0;u<8;u++){const h=u*Math.PI*2/8,f=12+7*Math.cos(h),d=12+7*Math.sin(h),g=12+10*Math.cos(h),m=12+10*Math.sin(h),b=i.line(f,d,g,m,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(b)}},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Xt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=M.useRef(null);return M.useEffect(()=>{if(!r.current)return;const i=A.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(12,8,6,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=i.path("M4 20 Q12 16 20 20",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})};exports.DrawuiButton=Dt;exports.DrawuiCard=Nt;exports.DrawuiCollapse=Wt;exports.DrawuiDivider=Oe;exports.DrawuiIconButton=Ft;exports.DrawuiInput=qt;exports.DrawuiThemeProvider=$t;exports.IconBell=Gt;exports.IconHome=Vt;exports.IconMinus=Bt;exports.IconPlus=Yt;exports.IconSearch=Zt;exports.IconSettings=Ut;exports.IconUser=Xt;exports.useDrawuiTheme=O;
|