@svgsketch/core 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +880 -486
- package/dist/index.d.ts +880 -486
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var St=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var xn=Object.getOwnPropertyNames;var Sn=Object.prototype.hasOwnProperty;var _n=(n,e)=>{for(var t in e)St(n,t,{get:e[t],enumerable:!0})},kn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xn(e))!Sn.call(n,i)&&i!==t&&St(n,i,{get:()=>e[i],enumerable:!(r=bn(e,i))||r.enumerable});return n};var wn=n=>kn(St({},"__esModule",{value:!0}),n);var di={};_n(di,{Arrow:()=>gt,BUILTIN_MARKER_ID_MAP:()=>Ct,CURRENT_SCHEMA_VERSION:()=>N,Circle:()=>rt,Cross:()=>dt,DEFAULT_COORDINATE_PRECISION:()=>Kt,Document:()=>et,EASING_CURVES:()=>me,EVENT_TRIGGER_OPTIONS:()=>vn,EasingType:()=>_t,Ellipse:()=>it,Gear:()=>ft,ImageShape:()=>bt,Line:()=>ot,LinearGradientBuilder:()=>he,MARKER_HEIGHT:()=>We,MARKER_VIEWBOX:()=>ue,MARKER_WIDTH:()=>ze,MAX_COORDINATE_PRECISION:()=>Zt,MIGRATIONS:()=>wt,NGon:()=>ct,PatternBuilder:()=>pe,Polyline:()=>yt,RadialGradientBuilder:()=>de,Rectangle:()=>st,Ring:()=>pt,ShapeBuilder:()=>L,Spiral:()=>mt,Spline:()=>$t,SplineCurveType:()=>kt,SplinePointType:()=>Xt,Square:()=>at,Star:()=>ht,Text:()=>lt,Timeline:()=>nt,Track:()=>tt,Triangle:()=>ut,computeArrowVertices:()=>Re,computeCloudPath:()=>Fe,computeCrossVertices:()=>Me,computeDashArray:()=>re,computeGearPath:()=>De,computeGearVertices:()=>Mt,computeHeartPath:()=>Ee,computeLightningVertices:()=>Ae,computePolygonVertices:()=>oe,computeRectanglePath:()=>Be,computeRingPath:()=>Ie,computeSpeechBubbleVertices:()=>Ce,computeSpiralPath:()=>Oe,computeSplinePath:()=>Ge,computeStarVertices:()=>Pe,createDocument:()=>ge,createShape:()=>Yt,createViewbox:()=>ae,escXml:()=>B,extractVariables:()=>ke,filterAttr:()=>Ue,generateCode:()=>Je,generateCssCode:()=>Qe,generateD3Code:()=>Ze,generateId:()=>w,generatePatternSvgContent:()=>Ve,generateReactCode:()=>qe,generateSvgCode:()=>Xe,generateVueCode:()=>Ke,getBuiltInMarkerDefs:()=>on,getEasingCubicBezier:()=>Tn,getEffectivePrecision:()=>Qt,getMarkerDescriptors:()=>ce,getPatternElements:()=>le,linearGradient:()=>fn,migrateSnapshot:()=>fe,parseDocument:()=>ye,parseVariableArgs:()=>qt,pattern:()=>$n,radialGradient:()=>gn,renderAnimationElements:()=>He,renderCircle:()=>Et,renderEllipse:()=>Ft,renderFilterDefs:()=>H,renderFilterPrimitivesForType:()=>Rt,renderImage:()=>Lt,renderLine:()=>Ot,renderPolygonShape:()=>Nt,renderPolyline:()=>Gt,renderRectangle:()=>It,renderShape:()=>G,renderSpline:()=>Bt,renderText:()=>Dt,renderToSvg:()=>ie,roundCoord:()=>Te,roundNumberString:()=>Tt,roundSerializedShape:()=>we,roundSnapshot:()=>Jt,stringifyDocument:()=>$e,substituteString:()=>be,substituteVariables:()=>_e,validateSnapshot:()=>se,verticesToPath:()=>V});module.exports=wn(di);var _t=(P=>(P.LINEAR="linear",P.EASE="ease",P.EASE_IN="ease-in",P.EASE_OUT="ease-out",P.EASE_IN_OUT="ease-in-out",P.EASE_IN_QUAD="ease-in-quad",P.EASE_OUT_QUAD="ease-out-quad",P.EASE_IN_OUT_QUAD="ease-in-out-quad",P.EASE_IN_CUBIC="ease-in-cubic",P.EASE_OUT_CUBIC="ease-out-cubic",P.EASE_IN_OUT_CUBIC="ease-in-out-cubic",P.EASE_IN_QUART="ease-in-quart",P.EASE_OUT_QUART="ease-out-quart",P.EASE_IN_OUT_QUART="ease-in-out-quart",P.EASE_IN_SINE="ease-in-sine",P.EASE_OUT_SINE="ease-out-sine",P.EASE_IN_OUT_SINE="ease-in-out-sine",P.EASE_IN_QUINT="ease-in-quint",P.EASE_OUT_QUINT="ease-out-quint",P.EASE_IN_OUT_QUINT="ease-in-out-quint",P.EASE_IN_EXPO="ease-in-expo",P.EASE_OUT_EXPO="ease-out-expo",P.EASE_IN_OUT_EXPO="ease-in-out-expo",P.EASE_IN_CIRC="ease-in-circ",P.EASE_OUT_CIRC="ease-out-circ",P.EASE_IN_OUT_CIRC="ease-in-out-circ",P.EASE_IN_BACK="ease-in-back",P.EASE_OUT_BACK="ease-out-back",P.EASE_IN_OUT_BACK="ease-in-out-back",P.CUSTOM_BEZIER="custom-bezier",P.LINEAR_FUNCTION="linear-function",P.STEPS="steps",P))(_t||{}),me={linear:null,ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-quad":[.55,.085,.68,.53],"ease-out-quad":[.25,.46,.45,.94],"ease-in-out-quad":[.455,.03,.515,.955],"ease-in-cubic":[.55,.055,.675,.19],"ease-out-cubic":[.215,.61,.355,1],"ease-in-out-cubic":[.645,.045,.355,1],"ease-in-quart":[.895,.03,.685,.22],"ease-out-quart":[.165,.84,.44,1],"ease-in-out-quart":[.77,0,.175,1],"ease-in-sine":[.47,0,.745,.715],"ease-out-sine":[.39,.575,.565,1],"ease-in-out-sine":[.445,.05,.55,.95],"ease-in-quint":[.755,.05,.855,.06],"ease-out-quint":[.23,1,.32,1],"ease-in-out-quint":[.86,0,.07,1],"ease-in-expo":[.95,.05,.795,.035],"ease-out-expo":[.19,1,.22,1],"ease-in-out-expo":[1,0,0,1],"ease-in-circ":[.6,.04,.98,.335],"ease-out-circ":[.075,.82,.165,1],"ease-in-out-circ":[.785,.135,.15,.86],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55],"custom-bezier":null,"linear-function":null,steps:null};function Tn(n){let e=me[n];return e?`cubic-bezier(${e.join(", ")})`:"linear"}var vn=[{value:"click",label:"Click"},{value:"mouseenter",label:"Mouse Enter"},{value:"mouseleave",label:"Mouse Leave"},{value:"focus",label:"Focus"},{value:"blur",label:"Blur"},{value:"load",label:"Page Load"}];var kt=(l=>(l.LINEAR="linear",l.QUADRATIC="quadratic",l.CUBIC="cubic",l.CATMULL_ROM="catmull-rom",l.ARC="arc",l.BASIS="basis",l.MIXED="mixed",l))(kt||{}),Xt=(r=>(r.SMOOTH="smooth",r.CORNER="corner",r.SYMMETRIC="symmetric",r))(Xt||{});var N=1;var wt=Object.freeze({});function Pn(n){let e=n.schemaVersion;return typeof e!="number"||!Number.isFinite(e)||e<1?1:Math.floor(e)}function fe(n,e=wt){let t=JSON.parse(JSON.stringify(n)),r=Pn(t);if(r>N)return t;if(r===N)return t.schemaVersion=N,t;for(;r<N;){let i=e[r];if(!i)throw new Error(`[svgsketch/core] No migration registered for schema version ${r} \u2192 ${r+1}. Cannot safely upgrade this document to version ${N}.`);t=i(t),r+=1}return t.schemaVersion=N,t}var Mn=new Set(["circle","rectangle","square","ellipse","text","triangle","ngon","star","cross","ring","spiral","gear","arrow","line","spline","polyline","image"]);function se(n){let e=[],t=[];if(n==null||typeof n!="object")return e.push({path:"",message:"Snapshot must be a non-null object",severity:"error"}),{valid:!1,errors:e,warnings:t};let r=n;if(r.schemaVersion!==void 0&&(typeof r.schemaVersion!="number"||!Number.isInteger(r.schemaVersion)?e.push({path:"schemaVersion",message:"schemaVersion must be an integer",severity:"error"}):r.schemaVersion>N&&t.push({path:"schemaVersion",message:`schemaVersion ${r.schemaVersion} is newer than supported (${N})`,severity:"warning"})),!Array.isArray(r.shapes))e.push({path:"shapes",message:"shapes must be an array",severity:"error"});else{let i=new Set;r.shapes.forEach((a,o)=>{Rn(a,`shapes[${o}]`,e,t,i)})}if(!Array.isArray(r.viewboxes))e.push({path:"viewboxes",message:"viewboxes must be an array",severity:"error"});else{let i=new Set;r.viewboxes.forEach((a,o)=>{Fn(a,`viewboxes[${o}]`,e,t,i)})}return r.guides!==void 0&&(Array.isArray(r.guides)?r.guides.forEach((i,a)=>{In(i,`guides[${a}]`,e,t)}):e.push({path:"guides",message:"guides must be an array",severity:"error"})),r.groups!==void 0&&(Array.isArray(r.groups)?r.groups.forEach((i,a)=>{On(i,`groups[${a}]`,e)}):e.push({path:"groups",message:"groups must be an array",severity:"error"})),r.clipMaskGroups!==void 0&&(Array.isArray(r.clipMaskGroups)?r.clipMaskGroups.forEach((i,a)=>{Dn(i,`clipMaskGroups[${a}]`,e)}):e.push({path:"clipMaskGroups",message:"clipMaskGroups must be an array",severity:"error"})),r.measurements!==void 0&&(Array.isArray(r.measurements)||e.push({path:"measurements",message:"measurements must be an array",severity:"error"})),{valid:e.length===0,errors:e,warnings:t}}function Rn(n,e,t,r,i){if(n===null||typeof n!="object"){t.push({path:e,message:"Shape must be a non-null object",severity:"error"});return}let a=n;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Shape id must be a non-empty string",severity:"error"}):i.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate shape id: "${a.id}"`,severity:"error"}):i.add(a.id),typeof a.type!="string"?t.push({path:`${e}.type`,message:"Shape type must be a string",severity:"error"}):Mn.has(a.type)||r.push({path:`${e}.type`,message:`Unknown shape type: "${a.type}"`,severity:"warning"}),a.state===void 0||a.state===null||typeof a.state!="object"?t.push({path:`${e}.state`,message:"Shape state must be a non-null object",severity:"error"}):En(a.state,`${e}.state`,t,r)}var Cn=/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/;function An(n){return typeof n=="number"?isFinite(n):typeof n=="string"?Cn.test(n):!1}function En(n,e,t,r){let i=["x","y","width","height","radius","rx","ry","rotation","fontSize"];for(let o of i)n[o]!==void 0&&!An(n[o])&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number or a {{variable}} reference`,severity:"error"});let a=["width","height","radius","fontSize"];for(let o of a){let l=n[o];typeof l=="number"&&l<=0&&r.push({path:`${e}.${o}`,message:`${o} should be positive (got ${l})`,severity:"warning"})}}function Fn(n,e,t,r,i){if(n===null||typeof n!="object"){t.push({path:e,message:"Viewbox must be a non-null object",severity:"error"});return}let a=n;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Viewbox id must be a non-empty string",severity:"error"}):i.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate viewbox id: "${a.id}"`,severity:"error"}):i.add(a.id);for(let o of["x","y","width","height"])(typeof a[o]!="number"||!isFinite(a[o]))&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number`,severity:"error"});typeof a.width=="number"&&a.width<=0&&t.push({path:`${e}.width`,message:"Viewbox width must be positive",severity:"error"}),typeof a.height=="number"&&a.height<=0&&t.push({path:`${e}.height`,message:"Viewbox height must be positive",severity:"error"})}function In(n,e,t,r){if(n===null||typeof n!="object"){t.push({path:e,message:"Guide must be a non-null object",severity:"error"});return}let i=n;(typeof i.id!="string"||i.id.length===0)&&t.push({path:`${e}.id`,message:"Guide id must be a non-empty string",severity:"error"}),i.orientation!=="horizontal"&&i.orientation!=="vertical"&&t.push({path:`${e}.orientation`,message:'Guide orientation must be "horizontal" or "vertical"',severity:"error"}),(typeof i.position!="number"||!isFinite(i.position))&&t.push({path:`${e}.position`,message:"Guide position must be a finite number",severity:"error"})}function On(n,e,t){if(n===null||typeof n!="object"){t.push({path:e,message:"Group must be a non-null object",severity:"error"});return}let r=n;(typeof r.id!="string"||r.id.length===0)&&t.push({path:`${e}.id`,message:"Group id must be a non-empty string",severity:"error"}),r.parentId!==null&&typeof r.parentId!="string"&&t.push({path:`${e}.parentId`,message:"Group parentId must be a string or null",severity:"error"})}function Dn(n,e,t){if(n===null||typeof n!="object"){t.push({path:e,message:"ClipMaskGroup must be a non-null object",severity:"error"});return}let r=n;(typeof r.id!="string"||r.id.length===0)&&t.push({path:`${e}.id`,message:"ClipMaskGroup id must be a non-empty string",severity:"error"}),r.type!=="clip"&&r.type!=="mask"&&t.push({path:`${e}.type`,message:'ClipMaskGroup type must be "clip" or "mask"',severity:"error"}),(typeof r.clipShapeId!="string"||r.clipShapeId.length===0)&&t.push({path:`${e}.clipShapeId`,message:"clipShapeId must be a non-empty string",severity:"error"}),Array.isArray(r.contentShapeIds)||t.push({path:`${e}.contentShapeIds`,message:"contentShapeIds must be an array",severity:"error"})}function w(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`id-${crypto.randomUUID()}`:`id-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function ge(n={}){let e={schemaVersion:N,shapes:n.shapes?n.shapes.map(t=>({...t})):[],viewboxes:n.viewboxes?n.viewboxes.map(t=>({...t})):[]};return n.metadata&&(e.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{},...n.metadata}),e}function Yt(n){let{type:e,id:t,...r}=n,i={};for(let[a,o]of Object.entries(r))o!==void 0&&(i[a]=o);return{id:t??w(),type:e,state:i}}function ae(n,e,t,r,i){return{id:i??w(),x:n,y:e,width:t,height:r}}var Bn=["schemaVersion","documentMetadata","templateVariables","viewboxes","guides","measurements","groups","clipMaskGroups","customPatterns","symbols","animationTimeline","shapes"];function $e(n,e={}){let{indent:t=2,trailingNewline:r=!0,validate:i=!1}=e;if(i){let l=se(n);if(!l.valid){let u=l.errors.map(c=>` ${c.path}: ${c.message}`).join(`
|
|
1
|
+
"use strict";var St=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Lr=Object.getOwnPropertyNames;var Dr=Object.prototype.hasOwnProperty;var Or=(r,e)=>{for(var t in e)St(r,t,{get:e[t],enumerable:!0})},Gr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lr(e))!Dr.call(r,i)&&i!==t&&St(r,i,{get:()=>e[i],enumerable:!(n=Fr(e,i))||n.enumerable});return r};var Br=r=>Gr(St({},"__esModule",{value:!0}),r);var Li={};Or(Li,{Arrow:()=>gt,BUILTIN_MARKER_ID_MAP:()=>It,CURRENT_SCHEMA_VERSION:()=>U,Circle:()=>nt,Cross:()=>ht,DEFAULT_COORDINATE_PRECISION:()=>lr,Document:()=>et,EASING_CURVES:()=>me,EVENT_TRIGGER_OPTIONS:()=>Nr,EasingType:()=>_t,Ellipse:()=>it,Gear:()=>mt,ImageShape:()=>$t,LIBRARY_EMIT_ORDER:()=>zt,Line:()=>ot,LinearGradientBuilder:()=>he,MARKER_HEIGHT:()=>He,MARKER_VIEWBOX:()=>ce,MARKER_WIDTH:()=>We,MAX_COORDINATE_PRECISION:()=>ur,MIGRATIONS:()=>Tt,NGon:()=>ct,PatternBuilder:()=>fe,Polyline:()=>bt,RadialGradientBuilder:()=>pe,Rectangle:()=>st,Ring:()=>pt,ShapeBuilder:()=>B,Spiral:()=>ft,Spline:()=>yt,SplineCurveType:()=>kt,SplinePointType:()=>ir,Square:()=>at,Star:()=>dt,Text:()=>lt,Timeline:()=>rt,Track:()=>tt,Triangle:()=>ut,collectReferencedLibraryIds:()=>kr,computeArrowVertices:()=>Ce,computeCloudPath:()=>Le,computeCrossVertices:()=>Ae,computeDashArray:()=>ie,computeGearPath:()=>Ge,computeGearVertices:()=>Rt,computeHeartPath:()=>Fe,computeLightningVertices:()=>Ee,computePolygonVertices:()=>le,computeRectanglePath:()=>Be,computeRingPath:()=>De,computeSpeechBubbleVertices:()=>Ie,computeSpiralPath:()=>Oe,computeSplinePath:()=>Ue,computeStarVertices:()=>Re,createDocument:()=>be,createShape:()=>ar,createViewbox:()=>oe,escXml:()=>D,extractVariables:()=>Te,filterAttr:()=>ze,generateCode:()=>Je,generateCssCode:()=>Qe,generateD3Code:()=>Ze,generateId:()=>T,generatePatternSvgContent:()=>je,generateReactCode:()=>qe,generateSvgCode:()=>Ye,generateVueCode:()=>Ke,getBuiltInMarkerDefs:()=>$r,getEasingCubicBezier:()=>Ur,getEffectivePrecision:()=>cr,getMarkerDescriptors:()=>te,getPatternElements:()=>ue,linearGradient:()=>Ar,migrateSnapshot:()=>ye,parseDocument:()=>xe,parseVariableArgs:()=>or,pattern:()=>Ir,radialGradient:()=>Cr,renderAnimationElements:()=>Xe,renderBuiltinMarkerDefs:()=>X,renderCircle:()=>Ft,renderEllipse:()=>Lt,renderFilterDefs:()=>br,renderFilterLibraryDef:()=>Kt,renderFilterPrimitivesForType:()=>At,renderImage:()=>Nt,renderLibraryDef:()=>jt,renderLibraryDefs:()=>Zt,renderLine:()=>Ot,renderLinearGradientLibraryDef:()=>Xt,renderMarkerLibraryDef:()=>Ht,renderPatternLibraryDef:()=>qt,renderPolygonShape:()=>Vt,renderPolyline:()=>Ut,renderRadialGradientLibraryDef:()=>Yt,renderRectangle:()=>Dt,renderReferencedLibraryDefs:()=>Y,renderShape:()=>G,renderSpline:()=>Bt,renderSymbolLibraryDef:()=>Wt,renderText:()=>Gt,renderToSvg:()=>se,roundCoord:()=>ve,roundNumberString:()=>Pt,roundSerializedShape:()=>Pe,roundSnapshot:()=>dr,stringifyDocument:()=>$e,substituteString:()=>Se,substituteVariables:()=>we,validateSnapshot:()=>ae,verticesToPath:()=>V});module.exports=Br(Li);var _t=(M=>(M.LINEAR="linear",M.EASE="ease",M.EASE_IN="ease-in",M.EASE_OUT="ease-out",M.EASE_IN_OUT="ease-in-out",M.EASE_IN_QUAD="ease-in-quad",M.EASE_OUT_QUAD="ease-out-quad",M.EASE_IN_OUT_QUAD="ease-in-out-quad",M.EASE_IN_CUBIC="ease-in-cubic",M.EASE_OUT_CUBIC="ease-out-cubic",M.EASE_IN_OUT_CUBIC="ease-in-out-cubic",M.EASE_IN_QUART="ease-in-quart",M.EASE_OUT_QUART="ease-out-quart",M.EASE_IN_OUT_QUART="ease-in-out-quart",M.EASE_IN_SINE="ease-in-sine",M.EASE_OUT_SINE="ease-out-sine",M.EASE_IN_OUT_SINE="ease-in-out-sine",M.EASE_IN_QUINT="ease-in-quint",M.EASE_OUT_QUINT="ease-out-quint",M.EASE_IN_OUT_QUINT="ease-in-out-quint",M.EASE_IN_EXPO="ease-in-expo",M.EASE_OUT_EXPO="ease-out-expo",M.EASE_IN_OUT_EXPO="ease-in-out-expo",M.EASE_IN_CIRC="ease-in-circ",M.EASE_OUT_CIRC="ease-out-circ",M.EASE_IN_OUT_CIRC="ease-in-out-circ",M.EASE_IN_BACK="ease-in-back",M.EASE_OUT_BACK="ease-out-back",M.EASE_IN_OUT_BACK="ease-in-out-back",M.CUSTOM_BEZIER="custom-bezier",M.LINEAR_FUNCTION="linear-function",M.STEPS="steps",M))(_t||{}),me={linear:null,ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-quad":[.55,.085,.68,.53],"ease-out-quad":[.25,.46,.45,.94],"ease-in-out-quad":[.455,.03,.515,.955],"ease-in-cubic":[.55,.055,.675,.19],"ease-out-cubic":[.215,.61,.355,1],"ease-in-out-cubic":[.645,.045,.355,1],"ease-in-quart":[.895,.03,.685,.22],"ease-out-quart":[.165,.84,.44,1],"ease-in-out-quart":[.77,0,.175,1],"ease-in-sine":[.47,0,.745,.715],"ease-out-sine":[.39,.575,.565,1],"ease-in-out-sine":[.445,.05,.55,.95],"ease-in-quint":[.755,.05,.855,.06],"ease-out-quint":[.23,1,.32,1],"ease-in-out-quint":[.86,0,.07,1],"ease-in-expo":[.95,.05,.795,.035],"ease-out-expo":[.19,1,.22,1],"ease-in-out-expo":[1,0,0,1],"ease-in-circ":[.6,.04,.98,.335],"ease-out-circ":[.075,.82,.165,1],"ease-in-out-circ":[.785,.135,.15,.86],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55],"custom-bezier":null,"linear-function":null,steps:null};function Ur(r){let e=me[r];return e?`cubic-bezier(${e.join(", ")})`:"linear"}var Nr=[{value:"click",label:"Click"},{value:"mouseenter",label:"Mouse Enter"},{value:"mouseleave",label:"Mouse Leave"},{value:"focus",label:"Focus"},{value:"blur",label:"Blur"},{value:"load",label:"Page Load"}];var kt=(l=>(l.LINEAR="linear",l.QUADRATIC="quadratic",l.CUBIC="cubic",l.CATMULL_ROM="catmull-rom",l.ARC="arc",l.BASIS="basis",l.MIXED="mixed",l))(kt||{}),ir=(n=>(n.SMOOTH="smooth",n.CORNER="corner",n.SYMMETRIC="symmetric",n))(ir||{});var U=2;function Vr(r){let e=Array.isArray(r.library)?[...r.library]:[],t=new Set(e.map(u=>u.id));if(Array.isArray(r.symbols))for(let u of r.symbols)!u||t.has(u.id)||(e.push({...u,kind:"symbol"}),t.add(u.id));if(Array.isArray(r.markers))for(let u of r.markers)!u||t.has(u.id)||(e.push({...u,kind:"marker"}),t.add(u.id));let n=new Map,i=(u,c)=>{let{id:h,sourceId:d,...m}=u,p=JSON.stringify({kind:c,...m}),y=n.get(p);if(y)return y;let g=t.has(u.id)?`grd-${ge()}`:u.id;t.add(g),n.set(p,g);let $=c==="linear-gradient"?{kind:"linear-gradient",id:g,name:u.sourceId??g,sourceId:u.sourceId,gradient:sr(u)}:{kind:"radial-gradient",id:g,name:u.sourceId??g,sourceId:u.sourceId,gradient:sr(u)};return e.push($),g},a=new Map;if(Array.isArray(r.customPatterns))for(let u of r.customPatterns){if(!u)continue;let c=t.has(u.id)?`pat-${ge()}`:u.id;t.add(c),a.set(u.id,c),e.push(zr(u,c))}let o=u=>{if(u.customPatternId){let w=a.get(u.customPatternId);if(w)return w}let{id:c,sourceId:h,customPatternId:d,...m}=u,p=JSON.stringify({kind:"pattern",...m}),y=n.get(p);if(y)return y;let g=t.has(u.id)?`pat-${ge()}`:u.id;t.add(g),n.set(p,g);let $={kind:"pattern",id:g,name:u.sourceId??g,sourceId:u.sourceId,pattern:m};return e.push($),g};for(let u of r.shapes??[]){let c=u.state;if(!c)continue;let h=c.fillGradient;h&&(h.type==="linear-gradient"||h.type==="radial-gradient"?c.fillLibraryId=i(h,h.type):h.type==="pattern"&&(c.fillLibraryId=o(h)));let d=c.strokeGradient;d&&(d.type==="linear-gradient"||d.type==="radial-gradient"?c.strokeLibraryId=i(d,d.type):d.type==="pattern"&&(c.strokeLibraryId=o(d)));let m=c.filters;if(Array.isArray(m)&&m.length>0){let p=l(m,c,u.id);c.filterLibraryIds=[p]}}return r.library=e,r;function l(u,c,h){let d={filters:u,colorInterpolation:c.filterColorInterpolation,filterUnits:c.filterUnits,primitiveUnits:c.primitiveUnits,x:c.filterX,y:c.filterY,width:c.filterWidth,height:c.filterHeight},m=JSON.stringify({kind:"filter",...d}),p=n.get(m);if(p)return p;let y=`filter-${h}`,g=t.has(y)?`flt-${ge()}`:y;t.add(g),n.set(m,g);let $={kind:"filter",id:g,name:g,filters:d.filters,...d.colorInterpolation?{colorInterpolation:d.colorInterpolation}:{},...d.filterUnits?{filterUnits:d.filterUnits}:{},...d.primitiveUnits?{primitiveUnits:d.primitiveUnits}:{},...d.x!==void 0?{x:d.x}:{},...d.y!==void 0?{y:d.y}:{},...d.width!==void 0?{width:d.width}:{},...d.height!==void 0?{height:d.height}:{}};return e.push($),g}}function zr(r,e){return{kind:"pattern",id:e,name:r.name??e,pattern:{type:"pattern",svgContent:r.svgContent,width:r.width,height:r.height,patternType:"custom",color:"#000000",backgroundColor:"transparent",scale:1,rotation:0,opacity:1,patternUnits:"userSpaceOnUse"}}}function sr(r){let{id:e,sourceId:t,...n}=r;return n}var wt=0;function ge(){return wt=wt+1&65535,`${Date.now().toString(36)}-${wt.toString(36)}`}var Tt=Object.freeze({1:Vr});function jr(r){let e=r.schemaVersion;return typeof e!="number"||!Number.isFinite(e)||e<1?1:Math.floor(e)}function ye(r,e=Tt){let t=JSON.parse(JSON.stringify(r)),n=jr(t);if(n>U)return t;if(n===U)return t.schemaVersion=U,t;for(;n<U;){let i=e[n];if(!i)throw new Error(`[svgsketch/core] No migration registered for schema version ${n} \u2192 ${n+1}. Cannot safely upgrade this document to version ${U}.`);t=i(t),n+=1}return t.schemaVersion=U,t}var Wr=new Set(["circle","rectangle","square","ellipse","text","triangle","ngon","star","cross","ring","spiral","gear","arrow","line","spline","polyline","image"]);function ae(r){let e=[],t=[];if(r==null||typeof r!="object")return e.push({path:"",message:"Snapshot must be a non-null object",severity:"error"}),{valid:!1,errors:e,warnings:t};let n=r;if(n.schemaVersion!==void 0&&(typeof n.schemaVersion!="number"||!Number.isInteger(n.schemaVersion)?e.push({path:"schemaVersion",message:"schemaVersion must be an integer",severity:"error"}):n.schemaVersion>U&&t.push({path:"schemaVersion",message:`schemaVersion ${n.schemaVersion} is newer than supported (${U})`,severity:"warning"})),!Array.isArray(n.shapes))e.push({path:"shapes",message:"shapes must be an array",severity:"error"});else{let i=new Set;n.shapes.forEach((a,o)=>{Hr(a,`shapes[${o}]`,e,t,i)})}if(!Array.isArray(n.viewboxes))e.push({path:"viewboxes",message:"viewboxes must be an array",severity:"error"});else{let i=new Set;n.viewboxes.forEach((a,o)=>{Kr(a,`viewboxes[${o}]`,e,t,i)})}return n.guides!==void 0&&(Array.isArray(n.guides)?n.guides.forEach((i,a)=>{Zr(i,`guides[${a}]`,e,t)}):e.push({path:"guides",message:"guides must be an array",severity:"error"})),n.groups!==void 0&&(Array.isArray(n.groups)?n.groups.forEach((i,a)=>{Qr(i,`groups[${a}]`,e)}):e.push({path:"groups",message:"groups must be an array",severity:"error"})),n.clipMaskGroups!==void 0&&(Array.isArray(n.clipMaskGroups)?n.clipMaskGroups.forEach((i,a)=>{Jr(i,`clipMaskGroups[${a}]`,e)}):e.push({path:"clipMaskGroups",message:"clipMaskGroups must be an array",severity:"error"})),n.measurements!==void 0&&(Array.isArray(n.measurements)||e.push({path:"measurements",message:"measurements must be an array",severity:"error"})),{valid:e.length===0,errors:e,warnings:t}}function Hr(r,e,t,n,i){if(r===null||typeof r!="object"){t.push({path:e,message:"Shape must be a non-null object",severity:"error"});return}let a=r;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Shape id must be a non-empty string",severity:"error"}):i.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate shape id: "${a.id}"`,severity:"error"}):i.add(a.id),typeof a.type!="string"?t.push({path:`${e}.type`,message:"Shape type must be a string",severity:"error"}):Wr.has(a.type)||n.push({path:`${e}.type`,message:`Unknown shape type: "${a.type}"`,severity:"warning"}),a.state===void 0||a.state===null||typeof a.state!="object"?t.push({path:`${e}.state`,message:"Shape state must be a non-null object",severity:"error"}):qr(a.state,`${e}.state`,t,n)}var Xr=/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/;function Yr(r){return typeof r=="number"?isFinite(r):typeof r=="string"?Xr.test(r):!1}function qr(r,e,t,n){let i=["x","y","width","height","radius","rx","ry","rotation","fontSize"];for(let o of i)r[o]!==void 0&&!Yr(r[o])&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number or a {{variable}} reference`,severity:"error"});let a=["width","height","radius","fontSize"];for(let o of a){let l=r[o];typeof l=="number"&&l<=0&&n.push({path:`${e}.${o}`,message:`${o} should be positive (got ${l})`,severity:"warning"})}}function Kr(r,e,t,n,i){if(r===null||typeof r!="object"){t.push({path:e,message:"Viewbox must be a non-null object",severity:"error"});return}let a=r;typeof a.id!="string"||a.id.length===0?t.push({path:`${e}.id`,message:"Viewbox id must be a non-empty string",severity:"error"}):i.has(a.id)?t.push({path:`${e}.id`,message:`Duplicate viewbox id: "${a.id}"`,severity:"error"}):i.add(a.id);for(let o of["x","y","width","height"])(typeof a[o]!="number"||!isFinite(a[o]))&&t.push({path:`${e}.${o}`,message:`${o} must be a finite number`,severity:"error"});typeof a.width=="number"&&a.width<=0&&t.push({path:`${e}.width`,message:"Viewbox width must be positive",severity:"error"}),typeof a.height=="number"&&a.height<=0&&t.push({path:`${e}.height`,message:"Viewbox height must be positive",severity:"error"})}function Zr(r,e,t,n){if(r===null||typeof r!="object"){t.push({path:e,message:"Guide must be a non-null object",severity:"error"});return}let i=r;(typeof i.id!="string"||i.id.length===0)&&t.push({path:`${e}.id`,message:"Guide id must be a non-empty string",severity:"error"}),i.orientation!=="horizontal"&&i.orientation!=="vertical"&&t.push({path:`${e}.orientation`,message:'Guide orientation must be "horizontal" or "vertical"',severity:"error"}),(typeof i.position!="number"||!isFinite(i.position))&&t.push({path:`${e}.position`,message:"Guide position must be a finite number",severity:"error"})}function Qr(r,e,t){if(r===null||typeof r!="object"){t.push({path:e,message:"Group must be a non-null object",severity:"error"});return}let n=r;(typeof n.id!="string"||n.id.length===0)&&t.push({path:`${e}.id`,message:"Group id must be a non-empty string",severity:"error"}),n.parentId!==null&&typeof n.parentId!="string"&&t.push({path:`${e}.parentId`,message:"Group parentId must be a string or null",severity:"error"})}function Jr(r,e,t){if(r===null||typeof r!="object"){t.push({path:e,message:"ClipMaskGroup must be a non-null object",severity:"error"});return}let n=r;(typeof n.id!="string"||n.id.length===0)&&t.push({path:`${e}.id`,message:"ClipMaskGroup id must be a non-empty string",severity:"error"}),n.type!=="clip"&&n.type!=="mask"&&t.push({path:`${e}.type`,message:'ClipMaskGroup type must be "clip" or "mask"',severity:"error"}),(typeof n.clipShapeId!="string"||n.clipShapeId.length===0)&&t.push({path:`${e}.clipShapeId`,message:"clipShapeId must be a non-empty string",severity:"error"}),Array.isArray(n.contentShapeIds)||t.push({path:`${e}.contentShapeIds`,message:"contentShapeIds must be an array",severity:"error"})}function T(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`id-${crypto.randomUUID()}`:`id-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function be(r={}){let e={schemaVersion:U,shapes:r.shapes?r.shapes.map(t=>({...t})):[],viewboxes:r.viewboxes?r.viewboxes.map(t=>({...t})):[]};return r.metadata&&(e.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{},...r.metadata}),e}function ar(r){let{type:e,id:t,...n}=r,i={};for(let[a,o]of Object.entries(n))o!==void 0&&(i[a]=o);return{id:t??T(),type:e,state:i}}function oe(r,e,t,n,i){return{id:i??T(),x:r,y:e,width:t,height:n}}var en=["schemaVersion","documentMetadata","templateVariables","viewboxes","guides","measurements","groups","clipMaskGroups","customPatterns","symbols","animationTimeline","shapes"];function $e(r,e={}){let{indent:t=2,trailingNewline:n=!0,validate:i=!1}=e;if(i){let l=ae(r);if(!l.valid){let u=l.errors.map(c=>` ${c.path}: ${c.message}`).join(`
|
|
2
2
|
`);throw new Error(`Invalid document:
|
|
3
|
-
${u}`)}}let a={};for(let l of
|
|
4
|
-
`:o}function
|
|
3
|
+
${u}`)}}let a={};for(let l of en){let u=r[l];if(u!==void 0)switch(l){case"shapes":a[l]=u.map(rn);break;case"viewboxes":case"guides":case"measurements":case"groups":case"clipMaskGroups":case"symbols":case"customPatterns":a[l]=tn(u).map(ne);break;case"documentMetadata":a[l]=ne(u);break;case"animationTimeline":a[l]=ne(u);break;default:a[l]=u}}let o=JSON.stringify(a,null,t);return n?o+`
|
|
4
|
+
`:o}function xe(r,e={}){let{validate:t=!0,migrate:n=!0}=e,i;try{i=JSON.parse(r)}catch(o){throw new Error(`Failed to parse .svgs document: ${o.message}`)}if(i===null||typeof i!="object"||Array.isArray(i))throw new Error("Invalid .svgs document: root must be a JSON object");let a=i;if(n&&(a=ye(a)),t){let o=ae(a);if(!o.valid){let l=o.errors.map(u=>` ${u.path}: ${u.message}`).join(`
|
|
5
5
|
`);throw new Error(`Invalid .svgs document:
|
|
6
|
-
${l}`)}}return a}function Gn(n){return[...n].sort((e,t)=>e.id.localeCompare(t.id))}function ne(n){if(n==null)return n;if(Array.isArray(n))return n.map(ne);if(typeof n!="object")return n;let e={},t=Object.keys(n).sort();for(let r of t)e[r]=ne(n[r]);return e}function Ln(n){let e={};return e.id=n.id,e.type=n.type,e.state=ne(n.state),e}var U=/\{\{\s*([\w.\-]+)\s*\}\}/g;function be(n,e){return n.replace(U,(t,r)=>{let i=e[r];return i!==void 0?String(i):t})}function _e(n,e={}){let t={};if(n.templateVariables)for(let i of n.templateVariables)i.defaultValue!==void 0&&i.defaultValue!==""&&(t[i.name]=i.defaultValue);if(Object.assign(t,e),Object.keys(t).length===0)return JSON.parse(JSON.stringify(n));let r=JSON.parse(JSON.stringify(n));for(let i of r.shapes)xe(i.state,t);if(r.documentMetadata){let i=r.documentMetadata;xe(i,t)}return r}function xe(n,e){for(let t of Object.keys(n)){let r=n[t];if(typeof r=="string"){if(U.lastIndex=0,U.test(r)){U.lastIndex=0;let i=be(r,e);if(Nn(r)){let a=Number(i);if(!isNaN(a)&&Vn(t)){n[t]=a;continue}}n[t]=i}}else if(Array.isArray(r))for(let i=0;i<r.length;i++)typeof r[i]=="string"?(U.lastIndex=0,U.test(r[i])&&(U.lastIndex=0,r[i]=be(r[i],e))):r[i]!==null&&typeof r[i]=="object"&&xe(r[i],e);else r!==null&&typeof r=="object"&&xe(r,e)}}function Nn(n){return/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/.test(n)}var Un=new Set(["x","y","width","height","radius","rx","ry","cx","cy","x1","y1","x2","y2","fontSize","borderWidth","cornerRadius","opacity","fillOpacity","strokeOpacity","rotation","skewX","skewY","scaleX","scaleY","letterSpacing","wordSpacing","lineHeight","sides","arms","innerRadiusPercent","armWidthPercent","teeth","toothDepthPercent","holeRadiusPercent","turns","thicknessPercent","direction","headWidthPercent","headLengthPercent","shaftWidthPercent","shiftAngle","dashLength","gapLength","textPathStartOffset","imageOpacity"]);function Vn(n){return Un.has(n)}function ke(n){let e=n.templateVariables??[],t=new Set(e.map(a=>a.name)),r=new Set;for(let a of n.shapes)Se(a.state,r);n.documentMetadata&&Se(n.documentMetadata,r);let i=[...r].filter(a=>!t.has(a)).sort();return{defined:[...e],undeclared:i}}function Se(n,e){for(let t of Object.values(n))if(typeof t=="string"){let r;for(U.lastIndex=0;(r=U.exec(t))!==null;)e.add(r[1])}else if(Array.isArray(t))for(let r of t)if(typeof r=="string"){let i;for(U.lastIndex=0;(i=U.exec(r))!==null;)e.add(i[1])}else r!==null&&typeof r=="object"&&Se(r,e);else t!==null&&typeof t=="object"&&Se(t,e)}function qt(n){let e={};for(let t of n){let r=t.indexOf("=");if(r===-1)throw new Error(`Invalid variable format: "${t}". Expected "name=value".`);let i=t.slice(0,r).trim(),a=t.slice(r+1);if(!i)throw new Error(`Invalid variable format: "${t}". Variable name cannot be empty.`);e[i]=a}return e}var Kt=3,Zt=12;function Qt(n){return n==null||!Number.isFinite(n)?3:n<0?0:n>12?12:Math.floor(n)}function Te(n,e){if(!Number.isFinite(n))return n;let t=Math.pow(10,e);return Math.round(n*t)/t}var zn=/-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?/g;function Tt(n,e){return n.replace(zn,t=>{let r=parseFloat(t);return Number.isFinite(r)?String(Te(r,e)):t})}var Wn=new Set(["rawTransform","strokeDasharray","filterX","filterY","filterWidth","filterHeight","cssClipPath"]),jn=new Set(["metadata","customMetadata","customAttrs","customData","bindings","richTextData","cssMaskProperties"]);function W(n,e,t){if(e==null)return e;if(typeof e=="number")return Te(e,t);if(typeof e=="string")return Wn.has(n)?Tt(e,t):e;if(typeof e=="boolean")return e;if(Array.isArray(e))return e.map(r=>W(n,r,t));if(typeof e=="object"){if(jn.has(n))return e;if(n==="symbolOverrides"){let i={};for(let[a,o]of Object.entries(e))i[a]=W("state",o,t);return i}let r={};for(let[i,a]of Object.entries(e))r[i]=W(i,a,t);return r}return e}function we(n,e){return{id:n.id,type:n.type,state:W("state",n.state,e)}}function Jt(n,e){let t={...n,shapes:n.shapes.map(r=>we(r,e)),viewboxes:n.viewboxes.map(r=>W("viewbox",r,e))};return n.guides&&(t.guides=n.guides.map(r=>W("guide",r,e))),n.measurements&&(t.measurements=n.measurements.map(r=>W("measurement",r,e))),n.animationTimeline&&(t.animationTimeline=W("animationTimeline",n.animationTimeline,e)),n.symbols&&(t.symbols=n.symbols.map(r=>({...r,shapes:r.shapes.map(i=>we(i,e))}))),n.markers&&(t.markers=n.markers.map(r=>W("marker",r,e))),n.customPatterns&&(t.customPatterns=n.customPatterns.map(r=>W("customPattern",r,e))),t}function oe(n,e,t=-90){let r=[],i=t*Math.PI/180;for(let a=0;a<n;a++){let o=i+a*2*Math.PI/n;r.push({x:e*Math.cos(o),y:e*Math.sin(o)})}return r}function Pe(n,e,t,r=-90){let i=[],a=e*(t/100),o=r*Math.PI/180;for(let l=0;l<n*2;l++){let u=o+l*Math.PI/n,c=l%2===0?e:a;i.push({x:c*Math.cos(u),y:c*Math.sin(u)})}return i}function Me(n,e,t=0){let r=n*(e/100)/2,i=[{x:-r,y:-n},{x:r,y:-n},{x:r,y:-r},{x:n,y:-r},{x:n,y:r},{x:r,y:r},{x:r,y:n},{x:-r,y:n},{x:-r,y:r},{x:-n,y:r},{x:-n,y:-r},{x:-r,y:-r}];if(t===0)return i;let a=Math.cos(t*Math.PI/180),o=Math.sin(t*Math.PI/180);return i.map(l=>({x:l.x*a-l.y*o,y:l.x*o+l.y*a}))}function Re(n,e,t,r,i=-90){let o=n*2*(t/100),l=n*(e/100),u=l*(r/100),c=[{x:n,y:0},{x:n-o,y:-l/2},{x:n-o,y:-u/2},{x:-n,y:-u/2},{x:-n,y:u/2},{x:n-o,y:u/2},{x:n-o,y:l/2}];if(i===0)return c;let m=Math.cos(i*Math.PI/180),p=Math.sin(i*Math.PI/180);return c.map(h=>({x:h.x*m-h.y*p,y:h.x*p+h.y*m}))}function Ce(n,e,t,r,i=0){let a=n,o=a*(t/100),l=a*(r/100),u=l/2,c=e*Math.PI/180,m=Math.cos(c),p=Math.sin(c),h=Math.abs(m),g=Math.abs(p),y=Math.max(h,g)||1,f={x:m*(a/y),y:p*(a/y)},b={x:f.x+m*o,y:f.y+p*o},_=Math.min(l,a-u),k=-a+u+_,S=a-u-_,T={x:-a,y:-a},R={x:a,y:-a},A={x:a,y:a},$={x:-a,y:a},x;if(h>=g&&m>0){let M=Math.max(k,Math.min(S,f.y)),C={x:a,y:M-u},O={x:a,y:M+u};x=[T,R,C,b,O,A,$]}else if(h>=g&&m<=0){let M=Math.max(k,Math.min(S,f.y)),C={x:-a,y:M+u},O={x:-a,y:M-u};x=[T,R,A,$,C,b,O]}else if(p<0){let M=Math.max(k,Math.min(S,f.x)),C={x:M-u,y:-a},O={x:M+u,y:-a};x=[T,C,b,O,R,A,$]}else{let M=Math.max(k,Math.min(S,f.x)),C={x:M+u,y:a},O={x:M-u,y:a};x=[T,R,A,C,b,O,$]}if(i===0)return x;let v=Math.cos(i*Math.PI/180),F=Math.sin(i*Math.PI/180);return x.map(M=>({x:M.x*v-M.y*F,y:M.x*F+M.y*v}))}function Ae(n,e,t,r,i=0){let a=Math.max(2,Math.round(e)),o=n*(t/100),l=n*(r/100)/2,u=a+1,c=[];for(let f=0;f<u;f++){let b=f/(u-1),_=-n+b*2*n,k=0;f>0&&f<u-1&&(k=f%2===1?o:-o),c.push({x:k,y:_})}let m=[],p=[];for(let f=0;f<u;f++){if(f===0||f===u-1){m.push({...c[f]}),p.push({...c[f]});continue}let b=c[f-1],_=c[f],k=c[f+1],S=_.x-b.x,T=_.y-b.y,R=Math.hypot(S,T)||1,A=S/R,$=T/R,x=k.x-_.x,v=k.y-_.y,F=Math.hypot(x,v)||1,M=x/F,C=v/F,O=(A+M)/2,I=($+C)/2,D=Math.hypot(O,I),P,z;D<1e-6?(P=-$,z=A):(P=-I/D,z=O/D),m.push({x:_.x-P*l,y:_.y-z*l}),p.push({x:_.x+P*l,y:_.y+z*l})}let h=[];h.push(m[0]);for(let f=1;f<u-1;f++)h.push(p[f]);h.push(m[u-1]);for(let f=u-2;f>=1;f--)h.push(m[f]);if(i===0)return h;let g=Math.cos(i*Math.PI/180),y=Math.sin(i*Math.PI/180);return h.map(f=>({x:f.x*g-f.y*y,y:f.x*y+f.y*g}))}function Ee(n,e,t,r=0){let i=n,a=Math.max(.3,Math.min(.9,e/100)),o=-i*(t/100),l={x:0,y:i},u={x:0,y:o},c={x:-i*a,y:i*.4},m={x:-i*a,y:-i},p={x:i*a,y:-i},h={x:i*a,y:i*.4},g=[l,c,m,u,p,h,l],y=r===0?g:(()=>{let R=Math.cos(r*Math.PI/180),A=Math.sin(r*Math.PI/180);return g.map($=>({x:$.x*R-$.y*A,y:$.x*A+$.y*R}))})(),[f,b,_,k,S,T]=y;return`M ${f.x} ${f.y} C ${b.x} ${b.y} ${_.x} ${_.y} ${k.x} ${k.y} C ${S.x} ${S.y} ${T.x} ${T.y} ${f.x} ${f.y} Z`}function Fe(n,e,t,r=0){let i=Math.max(3,Math.round(e)),a=Math.max(.3,Math.min(1,t/100)),o=n,l=o*1.7,u=o*1.15,c=[];for(let $=0;$<i;$++){let v=(90+$/i*360)*Math.PI/180;c.push({x:l/2*Math.cos(v),y:-(u/2)*Math.sin(v)})}let m=.15,p=0;for(let $=0;$<i;$++){let x=c[$],v=c[($+1)%i];p=Math.max(p,Math.hypot(v.x-x.x,v.y-x.y))}let h=p/(2*(1-m))+.001,g=Math.max(h,p*(.68+a*.35)),y=c.map($=>{let x=$.y/(u/2);return g*(1-m*x)});function f($){let x=c[$],v=c[($+1)%i],F=y[$],M=y[($+1)%i],C=v.x-x.x,O=v.y-x.y,I=Math.hypot(C,O)||1,D=(F*F-M*M+I*I)/(2*I),P=Math.sqrt(Math.max(0,F*F-D*D)),z=x.x+D/I*C,J=x.y+D/I*O,ee=-O/I,xt=C/I,te={x:z+ee*P,y:J+xt*P},q={x:z-ee*P,y:J-xt*P};return te.x*te.x+te.y*te.y>q.x*q.x+q.y*q.y?te:q}let b=[];for(let $=0;$<i;$++)b.push(f($));let _=14,k=[];for(let $=0;$<i;$++){let x=c[$],v=y[$],F=b[($-1+i)%i],M=b[$],C=Math.atan2(F.y-x.y,F.x-x.x),I=Math.atan2(M.y-x.y,M.x-x.x)-C;I<=0&&(I+=2*Math.PI);let D=2*Math.PI-I,P=C+I/2,z=C-D/2,J={x:x.x+v*Math.cos(P),y:x.y+v*Math.sin(P)},ee={x:x.x+v*Math.cos(z),y:x.y+v*Math.sin(z)},te=J.x*J.x+J.y*J.y>ee.x*ee.x+ee.y*ee.y?I:-D;for(let q=0;q<_;q++){let yn=q/_,Ht=C+yn*te;k.push({x:x.x+v*Math.cos(Ht),y:x.y+v*Math.sin(Ht)})}}let S=0;for(let $ of k){let x=Math.max(Math.abs($.x),Math.abs($.y));x>S&&(S=x)}if(S>0&&S!==o){let $=o/S;for(let x of k)x.x*=$,x.y*=$}let T=$=>{if(r===0)return $;let x=Math.cos(r*Math.PI/180),v=Math.sin(r*Math.PI/180);return{x:$.x*x-$.y*v,y:$.x*v+$.y*x}},R=k.map(T),A=`M ${R[0].x} ${R[0].y}`;for(let $=1;$<R.length;$++)A+=` L ${R[$].x} ${R[$].y}`;return A+=" Z",A}function V(n,e=0,t=0){if(n.length<3)return"";if(e<=0)return n.map((a,o)=>(o===0?"M":"L")+`${a.x},${a.y}`).join(" ")+" Z";let r=Math.min(e,t*.4),i="";for(let a=0;a<n.length;a++){let o=n[(a-1+n.length)%n.length],l=n[a],u=n[(a+1)%n.length],c={x:o.x-l.x,y:o.y-l.y},m=Math.hypot(c.x,c.y);c.x/=m,c.y/=m;let p={x:u.x-l.x,y:u.y-l.y},h=Math.hypot(p.x,p.y);p.x/=h,p.y/=h;let g=Math.min(r,m/2),y=Math.min(r,h/2),f={x:l.x+c.x*g,y:l.y+c.y*g},b={x:l.x+p.x*y,y:l.y+p.y*y};i+=a===0?`M${f.x},${f.y}`:` L${f.x},${f.y}`,i+=` Q${l.x},${l.y} ${b.x},${b.y}`}return i+" Z"}function Ie(n,e,t="evenodd"){let r=n*(e/100),i=t==="nonzero"?1:0;return`M ${n} 0 A ${n} ${n} 0 1 1 ${-n} 0 A ${n} ${n} 0 1 1 ${n} 0 Z M ${r} 0 A ${r} ${r} 0 1 ${i} ${-r} 0 A ${r} ${r} 0 1 ${i} ${r} 0 Z`}function Oe(n,e,t,r=1,i=0){let a=n*(t/100),l=Math.round(e*36),u=e*2*Math.PI,c=(n-a/2)/u,m=i*Math.PI/180,p=[],h=[];for(let f=0;f<=l;f++){let b=f/l,_=b*u*r+m,k=c*(b*u)+a/2,S=a/2;p.push({x:(k+S*.3)*Math.cos(_),y:(k+S*.3)*Math.sin(_)}),h.push({x:Math.max(0,k-S*.3)*Math.cos(_),y:Math.max(0,k-S*.3)*Math.sin(_)})}let g=`M ${p[0].x} ${p[0].y}`;for(let f=1;f<p.length;f++)g+=` L ${p[f].x} ${p[f].y}`;let y=h[h.length-1];g+=` L ${y.x} ${y.y}`;for(let f=h.length-2;f>=0;f--)g+=` L ${h[f].x} ${h[f].y}`;return g+=" Z",g}var Hn=.2;function Mt(n,e,t,r=0){let i=e*(t/100),a=e,o=e-i,l=2*Math.PI/n,u=l*Hn/2,c=l/4,m=r*Math.PI/180,p=[];for(let h=0;h<n;h++){let g=m+h*l;p.push({x:o*Math.cos(g),y:o*Math.sin(g)}),p.push({x:a*Math.cos(g+c-u),y:a*Math.sin(g+c-u)}),p.push({x:a*Math.cos(g+c+u),y:a*Math.sin(g+c+u)}),p.push({x:o*Math.cos(g+l/2),y:o*Math.sin(g+l/2)})}return p}function De(n,e,t,r=0,i=0,a="evenodd",o=0){let l=Mt(n,e,t,o),u=Math.min(r,e*.1),c=V(l,u,e);if(i>0){let m=e*(i/100),p=a==="nonzero"?1:0;c+=` M ${m} 0 A ${m} ${m} 0 1 ${p} ${-m} 0 A ${m} ${m} 0 1 ${p} ${m} 0 Z`}return c}function Be(n,e,t,r,i,a="round",o="uniform",l){let u=Math.min(t,r)/2,c,m,p,h,g,y,f,b;if(o==="non-uniform"&&l?(c=Math.min(l.radiusTL??i,u),m=Math.min(l.radiusTR??i,u),p=Math.min(l.radiusBR??i,u),h=Math.min(l.radiusBL??i,u),g=l.shapeTL??a,y=l.shapeTR??a,f=l.shapeBR??a,b=l.shapeBL??a):(c=m=p=h=Math.min(i,u),g=y=f=b=a),!(a!=="round"||o==="non-uniform"||c>0&&g!=="round"||m>0&&y!=="round"||p>0&&f!=="round"||h>0&&b!=="round")&&c===m&&m===p&&p===h)return null;let k=`M${n+c},${e}`;return k+=` L${n+t-m},${e}`,k+=ve(y,m,n+t,e,"tr"),k+=` L${n+t},${e+r-p}`,k+=ve(f,p,n+t,e+r,"br"),k+=` L${n+h},${e+r}`,k+=ve(b,h,n,e+r,"bl"),k+=` L${n},${e+c}`,k+=ve(g,c,n,e,"tl"),k+=" Z",k}function ve(n,e,t,r,i){if(e<=0)return"";switch(n){case"round":switch(i){case"tr":return` A${e},${e} 0 0 1 ${t},${r+e}`;case"br":return` A${e},${e} 0 0 1 ${t-e},${r}`;case"bl":return` A${e},${e} 0 0 1 ${t},${r-e}`;case"tl":return` A${e},${e} 0 0 1 ${t+e},${r}`}break;case"scoop":switch(i){case"tr":return` A${e},${e} 0 0 0 ${t},${r+e}`;case"br":return` A${e},${e} 0 0 0 ${t-e},${r}`;case"bl":return` A${e},${e} 0 0 0 ${t},${r-e}`;case"tl":return` A${e},${e} 0 0 0 ${t+e},${r}`}break;case"bevel":switch(i){case"tr":return` L${t},${r+e}`;case"br":return` L${t-e},${r}`;case"bl":return` L${t},${r-e}`;case"tl":return` L${t+e},${r}`}break;case"notch":switch(i){case"tr":return` L${t-e},${r+e} L${t},${r+e}`;case"br":return` L${t-e},${r-e} L${t-e},${r}`;case"bl":return` L${t+e},${r-e} L${t},${r-e}`;case"tl":return` L${t+e},${r+e} L${t+e},${r}`}break}return""}function Ge(n,e,t=!1,r=.5,i){if(n.length<2)return n.length===1?`M ${n[0].x} ${n[0].y}`:"";switch(e){case"LINEAR":case"linear":return en(n,t);case"QUADRATIC":case"quadratic":return Xn(n,t);case"CUBIC":case"cubic":return Yn(n,t);case"ARC":case"arc":return qn(n,t,i);case"MIXED":case"mixed":return tn(n,t);case"CATMULL_ROM":case"catmull-rom":return Kn(n,t,r);case"BASIS":case"basis":return Zn(n,t);default:return n.some(a=>a.segmentType)?tn(n,t):en(n,t)}}function en(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let i=1;i<n.length;i++)n[i].isSubpathStart?(e&&i-r>2&&(t+=" Z"),t+=` M ${n[i].x} ${n[i].y}`,r=i):t+=` L ${n[i].x} ${n[i].y}`;return e&&n.length-r>2&&(t+=" Z"),t}function Xn(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let i=0;i<n.length-1;i++){let a=n[i],o=n[i+1];if(o.isSubpathStart){if(e&&i-r>=1){let u=n[r],c=a.handleOut??{x:(a.x+u.x)/2,y:(a.y+u.y)/2};t+=` Q ${c.x} ${c.y} ${u.x} ${u.y} Z`}t+=` M ${o.x} ${o.y}`,r=i+1;continue}let l=a.handleOut??{x:(a.x+o.x)/2,y:(a.y+o.y)/2};t+=` Q ${l.x} ${l.y} ${o.x} ${o.y}`}if(e&&n.length-r>1){let i=n[n.length-1],a=n[r],o=i.handleOut??{x:(i.x+a.x)/2,y:(i.y+a.y)/2};t+=` Q ${o.x} ${o.y} ${a.x} ${a.y} Z`}return t}function Yn(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let i=0;i<n.length-1;i++){let a=n[i],o=n[i+1];if(o.isSubpathStart){if(e&&i-r>=1){let c=n[r],m=a.handleOut??{x:a.x,y:a.y},p=c.handleIn??{x:c.x,y:c.y};t+=` C ${m.x} ${m.y} ${p.x} ${p.y} ${c.x} ${c.y} Z`}t+=` M ${o.x} ${o.y}`,r=i+1;continue}let l=a.handleOut??{x:a.x,y:a.y},u=o.handleIn??{x:o.x,y:o.y};t+=` C ${l.x} ${l.y} ${u.x} ${u.y} ${o.x} ${o.y}`}if(e&&n.length-r>1){let i=n[n.length-1],a=n[r],o=i.handleOut??{x:i.x,y:i.y},l=a.handleIn??{x:a.x,y:a.y};t+=` C ${o.x} ${o.y} ${l.x} ${l.y} ${a.x} ${a.y} Z`}return t}function qn(n,e,t){let r=`M ${n[0].x} ${n[0].y}`,i=0,a={rx:50,ry:50,rotation:0,largeArc:!1,sweep:!0};for(let o=0;o<n.length-1;o++){let l=n[o+1];if(l.isSubpathStart){if(e&&o-i>=1){let c=n[i],m=t?.[o]??a;r+=` A ${m.rx} ${m.ry} ${m.rotation} ${m.largeArc?1:0} ${m.sweep?1:0} ${c.x} ${c.y} Z`}r+=` M ${l.x} ${l.y}`,i=o+1;continue}let u=t?.[o]??a;r+=` A ${u.rx} ${u.ry} ${u.rotation} ${u.largeArc?1:0} ${u.sweep?1:0} ${l.x} ${l.y}`}if(e&&n.length-i>1){let o=n[i],l=t?.[n.length-1]??a;r+=` A ${l.rx} ${l.ry} ${l.rotation} ${l.largeArc?1:0} ${l.sweep?1:0} ${o.x} ${o.y} Z`}return r}function tn(n,e){let t=`M ${n[0].x} ${n[0].y}`,r=0;for(let i=0;i<n.length-1;i++){let a=n[i],o=n[i+1];if(o.isSubpathStart){if(e&&i-r>=1){let l=n[r];t+=vt(a,l,l.segmentType),t+=" Z"}t+=` M ${o.x} ${o.y}`,r=i+1;continue}t+=vt(a,o,o.segmentType)}if(e&&n.length-r>1){let i=n[n.length-1],a=n[r];t+=vt(i,a,a.segmentType),t+=" Z"}return t}function vt(n,e,t){let r=(t??(n.handleOut||e.handleIn?"CUBIC":"LINEAR")).toUpperCase();if(r==="LINEAR")return` L ${e.x} ${e.y}`;if(r==="QUADRATIC"){let o=n.handleOut??{x:(n.x+e.x)/2,y:(n.y+e.y)/2};return` Q ${o.x} ${o.y} ${e.x} ${e.y}`}if(r==="ARC"){let o=e.arcParams;return o?` A ${o.rx} ${o.ry} ${o.rotation} ${o.largeArc?1:0} ${o.sweep?1:0} ${e.x} ${e.y}`:` L ${e.x} ${e.y}`}let i=n.handleOut??{x:n.x,y:n.y},a=e.handleIn??{x:e.x,y:e.y};return` C ${i.x} ${i.y} ${a.x} ${a.y} ${e.x} ${e.y}`}function Kn(n,e,t){if(n.length<2)return n.length===1?`M ${n[0].x} ${n[0].y}`:"";let r=t,i=e?[n[n.length-1],...n,n[0],n[1]]:[n[0],...n,n[n.length-1]],a=`M ${n[0].x} ${n[0].y}`,o=e?n.length:n.length-1;for(let l=0;l<o;l++){let u=i[l],c=i[l+1],m=i[l+2],p=i[l+3],h=Math.hypot(m.x-c.x,m.y-c.y),g=Math.hypot(c.x-u.x,c.y-u.y),y=Math.hypot(p.x-m.x,p.y-m.y),f=Math.pow(g,r),b=Math.pow(h,r),_=Math.pow(y,r),k=Math.pow(g,2*r),S=Math.pow(h,2*r),T=Math.pow(y,2*r),R,A,$,x;g<1e-8?(R=c.x,A=c.y):(R=(k*m.x-S*u.x+(2*k+3*f*b+S)*c.x)/(3*f*(f+b)),A=(k*m.y-S*u.y+(2*k+3*f*b+S)*c.y)/(3*f*(f+b))),y<1e-8?($=m.x,x=m.y):($=(T*c.x-S*p.x+(2*T+3*_*b+S)*m.x)/(3*_*(_+b)),x=(T*c.y-S*p.y+(2*T+3*_*b+S)*m.y)/(3*_*(_+b))),a+=` C ${R} ${A} ${$} ${x} ${m.x} ${m.y}`}return e&&(a+=" Z"),a}function Zn(n,e){let t=n.length;if(t<2)return t===1?`M ${n[0].x} ${n[0].y}`:"";if(t===2)return`M ${n[0].x} ${n[0].y} L ${n[1].x} ${n[1].y}`;if(e){let a=(n[0].x+4*n[1].x+n[2].x)/6,o=(n[0].y+4*n[1].y+n[2].y)/6,l=`M ${a} ${o}`;for(let u=0;u<t;u++){let c=n[(u+1)%t],m=n[(u+2)%t],p=n[(u+3)%t];l+=Pt(c,m,p)}return l+=" Z",l}let r=n,i=`M ${r[0].x} ${r[0].y}`;i+=` L ${(5*r[0].x+r[1].x)/6} ${(5*r[0].y+r[1].y)/6}`;for(let a=0;a<=t-3;a++)i+=Pt(r[a],r[a+1],r[a+2]);return i+=Pt(r[t-2],r[t-1],r[t-1]),i+=` L ${r[t-1].x} ${r[t-1].y}`,i}function Pt(n,e,t){return` C ${(2*n.x+e.x)/3} ${(2*n.y+e.y)/3} ${(n.x+2*e.x)/3} ${(n.y+2*e.y)/3} ${(n.x+4*e.x+t.x)/6} ${(n.y+4*e.y+t.y)/6}`}function re(n,e,t){let r=Number.isFinite(e)?Math.max(1,e):8,i=Number.isFinite(t)?Math.max(1,t):4;switch(n){case"dashed":case"dotted":case"custom":return`${r} ${i}`;default:return null}}function B(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Qn(n){let e=n.fillType;return e||(n.fillGradient?n.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":n.linearGradient?"linear-gradient":n.radialGradient?"radial-gradient":"solid")}function Le(n){let e=new Map,t=n.state,r=t;switch(n.type){case"circle":e.set("cx",String(t.x??0)),e.set("cy",String(t.y??0)),e.set("r",String(t.radius??50));break;case"ellipse":e.set("cx",String(t.cx??0)),e.set("cy",String(t.cy??0)),e.set("rx",String(t.rx??50)),e.set("ry",String(t.ry??30));break;case"rectangle":case"square":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),(t.cornerRadius??0)>0&&e.set("rx",String(t.cornerRadius));break;case"line":e.set("x1",String(t.x1??0)),e.set("y1",String(t.y1??0)),e.set("x2",String(t.x2??0)),e.set("y2",String(t.y2??0));break;case"text":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),t.fontSize&&e.set("font-size",String(t.fontSize)),t.fontFamily&&e.set("font-family",t.fontFamily),t.fontWeight&&e.set("font-weight",t.fontWeight),t.fontStyle&&e.set("font-style",t.fontStyle),t.textAnchor&&e.set("text-anchor",t.textAnchor),t.letterSpacing&&e.set("letter-spacing",String(t.letterSpacing));break;case"image":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),r.href&&e.set("href",String(r.href));break}let i=Qn(r);i==="none"?e.set("fill","none"):i==="linear-gradient"||i==="radial-gradient"?e.set("fill",`url(#gradient-fill-${n.id})`):i==="pattern"?e.set("fill",`url(#pattern-fill-${n.id})`):e.set("fill",t.fillColor??"#000000");let a=t.opacity;a!==void 0&&a<1&&e.set("opacity",String(a));let o=t.fillOpacity;o!==void 0&&o<1&&e.set("fill-opacity",String(o)),t.fillRule&&t.fillRule!=="nonzero"&&e.set("fill-rule",t.fillRule);let l=r.strokeType??"solid";if(l==="none")e.set("stroke","none");else if(l==="linear-gradient"||l==="radial-gradient")e.set("stroke",`url(#gradient-stroke-${n.id})`);else{let T=t.borderColor??"none";T!=="none"&&e.set("stroke",T)}let u=t.borderWidth;u!=null&&u!==0&&e.set("stroke-width",String(u));let c=t.strokeOpacity;c!==void 0&&c<1&&e.set("stroke-opacity",String(c));let m=t.lineStyle??"solid",p=t.dashLength??8,h=t.gapLength??4,g=re(m,p,h);g&&(e.set("stroke-dasharray",g),m==="dotted"&&e.set("stroke-linecap","round"));let y=Jn(r);y&&e.set("transform",y);let f=r.filters;f&&f.length>0&&e.set("filter",`url(#filter-${n.id})`);let b=t.shapeRendering;b&&b!=="auto"&&e.set("shape-rendering",b);let _=r.startEndpoint,k=r.endEndpoint;_&&_!=="none"&&e.set("marker-start",`url(#line-marker-${_})`),k&&k!=="none"&&e.set("marker-end",`url(#line-marker-${k})`);let S=r.metadata;return S&&(S.role&&e.set("role",S.role),S.ariaLabel&&e.set("aria-label",S.ariaLabel)),e}function nn(n){switch(n.type){case"circle":return"circle";case"ellipse":return"ellipse";case"rectangle":case"square":return"rect";case"line":return"line";case"text":return"text";case"image":return"image";case"spline":case"polyline":case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":return"path";default:return"g"}}function Jn(n){let e=n.rotation??0,t=n.skewX??0,r=n.skewY??0,i=n.scaleX??1,a=n.scaleY??1;if(e===0&&t===0&&r===0&&i===1&&a===1)return null;let o=n.customPivot;if(!o)return null;let l=[];return l.push(`translate(${o.x}, ${o.y})`),e!==0&&l.push(`rotate(${e})`),(i!==1||a!==1)&&l.push(`scale(${i}, ${a})`),t!==0&&l.push(`skewX(${t})`),r!==0&&l.push(`skewY(${r})`),l.push(`translate(${-o.x}, ${-o.y})`),l.join(" ")}function j(n,e){let t=n.viewboxes?.[0];return{width:e.width??t?.width??800,height:e.height??t?.height??600}}function s(n,e){return e==null||e===""?"":` ${n}="${B(String(e))}"`}function Ne(n){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?{r:parseInt(e[1],16)/255,g:parseInt(e[2],16)/255,b:parseInt(e[3],16)/255}:{r:0,g:0,b:0}}function er(n,e,t){let{offsetX:r,offsetY:i,blurRadius:a,spread:o,color:l,opacity:u}=n,c="";if(o===0)c+=`<feDropShadow${s("in",e)}${s("dx",r)}${s("dy",i)}${s("stdDeviation",a/2)}${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_shadow`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_shadow`)}/><feMergeNode${s("in",e)}/></feMerge>`;else{c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`;let m=o>0?"dilate":"erode",p=Math.abs(o);c+=`<feMorphology${s("in",`${t}_alpha`)}${s("operator",m)}${s("radius",p)}${s("result",`${t}_spread`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_spread`)}${s("stdDeviation",a/2)}${s("result",`${t}_blur`)}/>`,c+=`<feOffset${s("in",`${t}_blur`)}${s("dx",r)}${s("dy",i)}${s("result",`${t}_offset`)}/>`,c+=`<feFlood${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_color`)}/>`,c+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_offset`)}${s("operator","in")}${s("result",`${t}_shadow`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_shadow`)}/><feMergeNode${s("in",e)}/></feMerge>`}return c}function tr(n,e,t){let{offsetX:r,offsetY:i,blurRadius:a,choke:o,color:l,opacity:u}=n,c=a*(1-o/100),m="";return m+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,m+=`<feComponentTransfer${s("in",`${t}_alpha`)}${s("result",`${t}_inverted`)}><feFuncA${s("type","table")}${s("tableValues","1 0")}/></feComponentTransfer>`,m+=`<feGaussianBlur${s("in",`${t}_inverted`)}${s("stdDeviation",c/2)}${s("result",`${t}_blur`)}/>`,m+=`<feOffset${s("in",`${t}_blur`)}${s("dx",r)}${s("dy",i)}${s("result",`${t}_offset`)}/>`,m+=`<feFlood${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_color`)}/>`,m+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_offset`)}${s("operator","in")}${s("result",`${t}_coloredShadow`)}/>`,m+=`<feComposite${s("in",`${t}_coloredShadow`)}${s("in2",`${t}_alpha`)}${s("operator","in")}${s("result",`${t}_innerShadow`)}/>`,m+=`<feComposite${s("in",`${t}_innerShadow`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`,m}function nr(n,e,t){let{blurX:r,blurY:i}=n;return r===0&&i===0?E(e,t):`<feGaussianBlur${s("in",e)}${s("stdDeviation",`${r/2} ${i/2}`)}${s("result",t)}/>`}function rr(n,e,t){let{distance:r,angle:i}=n;if(r===0)return E(e,t);let a=i*Math.PI/180,o=Math.abs(Math.cos(a)*r),l=Math.abs(Math.sin(a)*r);return`<feGaussianBlur${s("in",e)}${s("stdDeviation",`${o/2} ${l/2}`)}${s("result",t)}/>`}function rn(n,e,t){let{x:r,y:i,z:a,color:o,surfaceScale:l,diffuseConstant:u,specularConstant:c,specularExponent:m}=n,p="";return p+=`<feDiffuseLighting${s("in","SourceAlpha")}${s("surfaceScale",l)}${s("diffuseConstant",u)}${s("lighting-color",o)}${s("result",`${t}_diffuse`)}>`,p+=`<fePointLight${s("x",r)}${s("y",i)}${s("z",a)}/>`,p+="</feDiffuseLighting>",p+=`<feSpecularLighting${s("in","SourceAlpha")}${s("surfaceScale",l)}${s("specularConstant",c)}${s("specularExponent",m)}${s("lighting-color",o)}${s("result",`${t}_specular`)}>`,p+=`<fePointLight${s("x",r)}${s("y",i)}${s("z",a)}/>`,p+="</feSpecularLighting>",p+=`<feComposite${s("in",e)}${s("in2",`${t}_diffuse`)}${s("operator","arithmetic")}${s("k1",1)}${s("k2",0)}${s("k3",0)}${s("k4",0)}${s("result",`${t}_lit`)}/>`,p+=`<feComposite${s("in",`${t}_specular`)}${s("in2",`${t}_lit`)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",1)}${s("k3",1)}${s("k4",0)}${s("result",t)}/>`,p}function sn(n,e,t){let{x:r,y:i,z:a,pointsAtX:o,pointsAtY:l,pointsAtZ:u,coneAngle:c,color:m,surfaceScale:p,specularConstant:h,specularExponent:g}=n,y="";return y+=`<feSpecularLighting${s("in","SourceAlpha")}${s("surfaceScale",p)}${s("specularConstant",h)}${s("specularExponent",g)}${s("lighting-color",m)}${s("result",`${t}_specular`)}>`,y+=`<feSpotLight${s("x",r)}${s("y",i)}${s("z",a)}${s("pointsAtX",o)}${s("pointsAtY",l)}${s("pointsAtZ",u)}${s("limitingConeAngle",c)}/>`,y+="</feSpecularLighting>",y+=`<feComposite${s("in",`${t}_specular`)}${s("in2","SourceAlpha")}${s("operator","in")}${s("result",`${t}_clipped`)}/>`,y+=`<feComposite${s("in",`${t}_clipped`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",1)}${s("k3",1)}${s("k4",0)}${s("result",t)}/>`,y}function an(n){switch(n.kind){case"point":return`<fePointLight${s("x",n.x)}${s("y",n.y)}${s("z",n.z)}/>`;case"spot":{let e=`<feSpotLight${s("x",n.x)}${s("y",n.y)}${s("z",n.z)}${s("pointsAtX",n.pointsAtX)}${s("pointsAtY",n.pointsAtY)}${s("pointsAtZ",n.pointsAtZ)}`;return n.limitingConeAngle!==void 0&&(e+=s("limitingConeAngle",n.limitingConeAngle)),n.specularExponent!==void 0&&(e+=s("specularExponent",n.specularExponent)),e+"/>"}case"distant":return`<feDistantLight${s("azimuth",n.azimuth)}${s("elevation",n.elevation)}/>`}}function ir(n,e,t){return`<feDiffuseLighting${s("in",e)}${s("surfaceScale",n.surfaceScale)}${s("diffuseConstant",n.diffuseConstant)}${s("lighting-color",n.color)}${s("result",t)}>`+an(n.lightSource)+"</feDiffuseLighting>"}function sr(n,e,t){return`<feSpecularLighting${s("in",e)}${s("surfaceScale",n.surfaceScale)}${s("specularConstant",n.specularConstant)}${s("specularExponent",n.specularExponent)}${s("lighting-color",n.color)}${s("result",t)}>`+an(n.lightSource)+"</feSpecularLighting>"}function ar(n,e,t){let{width:r,color:i,opacity:a,position:o}=n,l="";if(o==="inside")l+=`<feMorphology${s("in","SourceAlpha")}${s("operator","erode")}${s("radius",r)}${s("result",`${t}_eroded`)}/>`,l+=`<feComposite${s("in","SourceAlpha")}${s("in2",`${t}_eroded`)}${s("operator","out")}${s("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${s("flood-color",i)}${s("flood-opacity",a)}${s("result",`${t}_color`)}/>`,l+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_outlineAlpha`)}${s("operator","in")}${s("result",`${t}_outline`)}/>`,l+=`<feComposite${s("in",`${t}_outline`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`;else{let u=o==="outside"?r:r/2;l+=`<feMorphology${s("in","SourceAlpha")}${s("operator","dilate")}${s("radius",u)}${s("result",`${t}_dilated`)}/>`,l+=`<feComposite${s("in",`${t}_dilated`)}${s("in2","SourceAlpha")}${s("operator","out")}${s("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${s("flood-color",i)}${s("flood-opacity",a)}${s("result",`${t}_color`)}/>`,l+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_outlineAlpha`)}${s("operator","in")}${s("result",`${t}_outline`)}/>`,l+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_outline`)}/><feMergeNode${s("in",e)}/></feMerge>`}return l}function or(n,e,t){let{amount:r}=n;if(r===0)return E(e,t);let i=1+4*r,a=-r,o=[0,a,0,a,i,a,0,a,0].join(" ");return`<feConvolveMatrix${s("in",e)}${s("order","3")}${s("kernelMatrix",o)}${s("divisor","1")}${s("bias","0")}${s("preserveAlpha","true")}${s("edgeMode","duplicate")}${s("result",t)}/>`}function lr(n,e,t){let{blockSize:r}=n;if(r<=1)return E(e,t);let i=r/2,a="";return a+=`<feMorphology${s("in",e)}${s("operator","erode")}${s("radius",i)}${s("result",`${t}_eroded`)}/>`,a+=`<feMorphology${s("in",`${t}_eroded`)}${s("operator","dilate")}${s("radius",i)}${s("result",t)}/>`,a}function ur(n,e,t){let{scale:r,frequency:i,octaves:a,warpType:o}=n;if(r===0)return E(e,t);let l="";return l+=`<feTurbulence${s("type",o)}${s("baseFrequency",i)}${s("numOctaves",a)}${s("seed",0)}${s("result",`${t}_turbulence`)}/>`,l+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_turbulence`)}${s("scale",r)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",t)}/>`,l}function cr(n,e,t){let{operator:r,radiusX:i,radiusY:a}=n;return i===0&&a===0?E(e,t):`<feMorphology${s("in",e)}${s("operator",r)}${s("radius",`${i} ${a}`)}${s("result",t)}/>`}function hr(n,e,t){let{levels:r}=n;if(r<2)return E(e,t);let i=[];for(let l=0;l<r;l++)i.push(l/(r-1));let a=i.join(" "),o=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return o+=`<feFuncR${s("type","discrete")}${s("tableValues",a)}/>`,o+=`<feFuncG${s("type","discrete")}${s("tableValues",a)}/>`,o+=`<feFuncB${s("type","discrete")}${s("tableValues",a)}/>`,o+="</feComponentTransfer>",o}function dr(n,e,t){let{levels:r,contrast:i}=n;if(r<2)return E(e,t);let a=[];for(let u=0;u<r;u++){let c=u/(r-1),m=c;i!==1&&(m=.5+(c-.5)*i,m=Math.max(0,Math.min(1,m))),a.push(m)}let o=a.join(" "),l=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return l+=`<feFuncR${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function pr(n,e,t){let{radius:r}=n;if(r===0)return E(e,t);let i="";return i+=`<feGaussianBlur${s("in","SourceAlpha")}${s("stdDeviation",r)}${s("result",`${t}_blurredAlpha`)}/>`,i+=`<feComponentTransfer${s("in",`${t}_blurredAlpha`)}${s("result",`${t}_thresholdAlpha`)}><feFuncA${s("type","linear")}${s("slope",20)}${s("intercept",-9)}/></feComponentTransfer>`,i+=`<feComposite${s("in",e)}${s("in2",`${t}_thresholdAlpha`)}${s("operator","in")}${s("result",t)}/>`,i}function mr(n,e,t){let{amount:r}=n;if(r===0)return E(e,t);let i=1-r;return`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","saturate")}${s("values",i)}${s("result",t)}/>`}function fr(n,e,t){let{red:r,green:i,blue:a}=n;if(r===1&&i===1&&a===1)return E(e,t);let o=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return o+=`<feFuncR${s("type","linear")}${s("slope",r)}${s("intercept",0)}/>`,o+=`<feFuncG${s("type","linear")}${s("slope",i)}${s("intercept",0)}/>`,o+=`<feFuncB${s("type","linear")}${s("slope",a)}${s("intercept",0)}/>`,o+="</feComponentTransfer>",o}function gr(n,e,t){let{amount:r}=n;if(r===1)return E(e,t);let i=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return i+=`<feFuncR${s("type","linear")}${s("slope",r)}${s("intercept",0)}/>`,i+=`<feFuncG${s("type","linear")}${s("slope",r)}${s("intercept",0)}/>`,i+=`<feFuncB${s("type","linear")}${s("slope",r)}${s("intercept",0)}/>`,i+="</feComponentTransfer>",i}function $r(n,e,t){let{amount:r}=n;if(r===1)return E(e,t);let i=.5*(1-r),a=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return a+=`<feFuncR${s("type","linear")}${s("slope",r)}${s("intercept",i)}/>`,a+=`<feFuncG${s("type","linear")}${s("slope",r)}${s("intercept",i)}/>`,a+=`<feFuncB${s("type","linear")}${s("slope",r)}${s("intercept",i)}/>`,a+="</feComponentTransfer>",a}function yr(n,e,t){let{amount:r}=n;if(r===1)return E(e,t);let i=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return i+=`<feFuncA${s("type","linear")}${s("slope",r)}${s("intercept",0)}/>`,i+="</feComponentTransfer>",i}function br(n,e,t){let{amount:r}=n;if(r===0)return E(e,t);let i=r,a=1-r,o=`${i} ${a}`,l=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return l+=`<feFuncR${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function xr(n,e,t){let{angle:r}=n;return r===0||r===360?E(e,t):`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","hueRotate")}${s("values",r)}${s("result",t)}/>`}function Sr(n,e,t){let{amount:r}=n;return r===1?E(e,t):`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","saturate")}${s("values",r)}${s("result",t)}/>`}function _r(n,e,t){let{threshold:r}=n,i="";if(i+=`<feColorMatrix${s("in",e)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`,r===.5)i+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,i+=`<feFuncR${s("type","discrete")}${s("tableValues","0 1")}/>`,i+=`<feFuncG${s("type","discrete")}${s("tableValues","0 1")}/>`,i+=`<feFuncB${s("type","discrete")}${s("tableValues","0 1")}/>`,i+="</feComponentTransfer>";else{let o=[];for(let u=0;u<256;u++)o.push(u/255<r?0:1);let l=o.join(" ");i+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,i+=`<feFuncR${s("type","table")}${s("tableValues",l)}/>`,i+=`<feFuncG${s("type","table")}${s("tableValues",l)}/>`,i+=`<feFuncB${s("type","table")}${s("tableValues",l)}/>`,i+="</feComponentTransfer>"}return i}function kr(n,e,t){let{amount:r}=n;if(r===0)return E(e,t);let i=[.393,.769,.189,0,0],a=[.349,.686,.168,0,0],o=[.272,.534,.131,0,0],l=[1,0,0,0,0],u=[0,1,0,0,0],c=[0,0,1,0,0],m=(f,b)=>f.map((_,k)=>_*(1-r)+b[k]*r),p=m(l,i),h=m(u,a),g=m(c,o),y=[...p,...h,...g,0,0,0,1,0].join(" ");return`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","matrix")}${s("values",y)}${s("result",t)}/>`}function wr(n,e,t){let{shadowColor:r,highlightColor:i}=n,a=Ne(r),o=Ne(i),l="";return l+=`<feColorMatrix${s("in",e)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`,l+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,l+=`<feFuncR${s("type","table")}${s("tableValues",`${a.r} ${o.r}`)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",`${a.g} ${o.g}`)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",`${a.b} ${o.b}`)}/>`,l+="</feComponentTransfer>",l}function Tr(n,e,t){let{intensity:r}=n;if(r===0)return E(e,t);let i="";i+=`<feComponentTransfer${s("in",e)}${s("result",`${t}_invert`)}>`,i+=`<feFuncR${s("type","table")}${s("tableValues","1 0")}/>`,i+=`<feFuncG${s("type","table")}${s("tableValues","1 0")}/>`,i+=`<feFuncB${s("type","table")}${s("tableValues","1 0")}/>`,i+="</feComponentTransfer>",i+=`<feColorMatrix${s("in",`${t}_invert`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`;let a=[.1,.1,.1,0,0],o=[.3,.4,.3,0,0],l=[.5,.5,.8,0,0],u=[1,0,0,0,0],c=[0,1,0,0,0],m=[0,0,1,0,0],p=(b,_)=>b.map((k,S)=>k*(1-r)+_[S]*r),h=p(u,a),g=p(c,o),y=p(m,l),f=[...h,...g,...y,0,0,0,1,0].join(" ");return i+=`<feColorMatrix${s("in",`${t}_gray`)}${s("type","matrix")}${s("values",f)}${s("result",t)}/>`,i}function vr(n,e,t){let{amount:r,scale:i}=n;if(r===0)return E(e,t);let a=1/i,o="";return o+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",a)}${s("numOctaves",3)}${s("seed",0)}${s("result",`${t}_noise`)}/>`,o+=`<feColorMatrix${s("in",`${t}_noise`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_noiseGray`)}/>`,o+=`<feBlend${s("in",e)}${s("in2",`${t}_noiseGray`)}${s("mode","overlay")}${s("result",`${t}_blended`)}/>`,o+=`<feComposite${s("in",`${t}_blended`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",r)}${s("k3",1-r)}${s("k4",0)}${s("result",`${t}_amt`)}/>`,o+=`<feComposite${s("in",`${t}_amt`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,o}function Pr(n,e,t){let{strength:r,angle:i}=n;if(r===0)return E(e,t);let a=i*Math.PI/180,o=Math.cos(a),l=Math.sin(a),u=r,c=[-(u*(o+l)),-(u*l),u*(-o+l),-(u*o),1,u*o,u*(o-l),u*l,u*(o+l)].join(" ");return`<feConvolveMatrix${s("in",e)}${s("order","3 3")}${s("kernelMatrix",c)}${s("divisor",1)}${s("bias",.5)}${s("preserveAlpha","true")}${s("result",t)}/>`}function Mr(n,e,t){let{amount:r,size:i}=n;if(r===0)return E(e,t);let a=.5/i,o="";return o+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",`${a} ${a}`)}${s("numOctaves",5)}${s("seed",0)}${s("stitchTiles","stitch")}${s("result",`${t}_grain`)}/>`,o+=`<feColorMatrix${s("in",`${t}_grain`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_grainGray`)}/>`,o+=`<feBlend${s("in",e)}${s("in2",`${t}_grainGray`)}${s("mode","soft-light")}${s("result",`${t}_blended`)}/>`,o+=`<feComposite${s("in",`${t}_blended`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",r)}${s("k3",1-r)}${s("k4",0)}${s("result",`${t}_amt`)}/>`,o+=`<feComposite${s("in",`${t}_amt`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,o}function Rr(n,e,t){let{wetness:r,turbulence:i}=n;if(r===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",.02+i*.03)}${s("numOctaves",4)}${s("seed",42)}${s("result",`${t}_turb`)}/>`,a+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_turb`)}${s("scale",r*15)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${s("in",`${t}_disp`)}${s("stdDeviation",r*2)}${s("result",`${t}_blur`)}/>`,a+=`<feBlend${s("in",`${t}_blur`)}${s("in2",e)}${s("mode","multiply")}${s("result",t)}/>`,a}function Cr(n,e,t){let{thickness:r,texture:i}=n;if(r===0&&i===0)return E(e,t);let a="";a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.03+i*.02)}${s("numOctaves",3)}${s("seed",1e3)}${s("result",`${t}_brush`)}/>`;let o=Math.max(3,8-Math.floor(r*5)),l=Array.from({length:o+1},(u,c)=>c/o).join(" ");a+=`<feComponentTransfer${s("in",e)}${s("result",`${t}_poster`)}>`;for(let u of["R","G","B"])a+=`<feFunc${u}${s("type","discrete")}${s("tableValues",l)}/>`;return a+="</feComponentTransfer>",a+=`<feDisplacementMap${s("in",`${t}_poster`)}${s("in2",`${t}_brush`)}${s("scale",i*4)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feMorphology${s("in",`${t}_disp`)}${s("operator","dilate")}${s("radius",r*.5)}${s("result",`${t}_thick`)}/>`,a+=`<feComposite${s("in",`${t}_thick`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,a}function Ar(n,e,t){let{spread:r,edges:i}=n;if(r===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",.01+i*.02)}${s("numOctaves",5)}${s("seed",1100)}${s("result",`${t}_ink`)}/>`,a+=`<feMorphology${s("in",e)}${s("operator","dilate")}${s("radius",r*3)}${s("result",`${t}_dilate`)}/>`,a+=`<feDisplacementMap${s("in",`${t}_dilate`)}${s("in2",`${t}_ink`)}${s("scale",i*10)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${s("in",`${t}_disp`)}${s("stdDeviation",r*.5)}${s("result",t)}/>`,a}function Er(n,e,t){let{wrinkles:r,shine:i}=n;if(r===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.02)}${s("numOctaves",4)}${s("seed",1200)}${s("result",`${t}_wrinkle`)}/>`,a+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_wrinkle`)}${s("scale",r*15)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feSpecularLighting${s("in",`${t}_wrinkle`)}${s("surfaceScale",r*2)}${s("specularConstant",i*1.5)}${s("specularExponent",20)}${s("result",`${t}_sheen`)}>`,a+=`<feDistantLight${s("azimuth",45)}${s("elevation",60)}/>`,a+="</feSpecularLighting>",a+=`<feBlend${s("in",`${t}_disp`)}${s("in2",`${t}_sheen`)}${s("mode","screen")}${s("result",`${t}_blend`)}/>`,a+=`<feComposite${s("in",`${t}_blend`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,a}function Fr(n,e,t){let{density:r,size:i}=n;if(r===0)return E(e,t);let a="",o=1-r;a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.1/i)}${s("numOctaves",1)}${s("seed",1400)}${s("result",`${t}_hole`)}/>`,a+=`<feComponentTransfer${s("in",`${t}_hole`)}${s("result",`${t}_thresh`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${s("type","linear")}${s("slope",10)}${s("intercept",-o*10+5)}/>`;a+="</feComponentTransfer>",a+=`<feComponentTransfer${s("in",`${t}_thresh`)}${s("result",`${t}_clamp`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${s("type","table")}${s("tableValues","0 0 1 1")}/>`;return a+="</feComponentTransfer>",a+=`<feComposite${s("in",e)}${s("in2",`${t}_clamp`)}${s("operator","in")}${s("result",t)}/>`,a}function Ir(n,e,t){let{color:r,radius:i,intensity:a}=n;if(a===0||i===0)return E(e,t);let{r:o,g:l,b:u}=Ne(r),c="";return c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_alpha`)}${s("stdDeviation",i/2)}${s("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${s("in",`${t}_blur`)}${s("type","matrix")}${s("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a} 0`)}${s("result",`${t}_color`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_color`)}/><feMergeNode${s("in",e)}/></feMerge>`,c}function Or(n,e,t){let{color:r,radius:i,intensity:a}=n;if(a===0||i===0)return E(e,t);let{r:o,g:l,b:u}=Ne(r),c="";return c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,c+=`<feMorphology${s("in",`${t}_alpha`)}${s("operator","erode")}${s("radius",i/4)}${s("result",`${t}_erode`)}/>`,c+=`<feComposite${s("in",`${t}_alpha`)}${s("in2",`${t}_erode`)}${s("operator","out")}${s("result",`${t}_edge`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_edge`)}${s("stdDeviation",i/3)}${s("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${s("in",`${t}_blur`)}${s("type","matrix")}${s("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a*2} 0`)}${s("result",`${t}_color`)}/>`,c+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_alpha`)}${s("operator","in")}${s("result",`${t}_clipped`)}/>`,c+=`<feComposite${s("in",`${t}_clipped`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`,c}function E(n,e){return`<feMerge${s("result",e)}><feMergeNode${s("in",n)}/></feMerge>`}function Rt(n,e,t,r){switch(n.type){case"drop-shadow":return er(n,e,t);case"inner-shadow":return tr(n,e,t);case"gaussian-blur":return nr(n,e,t);case"motion-blur":return rr(n,e,t);case"point-light":{let i=n;return rn(r?{...i,x:i.x+r.x,y:i.y+r.y}:i,e,t)}case"spot-light":{let i=n;return sn(r?{...i,x:i.x+r.x,y:i.y+r.y,pointsAtX:i.pointsAtX+r.x,pointsAtY:i.pointsAtY+r.y}:i,e,t)}case"diffuse-lighting":return ir(n,e,t);case"specular-lighting":return sr(n,e,t);case"outline":return ar(n,e,t);case"sharpen":return or(n,e,t);case"pixelate":return lr(n,e,t);case"warp":return ur(n,e,t);case"morphology":return cr(n,e,t);case"contouring-discrete":return hr(n,e,t);case"contouring-table":return dr(n,e,t);case"round-edges":return pr(n,e,t);case"grayscale":return mr(n,e,t);case"channel-painter":return fr(n,e,t);case"brightness":return gr(n,e,t);case"contrast":return $r(n,e,t);case"opacity":return yr(n,e,t);case"invert":return br(n,e,t);case"hue-rotate":return xr(n,e,t);case"saturate":return Sr(n,e,t);case"black-and-white":return _r(n,e,t);case"sepia":return kr(n,e,t);case"duotone":return wr(n,e,t);case"xray":return Tr(n,e,t);case"noise":return vr(n,e,t);case"emboss":return Pr(n,e,t);case"film-grain":return Mr(n,e,t);case"watercolor":return Rr(n,e,t);case"gouache":return Cr(n,e,t);case"ink-blot":return Ar(n,e,t);case"crumpled-plastic":return Er(n,e,t);case"riddled":return Fr(n,e,t);case"glow":return Ir(n,e,t);case"inner-glow":return Or(n,e,t);case"raw-svg":return n.svgContent;default:return E(e,t)}}function Dr(n){return n.some(e=>e.type==="gaussian-blur"||e.type==="motion-blur"||e.type==="drop-shadow"||e.type==="inner-shadow"||e.type==="glow"||e.type==="inner-glow"||e.type==="outline"||e.type==="morphology"||e.type==="warp")}function Br(n,e,t={}){let r=e.filter(S=>S.enabled);if(r.length===0)return"";let i=t.colorInterpolation&&t.colorInterpolation!=="auto"?s("color-interpolation-filters",t.colorInterpolation):"",a=r.find(S=>S.type==="raw-svg");if(a){let S=t.colorInterpolation&&t.colorInterpolation!=="auto"?t.colorInterpolation:a.colorInterpolationFilters,T=t.filterUnits??a.filterUnits,R=t.primitiveUnits??a.primitiveUnits,A=t.x??a.x,$=t.y??a.y,x=t.width??a.width,v=t.height??a.height;return`<filter${s("id",n)}${s("x",A)}${s("y",$)}${s("width",x)}${s("height",v)}${s("filterUnits",T)}${s("primitiveUnits",R)}${s("color-interpolation-filters",S)}${s("flood-color",a.floodColor)}${s("flood-opacity",a.floodOpacity)}${s("lighting-color",a.lightingColor)}>${a.svgContent}</filter>`}let o=r.some(S=>S.type==="gaussian-blur"&&S.quality==="high"||S.type==="motion-blur"&&S.quality==="high"),l=Dr(r),u=l?o?"-200%":"-100%":"-10%",c=l?o?"500%":"300%":"120%",m="",p="SourceGraphic",h=0;for(let S of r){let T=`result${h++}`;m+=Rt(S,p,T),p=T}let g=t.filterUnits??"objectBoundingBox",y=t.primitiveUnits??"userSpaceOnUse",f=t.x??u,b=t.y??u,_=t.width??c,k=t.height??c;return`<filter${s("id",n)}${s("x",f)}${s("y",b)}${s("width",_)}${s("height",k)}${s("filterUnits",g)}${s("primitiveUnits",y)}${i}>${m}</filter>`}function H(n){let e="";for(let t of n){let r=t.state.filters;if(!r||r.length===0)continue;let i=r.filter(l=>l.enabled);if(i.length===0)continue;let a=`filter-${t.id}`,o=t.state;e+=Br(a,i,{colorInterpolation:o.filterColorInterpolation,filterUnits:o.filterUnits,primitiveUnits:o.primitiveUnits,x:o.filterX,y:o.filterY,width:o.filterWidth,height:o.filterHeight})}return e}function Ue(n,e){return!e||e.length===0||e.filter(r=>r.enabled).length===0?"":` filter="url(#filter-${B(n)})"`}function le(n,e,t,r){let i=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/10);switch(n){case"stripes":return[{tag:"rect",attrs:{width:r?.strokeWidth!=null?Math.max(.01,Math.min(1,r.strokeWidth))*e:e/2,height:e,fill:t}}];case"dots":{let a=r?.dotRadius!=null?Math.max(.05,Math.min(.45,r.dotRadius)):.25;return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e*a,fill:t}}]}case"grid":return[{tag:"path",attrs:{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"none",stroke:t,"stroke-width":i}}];case"checkerboard":return[{tag:"rect",attrs:{width:e/2,height:e/2,fill:t}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e/2,height:e/2,fill:t}}];case"diagonal":{let a=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/5);return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0`,stroke:t,"stroke-width":a}}]}case"crosshatch":return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0 M 0 0 L ${e} ${e}`,stroke:t,"stroke-width":i}}];case"zigzag":{let a=r?.amplitude!=null?Math.max(.05,Math.min(.5,r.amplitude)):.25,o=e*a;return[{tag:"path",attrs:{d:`M 0 ${o} L ${e/4} 0 L ${e/2} ${o} L ${e*3/4} 0 L ${e} ${o}`,fill:"none",stroke:t,"stroke-width":i}}]}case"waves":{let a=r?.amplitude!=null?Math.max(.05,Math.min(.5,r.amplitude)):.25,o=e*a,l=e/2;return[{tag:"path",attrs:{d:`M 0 ${l} Q ${e/4} ${l-o} ${e/2} ${l} T ${e} ${l}`,fill:"none",stroke:t,"stroke-width":i}}]}case"triangles":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${a} L 0 ${a} Z`,fill:"none",stroke:t,"stroke-width":i}}]}case"hexagons":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${a*.5} L ${e*.75} ${a} L ${e*.25} ${a} L 0 ${a*.5} Z`,fill:"none",stroke:t,"stroke-width":i}}]}case"diamonds":return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${e/2} L ${e/2} ${e} L 0 ${e/2} Z`,fill:"none",stroke:t,"stroke-width":i}}];case"circles":return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e/3,fill:"none",stroke:t,"stroke-width":i}}];case"bricks":{let a=r?.strokeWidth!=null?Math.max(.5,e*r.strokeWidth):Math.max(1,e/15);return[{tag:"rect",attrs:{x:0,y:0,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:-e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}}]}case"herringbone":return[{tag:"path",attrs:{d:`M 0 0 L ${e/2} ${e/2} L 0 ${e} M ${e/2} ${e/2} L ${e} 0 M ${e/2} ${e/2} L ${e} ${e}`,fill:"none",stroke:t,"stroke-width":i}}];default:return[]}}function Gr(n){let e=Object.entries(n.attrs).map(([t,r])=>` ${t}="${r}"`).join("");return`<${n.tag}${e}/>`}function Ve(n,e,t,r,i){let a=10*e,o="";o+=`<rect width="${a}" height="${a}" fill="${r}"/>`;let l=le(n,a,t,i);for(let u of l)o+=Gr(u);return{svgContent:o,width:a,height:a}}var ue="0 0 10 10",ze=6,We=6;function ce(){return[{id:"line-marker-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-open-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"context-stroke","stroke-width":1.5,"stroke-linejoin":"round","stroke-linecap":"round"}}},{id:"line-marker-circle",refX:5,refY:5,element:{tag:"circle",attrs:{cx:5,cy:5,r:3.2,fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-diamond",refX:5,refY:5,element:{tag:"path",attrs:{d:"M 5 0 L 10 5 L 5 10 L 0 5 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-square",refX:5,refY:5,element:{tag:"rect",attrs:{x:1.5,y:1.5,width:7,height:7,fill:"context-stroke",stroke:"context-stroke"}}}]}var Ct={"line-marker-arrow":"mkr-builtin-arrow","line-marker-open-arrow":"mkr-builtin-open-arrow","line-marker-circle":"mkr-builtin-circle","line-marker-diamond":"mkr-builtin-diamond","line-marker-square":"mkr-builtin-square"},Lr={"mkr-builtin-arrow":"Arrow","mkr-builtin-open-arrow":"Open Arrow","mkr-builtin-circle":"Circle","mkr-builtin-diamond":"Diamond","mkr-builtin-square":"Square"};function on(){return ce().map(n=>{let e=Ct[n.id]??n.id;return{id:e,name:Lr[e]??e,viewBox:ue,refX:n.refX,refY:n.refY,markerWidth:6,markerHeight:6,markerUnits:"strokeWidth",orient:"auto-start-reverse",shapes:[],builtIn:!0}})}function d(n,e){return e==null||e===""?"":` ${n}="${B(String(e))}"`}function K(n,e){let t=n.rawTransform;if(t)return t;let r=n.rotation??0,i=n.skewX??0,a=n.skewY??0,o=n.scaleX??1,l=n.scaleY??1;if(r===0&&i===0&&a===0&&o===1&&l===1)return null;let u=n.customPivot??e;if(!u)return null;let c=[];return c.push(`translate(${u.x}, ${u.y})`),r!==0&&c.push(`rotate(${r})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),i!==0&&c.push(`skewX(${i})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`),c.join(" ")}function Nr(n,e,t){let r=n.rotation??0,i=n.skewX??0,a=n.skewY??0,o=n.scaleX??1,l=n.scaleY??1,u=n.customPivot??{x:e,y:t},c=[];return(r!==0||i!==0||a!==0||o!==1||l!==1)&&(c.push(`translate(${u.x}, ${u.y})`),r!==0&&c.push(`rotate(${r})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),i!==0&&c.push(`skewX(${i})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`)),c.push(`translate(${e}, ${t})`),c.join(" ")}function Ur(n){if(typeof n=="string"){let r=n.trim();return r.length>0?r:void 0}if(!n||typeof n!="object")return;let e=n,t=[];return e.underline&&t.push("underline"),e.strikethrough&&t.push("line-through"),e.overline&&t.push("overline"),t.length>0?t.join(" "):void 0}function Vr(n){if(typeof n.strokeDasharray=="string")return n.strokeDasharray;let e=n.lineStyle??"solid",t=n.dashLength??8,r=n.gapLength??4;return re(e,t,r)}function cn(n){let e=n.fillType;return e||(n.fillGradient?n.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":n.linearGradient?"linear-gradient":n.radialGradient?"radial-gradient":"solid")}function zr(n){return n.fillGradient??n.linearGradient??n.radialGradient??void 0}function X(n,e){let t=d("data-shape-id",e),r=cn(n);r==="none"?t+=d("fill","none"):r==="linear-gradient"||r==="radial-gradient"?t+=d("fill",`url(#gradient-fill-${e})`):r==="pattern"?t+=d("fill",`url(#pattern-fill-${e})`):t+=d("fill",n.fillColor??"#000000");let i=n.opacity;i!==void 0&&i<1&&(t+=d("opacity",i));let a=n.fillOpacity;a!==void 0&&a<1&&(t+=d("fill-opacity",a));let o=n.fillRule;o&&o!=="nonzero"&&(t+=d("fill-rule",o));let l=n.strokeType??"solid";l==="none"?t+=d("stroke","none"):l==="linear-gradient"||l==="radial-gradient"?t+=d("stroke",`url(#gradient-stroke-${e})`):t+=d("stroke",n.borderColor??"none");let u=n.borderWidth;u!=null&&(t+=d("stroke-width",u));let c=n.strokeOpacity;c!==void 0&&c<1&&(t+=d("stroke-opacity",c));let m=n.paintOrder;m&&m!=="normal"&&(t+=d("paint-order",m));let p=n.markerStart,h=n.markerMid,g=n.markerEnd;p&&(t+=d("marker-start",`url(#${p})`)),h&&(t+=d("marker-mid",`url(#${h})`)),g&&(t+=d("marker-end",`url(#${g})`));let y=Vr(n);y&&(t+=d("stroke-dasharray",y),!n.strokeDasharray&&n.lineStyle==="dotted"&&(t+=d("stroke-linecap","round")));let f=n.dashOffset;f!==void 0&&f!==0&&(t+=d("stroke-dashoffset",f));let b=n.shapeRendering;b&&b!=="auto"&&(t+=d("shape-rendering",b)),t+=Ue(e,n.filters);let _=n.metadata;return _&&(_.role&&(t+=d("role",_.role)),_.ariaLabel&&(t+=d("aria-label",_.ariaLabel))),t}function Wr(n){let e=n.metadata;if(!e)return"";let t="";return e.title&&(t+=`<title>${B(e.title)}</title>`),e.description&&(t+=`<desc>${B(e.description)}</desc>`),t}function jr(n,e){let t=Wr(e);if(!t)return n;let r=n.lastIndexOf("/>");if(r===-1){let o=n.indexOf(">");return o===-1?n:n.slice(0,o+1)+t+n.slice(o+1)}let i=n.match(/^<(\w+)/),a=i?i[1]:"g";return n.slice(0,r)+">"+t+`</${a}>`}function At(n){let e="",t=n.startEndpoint,r=n.endEndpoint;return t&&t!=="none"&&(e+=d("marker-start",`url(#line-marker-${t})`)),r&&r!=="none"&&(e+=d("marker-end",`url(#line-marker-${r})`)),e}function Et(n){let e=n.state,t=e.x??0,r=e.y??0,i=e.radius??50,a=K(e,{x:t,y:r});return`<circle${d("cx",t)}${d("cy",r)}${d("r",i)}${X(e,n.id)}${a?d("transform",a):""}/>`}function Ft(n){let e=n.state,t=e.cx??0,r=e.cy??0,i=e.rx??50,a=e.ry??30,o=K(e,{x:t,y:r});return`<ellipse${d("cx",t)}${d("cy",r)}${d("rx",i)}${d("ry",a)}${X(e,n.id)}${o?d("transform",o):""}/>`}function It(n){let e=n.state,t=e,r=e.x??0,i=e.y??0,a=e.width??100,o=e.height??100,l=e.cornerRadius??0,u=t.cornerShape??"round",c=t.cornerMode??"uniform",m={x:r+a/2,y:i+o/2},p=K(e,m);if(u!=="round"||c==="non-uniform"){let h=Be(r,i,a,o,l,u,c,c==="non-uniform"?{radiusTL:t.cornerRadiusTL,radiusTR:t.cornerRadiusTR,radiusBR:t.cornerRadiusBR,radiusBL:t.cornerRadiusBL,shapeTL:t.cornerShapeTL,shapeTR:t.cornerShapeTR,shapeBR:t.cornerShapeBR,shapeBL:t.cornerShapeBL}:void 0);if(h)return`<path${d("d",h)}${X(e,n.id)}${p?d("transform",p):""}/>`}return`<rect${d("x",r)}${d("y",i)}${d("width",a)}${d("height",o)}${l>0?d("rx",l):""}${X(e,n.id)}${p?d("transform",p):""}/>`}function Ot(n){let e=n.state,t=e.x1??0,r=e.y1??0,i=e.x2??100,a=e.y2??100,o={x:(t+i)/2,y:(r+a)/2},l=K(e,o);return`<line${d("x1",t)}${d("y1",r)}${d("x2",i)}${d("y2",a)}${X(e,n.id)}${At(e)}${l?d("transform",l):""}/>`}function Dt(n){let e=n.state,t=e.x??0,r=e.y??0,i=e.text??"",a=e.fontSize??16,o=e.fontFamily??"sans-serif",l=e.fontWeight??"normal",u=e.fontStyle??"normal",c=e.textAnchor??"start",m=Ur(e.textDecoration),p=e.letterSpacing,g=K(e,{x:t,y:r}),y=d("x",t)+d("y",r);y+=d("font-size",a),y+=d("font-family",o),l!=="normal"&&(y+=d("font-weight",l)),u!=="normal"&&(y+=d("font-style",u)),c!=="start"&&(y+=d("text-anchor",c)),m&&(y+=d("text-decoration",m)),p&&(y+=d("letter-spacing",p));let f=e.textLength;f!==void 0&&f>0&&(y+=d("textLength",f),e.lengthAdjust==="spacingAndGlyphs"&&(y+=d("lengthAdjust","spacingAndGlyphs")));let b=e.textDirection;b&&b!=="ltr"&&(y+=d("direction",b));let _=e.unicodeBidi;_&&_!=="normal"&&(y+=d("unicode-bidi",_));let k=e.fontVariationSettings;if(k&&Object.keys(k).length>0){let T=Object.entries(k).map(([R,A])=>`'${R}' ${A}`).join(", ");y+=d("style",`font-variation-settings: ${T}`)}if(y+=X(e,n.id),g&&(y+=d("transform",g)),e.isTextPath&&e.textPathPoints){let T=e.textPathPoints,R=e.textPathStartOffset??0,A=e.textPathSide,$=`text-path-${n.id}`,x="";if(T.length>=2)if(A==="right"){let v=T[T.length-1];x=`M ${v.x} ${v.y}`;for(let F=T.length-1;F>0;F--){let M=T[F],C=T[F-1],O=M.handleIn??M,I=C.handleOut??C;x+=` C ${O.x} ${O.y}, ${I.x} ${I.y}, ${C.x} ${C.y}`}}else{x=`M ${T[0].x} ${T[0].y}`;for(let v=0;v<T.length-1;v++){let F=T[v],M=T[v+1],C=F.handleOut??F,O=M.handleIn??M;x+=` C ${C.x} ${C.y}, ${O.x} ${O.y}, ${M.x} ${M.y}`}}return`<defs><path id="${B($)}"${d("d",x)} fill="none"/></defs><text${y}><textPath href="#${B($)}"${d("startOffset",`${R}%`)}>${B(i)}</textPath></text>`}if(e.charOffsets&&Array.isArray(e.charOffsets)&&e.charOffsets.length>0){let T=Array.from(i),R=0,A=0,$="";for(let x=0;x<T.length;x++){let v=e.charOffsets[x]??{x:0,y:0,rotate:0},F=v.x-R,M=v.y-A,C=d("dx",F)+d("dy",M);v.rotate!==0&&(C+=d("rotate",v.rotate)),$+=`<tspan${C}>${B(T[x])}</tspan>`,R=v.x,A=v.y}return`<text${y}>${$}</text>`}if(e.richTextData&&typeof e.richTextData=="object"){let T=e.richTextData;if(Array.isArray(T.lines)&&T.lines.length>0){let R=e.linePositions,A=typeof T.lineHeight=="number"?T.lineHeight:1.2,$=a*A,x=T.baseStyle??{},v="";return T.lines.forEach((F,M)=>{F.segments.forEach((C,O)=>{let I="";if(O===0){let D=R?.[M];D?((Math.abs(D.x)>.001||M>0)&&(I+=d("x",t+D.x)),(Math.abs(D.dy)>.001||M>0)&&(I+=d("dy",D.dy))):M>0&&(I+=d("x",t),I+=d("dy",`${$}px`))}I+=Hr(C.style??{},x),I+=' xml:space="preserve"',v+=`<tspan${I}>${B(C.text)}</tspan>`})}),`<text${y}>${v}</text>`}}return`<text${y}>${B(i)}</text>`}function Hr(n,e){let t="";n.fontFamily!==void 0&&n.fontFamily!==e.fontFamily&&(t+=d("font-family",String(n.fontFamily))),n.fontSize!==void 0&&n.fontSize!==e.fontSize&&(t+=d("font-size",String(n.fontSize))),n.fontWeight!==void 0&&n.fontWeight!==e.fontWeight&&(t+=d("font-weight",String(n.fontWeight))),n.fontStyle!==void 0&&n.fontStyle!==e.fontStyle&&(t+=d("font-style",String(n.fontStyle)));let r=n.textDecoration,i=e.textDecoration;if(r&&(!i||r.underline!==i.underline||r.strikethrough!==i.strikethrough||r.overline!==i.overline)){let o=[];r.underline&&o.push("underline"),r.strikethrough&&o.push("line-through"),r.overline&&o.push("overline"),o.length>0&&(t+=d("text-decoration",o.join(" ")))}if(n.baselineShift!==void 0&&n.baselineShift!==e.baselineShift){let a=n.baselineShift;a==="super"||a==="sub"?t+=d("baseline-shift",a):typeof a=="number"&&(t+=d("baseline-shift",`${a}px`))}return n.letterSpacing!==void 0&&n.letterSpacing!==e.letterSpacing&&(t+=d("letter-spacing",String(n.letterSpacing))),n.fill!==void 0&&n.fill!==e.fill&&(t+=d("fill",String(n.fill))),n.fillOpacity!==void 0&&n.fillOpacity!==e.fillOpacity&&(t+=d("fill-opacity",String(n.fillOpacity))),n.direction!==void 0&&n.direction!==e.direction&&(t+=d("direction",String(n.direction))),n.unicodeBidi!==void 0&&n.unicodeBidi!==e.unicodeBidi&&(t+=d("unicode-bidi",String(n.unicodeBidi))),t}function Bt(n){let e=n.state,t=e.splinePoints??[],r=e.splineCurveType??"CUBIC",i=e.splineClosed??!1,a=e.splineTension??.5,o=e.splineArcParams,l=Ge(t,r,i,a,o),u=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,c=u?K(e,u):null;return`<path${d("d",l)}${X(e,n.id)}${At(e)}${c?d("transform",c):""}/>`}function Gt(n){let e=n.state,t=e.polylinePoints??[],r=e.polylineClosed??!1,i=t.map(u=>`${u.x},${u.y}`).join(" "),a=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,o=a?K(e,a):null;return`<${r?"polygon":"polyline"}${d("points",i)}${X(e,n.id)}${At(e)}${o?d("transform",o):""}/>`}function Lt(n){let e=n.state,t=e.x??0,r=e.y??0,i=e.width??100,a=e.height??100,o=e.href??"",l=e.imageOpacity,u=e.preserveAspectRatio?"xMidYMid meet":"none",c={x:t+i/2,y:r+a/2},m=K(e,c);return`<image${d("x",t)}${d("y",r)}${d("width",i)}${d("height",a)}${d("href",o)}${d("preserveAspectRatio",u)}${l!==void 0&&l<1?d("opacity",l):""}${X(e,n.id)}${m?d("transform",m):""}/>`}function Nt(n){let e=n.state,t=e.cx??0,r=e.cy??0,i=e.radius??50,a=e.cornerRadius??0,o=e.shiftAngle??-90,l=e.fillRule??"nonzero",u=Nr(e,t,r),c="";switch(n.type){case"triangle":c=V(oe(3,i,o),a,i);break;case"ngon":{let p=e.sides??6;c=V(oe(p,i,o),a,i);break}case"star":{let p=e.arms??5,h=e.innerRadiusPercent??50;c=V(Pe(p,i,h,o),a,i);break}case"cross":{let p=e.armWidthPercent??40;c=V(Me(i,p,o),a,i);break}case"ring":{let p=e.innerRadiusPercent??50;c=Ie(i,p,l);break}case"spiral":{let p=e.turns??3,h=e.thicknessPercent??20,g=e.spiralDirection??1;c=Oe(i,p,h,g,o);break}case"gear":{let p=e.teeth??8,h=e.toothDepthPercent??30,g=e.holeRadiusPercent??0;c=De(p,i,h,a,g,l,o);break}case"arrow":{let p=e.headWidthPercent??100,h=e.headLengthPercent??30,g=e.shaftWidthPercent??40;c=V(Re(i,p,h,g,o),a,i);break}case"speechBubble":{let p=e.tailAngleDeg??45,h=e.tailLengthPercent??40,g=e.tailWidthPercent??25;c=V(Ce(i,p,h,g,o),a,i);break}case"lightning":{let p=e.boltSegments??3,h=e.boltJaggednessPercent??40,g=e.boltWidthPercent??30;c=V(Ae(i,p,h,g,o),a,i);break}case"heart":{let p=e.lobeRadiusPercent??50,h=e.cleftDepthPercent??25;c=Ee(i,p,h,o);break}case"cloud":{let p=e.cloudBumps??5,h=e.cloudPuffinessPercent??60;c=Fe(i,p,h,o);break}default:return`<!-- unsupported polygon shape: ${B(n.type)} -->`}let m="";return(n.type==="ring"||n.type==="gear")&&(m=d("fill-rule",l)),`<path${d("d",c)}${m}${X(e,n.id)}${d("transform",u)}/>`}function G(n){let e;switch(n.type){case"circle":e=Et(n);break;case"ellipse":e=Ft(n);break;case"rectangle":case"square":e=It(n);break;case"line":e=Ot(n);break;case"text":e=Dt(n);break;case"spline":e=Bt(n);break;case"polyline":e=Gt(n);break;case"image":e=Lt(n);break;case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":case"speechBubble":case"lightning":case"heart":case"cloud":e=Nt(n);break;default:return`<!-- unsupported shape type: ${B(n.type)} -->`}return jr(e,n.state)}function Z(n){let e="";for(let t of n){let r=t.state,i=cn(r),a=zr(r),o=r.strokeType??"solid";i==="linear-gradient"&&a&&(e+=ln(`gradient-fill-${t.id}`,a)),i==="radial-gradient"&&a&&(e+=un(`gradient-fill-${t.id}`,a)),i==="pattern"&&a&&(e+=Xr(`pattern-fill-${t.id}`,a)),o==="linear-gradient"&&r.strokeGradient&&(e+=ln(`gradient-stroke-${t.id}`,r.strokeGradient)),o==="radial-gradient"&&r.strokeGradient&&(e+=un(`gradient-stroke-${t.id}`,r.strokeGradient))}return e}function ln(n,e){let t=(e.stops??[]).map(r=>{let i=`<stop${d("offset",`${r.offset*100}%`)}${d("stop-color",r.color)}`;return r.opacity!==void 0&&r.opacity<1&&(i+=d("stop-opacity",r.opacity)),i+="/>",i}).join("");return`<linearGradient${d("id",n)}${d("x1",`${e.x1*100}%`)}${d("y1",`${e.y1*100}%`)}${d("x2",`${e.x2*100}%`)}${d("y2",`${e.y2*100}%`)}${e.spreadMethod?d("spreadMethod",e.spreadMethod):""}>${t}</linearGradient>`}function un(n,e){let t=(e.stops??[]).map(o=>{let l=`<stop${d("offset",`${o.offset*100}%`)}${d("stop-color",o.color)}`;return o.opacity!==void 0&&o.opacity<1&&(l+=d("stop-opacity",o.opacity)),l+="/>",l}).join(""),r="",i=e.ry!==void 0&&e.ry!==e.r,a=!!e.rotation;if(i||a){let o=e.cx??.5,l=e.cy??.5,u=[];u.push(`translate(${o}, ${l})`),a&&u.push(`rotate(${e.rotation})`),i&&e.ry!==0&&u.push(`scale(1, ${e.ry/e.r})`),u.push(`translate(-${o}, -${l})`),r=d("gradientTransform",u.join(" "))}return`<radialGradient${d("id",n)}${d("cx",`${e.cx*100}%`)}${d("cy",`${e.cy*100}%`)}${d("fx",`${e.fx*100}%`)}${d("fy",`${e.fy*100}%`)}${d("r",`${e.r*100}%`)}${e.spreadMethod?d("spreadMethod",e.spreadMethod):""}${r}>${t}</radialGradient>`}function Xr(n,e){if(e.svgContent!=null){let l=e.width??10,u=e.height??10,c=e.patternUnits??"userSpaceOnUse",m=e.patternContentUnits,p=e.patternTransform,h=e.viewBox,g=e.preserveAspectRatio,y=e.x??0,f=e.y??0,b=`<pattern${d("id",n)}`;return b+=d("patternUnits",c),m&&(b+=d("patternContentUnits",m)),y&&(b+=d("x",y)),f&&(b+=d("y",f)),b+=d("width",l),b+=d("height",u),h&&(b+=d("viewBox",h)),g&&(b+=d("preserveAspectRatio",g)),p&&(b+=d("patternTransform",p)),b+=`>${e.svgContent}</pattern>`,b}let t=10*(e.scale??1),r=e.rotation??0,i=e.color||"#000000",a=e.backgroundColor||"#ffffff",o="";return o+=`<rect${d("width",t)}${d("height",t)}${d("fill",a)}/>`,o+=Yr(e.patternType,t,i),`<pattern${d("id",n)}${d("patternUnits","userSpaceOnUse")}${d("width",t)}${d("height",t)}${r?d("patternTransform",`rotate(${r})`):""}>${o}</pattern>`}function Yr(n,e,t){return le(n,e,t).map(i=>{let a=Object.entries(i.attrs).map(([o,l])=>d(o,l)).join("");return`<${i.tag}${a}/>`}).join("")}function Q(n,e){let t=new Set,r=new Set;for(let o of n){let l=o.state;l.markerStart&&t.add(l.markerStart),l.markerMid&&t.add(l.markerMid),l.markerEnd&&t.add(l.markerEnd);let u=l.startEndpoint,c=l.endEndpoint;u&&u!=="none"&&r.add(u),c&&c!=="none"&&r.add(c)}if(t.size===0&&r.size===0)return"";let i="",a=ce();for(let o of a){let l=o.id,u=l.replace("line-marker-",""),c=`mkr-builtin-${u}`,m=r.has(u)||t.has(l),p=t.has(c);if(!m&&!p)continue;let h=o.element,g=Object.entries(h.attrs).map(([b,_])=>d(b,_)).join(""),y=`<${h.tag}${g}/>`,f=b=>{i+=`<marker${d("id",b)}${d("viewBox",ue)}${d("refX",o.refX)}${d("refY",o.refY)}${d("markerWidth",6)}${d("markerHeight",6)}${d("orient","auto-start-reverse")}>${y}</marker>`};m&&f(l),p&&f(c)}if(e)for(let o of e){if(o.builtIn||!t.has(o.id))continue;let l="";for(let u of o.shapes)l+=G(u);i+=`<marker${d("id",o.id)}${d("viewBox",o.viewBox)}${d("refX",o.refX)}${d("refY",o.refY)}${d("markerWidth",o.markerWidth)}${d("markerHeight",o.markerHeight)}${d("markerUnits",o.markerUnits)}${d("orient",String(o.orient))}>${l}</marker>`}return i}var qr={x:"x",y:"y",cx:"cx",cy:"cy",x1:"x1",y1:"y1",x2:"x2",y2:"y2",posX:"x",posY:"y",radius:"r",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",opacity:"opacity",fillOpacity:"fill-opacity",strokeOpacity:"stroke-opacity",fillColor:"fill",strokeColor:"stroke",strokeWidth:"stroke-width",borderWidth:"stroke-width",cornerRadius:"rx",fontSize:"font-size"},Kr=new Set(["rotation","skewX","skewY"]);function Zr(n){let t=me[n];return t?t.join(" "):"0 0 1 1"}function je(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Ut(n){return n.cycleDuration!==void 0&&n.cycleDuration>0?n.cycleDuration:n.keyframes.length===0?0:n.keyframes[n.keyframes.length-1].time}function Vt(n,e){let t=n.keyframes;if(t.length===0)return{values:[],keyTimes:[],keySplines:[]};let r=t.map(o=>String(o.value)),i=t.map(o=>e>0?(o.time/e).toFixed(4):"0"),a=[];for(let o=1;o<t.length;o++)a.push(Zr(t[o].easing));return{values:r,keyTimes:i,keySplines:a}}function zt(n){let e=n.beginTrigger;if(!e)return"0s";switch(e.type){case"time":return`${e.value}s`;case"event":return e.value;default:return"0s"}}function Wt(n){return n.cycleInfinite?"indefinite":n.cycleRepeats&&n.cycleRepeats>1?String(n.cycleRepeats):null}function Qr(n){let e=qr[n.property];if(!e)return"";let t=Ut(n);if(t<=0)return"";let{values:r,keyTimes:i,keySplines:a}=Vt(n,t);if(r.length<2)return"";let o=`<animate attributeName="${je(e)}"`;o+=` values="${je(r.join(";"))}"`,o+=` keyTimes="${i.join(";")}"`,a.length>0&&a.some(u=>u!=="0 0 1 1")&&(o+=' calcMode="spline"',o+=` keySplines="${a.join(";")}"`),o+=` dur="${t}s"`,o+=` begin="${zt(n)}"`;let l=Wt(n);return l&&(o+=` repeatCount="${l}"`),o+=' fill="freeze"',o+="/>",o}function Jr(n){let e;switch(n.property){case"rotation":e="rotate";break;case"skewX":e="skewX";break;case"skewY":e="skewY";break;default:return""}let t=Ut(n);if(t<=0)return"";let{values:r,keyTimes:i,keySplines:a}=Vt(n,t);if(r.length<2)return"";let o=e==="rotate"&&n.transformOrigin?r.map(c=>`${c} ${n.transformOrigin.x} ${n.transformOrigin.y}`):r,l='<animateTransform attributeName="transform"';l+=` type="${e}"`,l+=` values="${je(o.join(";"))}"`,l+=` keyTimes="${i.join(";")}"`,a.length>0&&a.some(c=>c!=="0 0 1 1")&&(l+=' calcMode="spline"',l+=` keySplines="${a.join(";")}"`),l+=` dur="${t}s"`,l+=` begin="${zt(n)}"`;let u=Wt(n);return u&&(l+=` repeatCount="${u}"`),l+=` additive="${n.additive??"sum"}"`,l+=' fill="freeze"',l+="/>",l}function ei(n){if(!n.motionPath)return"";let e=Ut(n);if(e<=0)return"";let{keyTimes:t,keySplines:r}=Vt(n,e),i=n.keyframes.map(u=>{let c=typeof u.value=="number"?u.value:parseFloat(u.value);return Math.max(0,Math.min(1,c))}),a="<animateMotion";a+=` path="${je(n.motionPath)}"`,a+=` keyTimes="${t.join(";")}"`,a+=` keyPoints="${i.join(";")}"`,r.length>0&&r.some(u=>u!=="0 0 1 1")&&(a+=' calcMode="spline"',a+=` keySplines="${r.join(";")}"`),a+=` dur="${e}s"`,a+=` begin="${zt(n)}"`;let o=Wt(n);o&&(a+=` repeatCount="${o}"`),a+=' fill="freeze"';let l=n.motionRotate??"auto";return a+=` rotate="${l}"`,a+="/>",a}function He(n){let e=new Map;for(let t of n.tracks){if(!t.enabled||t.keyframes.length<2)continue;let r=[...t.keyframes].sort((o,l)=>o.time-l.time),i={...t,locked:t.locked??!1,keyframes:r.map(o=>({time:o.time,value:o.value,easing:o.easing}))},a="";if(t.property==="pathMotion"&&t.motionPath?a=ei(i):Kr.has(t.property)?a=Jr(i):a=Qr(i),a){let o=e.get(t.shapeId)??[];o.push(a),e.set(t.shapeId,o)}}return e}function ie(n,e={}){let{xmlDeclaration:t=!0,backgroundColor:r,indent:i=!0,className:a}=e,o=n.viewboxes?.[0],l=e.width??o?.width??800,u=e.height??o?.height??600,c=e.viewBox??`0 0 ${l} ${u}`,m=i?`
|
|
7
|
-
`:"",
|
|
8
|
-
`)}function Ke(
|
|
9
|
-
`)}var
|
|
10
|
-
`)}function
|
|
11
|
-
${
|
|
6
|
+
${l}`)}}return a}function tn(r){return[...r].sort((e,t)=>e.id.localeCompare(t.id))}function ne(r){if(r==null)return r;if(Array.isArray(r))return r.map(ne);if(typeof r!="object")return r;let e={},t=Object.keys(r).sort();for(let n of t)e[n]=ne(r[n]);return e}function rn(r){let e={};return e.id=r.id,e.type=r.type,e.state=ne(r.state),e}var N=/\{\{\s*([\w.\-]+)\s*\}\}/g;function Se(r,e){return r.replace(N,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}function we(r,e={}){let t={};if(r.templateVariables)for(let i of r.templateVariables)i.defaultValue!==void 0&&i.defaultValue!==""&&(t[i.name]=i.defaultValue);if(Object.assign(t,e),Object.keys(t).length===0)return JSON.parse(JSON.stringify(r));let n=JSON.parse(JSON.stringify(r));for(let i of n.shapes)_e(i.state,t);if(n.documentMetadata){let i=n.documentMetadata;_e(i,t)}return n}function _e(r,e){for(let t of Object.keys(r)){let n=r[t];if(typeof n=="string"){if(N.lastIndex=0,N.test(n)){N.lastIndex=0;let i=Se(n,e);if(nn(n)){let a=Number(i);if(!isNaN(a)&&an(t)){r[t]=a;continue}}r[t]=i}}else if(Array.isArray(n))for(let i=0;i<n.length;i++)typeof n[i]=="string"?(N.lastIndex=0,N.test(n[i])&&(N.lastIndex=0,n[i]=Se(n[i],e))):n[i]!==null&&typeof n[i]=="object"&&_e(n[i],e);else n!==null&&typeof n=="object"&&_e(n,e)}}function nn(r){return/^\s*\{\{\s*[\w.\-]+\s*\}\}\s*$/.test(r)}var sn=new Set(["x","y","width","height","radius","rx","ry","cx","cy","x1","y1","x2","y2","fontSize","borderWidth","cornerRadius","opacity","fillOpacity","strokeOpacity","rotation","skewX","skewY","scaleX","scaleY","letterSpacing","wordSpacing","lineHeight","sides","arms","innerRadiusPercent","armWidthPercent","teeth","toothDepthPercent","holeRadiusPercent","turns","thicknessPercent","direction","headWidthPercent","headLengthPercent","shaftWidthPercent","shiftAngle","dashLength","gapLength","textPathStartOffset","imageOpacity"]);function an(r){return sn.has(r)}function Te(r){let e=r.templateVariables??[],t=new Set(e.map(a=>a.name)),n=new Set;for(let a of r.shapes)ke(a.state,n);r.documentMetadata&&ke(r.documentMetadata,n);let i=[...n].filter(a=>!t.has(a)).sort();return{defined:[...e],undeclared:i}}function ke(r,e){for(let t of Object.values(r))if(typeof t=="string"){let n;for(N.lastIndex=0;(n=N.exec(t))!==null;)e.add(n[1])}else if(Array.isArray(t))for(let n of t)if(typeof n=="string"){let i;for(N.lastIndex=0;(i=N.exec(n))!==null;)e.add(i[1])}else n!==null&&typeof n=="object"&&ke(n,e);else t!==null&&typeof t=="object"&&ke(t,e)}function or(r){let e={};for(let t of r){let n=t.indexOf("=");if(n===-1)throw new Error(`Invalid variable format: "${t}". Expected "name=value".`);let i=t.slice(0,n).trim(),a=t.slice(n+1);if(!i)throw new Error(`Invalid variable format: "${t}". Variable name cannot be empty.`);e[i]=a}return e}var lr=3,ur=12;function cr(r){return r==null||!Number.isFinite(r)?3:r<0?0:r>12?12:Math.floor(r)}function ve(r,e){if(!Number.isFinite(r))return r;let t=Math.pow(10,e);return Math.round(r*t)/t}var on=/-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?/g;function Pt(r,e){return r.replace(on,t=>{let n=parseFloat(t);return Number.isFinite(n)?String(ve(n,e)):t})}var ln=new Set(["rawTransform","strokeDasharray","filterX","filterY","filterWidth","filterHeight","cssClipPath"]),un=new Set(["metadata","customMetadata","customAttrs","customData","bindings","richTextData","cssMaskProperties","rawMetadata"]);function j(r,e,t){if(e==null)return e;if(typeof e=="number")return ve(e,t);if(typeof e=="string")return ln.has(r)?Pt(e,t):e;if(typeof e=="boolean")return e;if(Array.isArray(e))return e.map(n=>j(r,n,t));if(typeof e=="object"){if(un.has(r))return e;if(r==="symbolOverrides"){let i={};for(let[a,o]of Object.entries(e))i[a]=j("state",o,t);return i}let n={};for(let[i,a]of Object.entries(e))n[i]=j(i,a,t);return n}return e}function Pe(r,e){return{id:r.id,type:r.type,state:j("state",r.state,e)}}function dr(r,e){let t={...r,shapes:r.shapes.map(n=>Pe(n,e)),viewboxes:r.viewboxes.map(n=>j("viewbox",n,e))};return r.guides&&(t.guides=r.guides.map(n=>j("guide",n,e))),r.measurements&&(t.measurements=r.measurements.map(n=>j("measurement",n,e))),r.animationTimeline&&(t.animationTimeline=j("animationTimeline",r.animationTimeline,e)),r.symbols&&(t.symbols=r.symbols.map(n=>({...n,shapes:n.shapes.map(i=>Pe(i,e))}))),r.markers&&(t.markers=r.markers.map(n=>j("marker",n,e))),r.customPatterns&&(t.customPatterns=r.customPatterns.map(n=>j("customPattern",n,e))),t}function le(r,e,t=-90){let n=[],i=t*Math.PI/180;for(let a=0;a<r;a++){let o=i+a*2*Math.PI/r;n.push({x:e*Math.cos(o),y:e*Math.sin(o)})}return n}function Re(r,e,t,n=-90){let i=[],a=e*(t/100),o=n*Math.PI/180;for(let l=0;l<r*2;l++){let u=o+l*Math.PI/r,c=l%2===0?e:a;i.push({x:c*Math.cos(u),y:c*Math.sin(u)})}return i}function Ae(r,e,t=0){let n=r*(e/100)/2,i=[{x:-n,y:-r},{x:n,y:-r},{x:n,y:-n},{x:r,y:-n},{x:r,y:n},{x:n,y:n},{x:n,y:r},{x:-n,y:r},{x:-n,y:n},{x:-r,y:n},{x:-r,y:-n},{x:-n,y:-n}];if(t===0)return i;let a=Math.cos(t*Math.PI/180),o=Math.sin(t*Math.PI/180);return i.map(l=>({x:l.x*a-l.y*o,y:l.x*o+l.y*a}))}function Ce(r,e,t,n,i=-90){let o=r*2*(t/100),l=r*(e/100),u=l*(n/100),c=[{x:r,y:0},{x:r-o,y:-l/2},{x:r-o,y:-u/2},{x:-r,y:-u/2},{x:-r,y:u/2},{x:r-o,y:u/2},{x:r-o,y:l/2}];if(i===0)return c;let h=Math.cos(i*Math.PI/180),d=Math.sin(i*Math.PI/180);return c.map(m=>({x:m.x*h-m.y*d,y:m.x*d+m.y*h}))}function Ie(r,e,t,n,i=0){let a=r,o=a*(t/100),l=a*(n/100),u=l/2,c=e*Math.PI/180,h=Math.cos(c),d=Math.sin(c),m=Math.abs(h),p=Math.abs(d),y=Math.max(m,p)||1,g={x:h*(a/y),y:d*(a/y)},$={x:g.x+h*o,y:g.y+d*o},w=Math.min(l,a-u),x=-a+u+w,S=a-u-w,_={x:-a,y:-a},A={x:a,y:-a},C={x:a,y:a},b={x:-a,y:a},k;if(m>=p&&h>0){let P=Math.max(x,Math.min(S,g.y)),R={x:a,y:P-u},F={x:a,y:P+u};k=[_,A,R,$,F,C,b]}else if(m>=p&&h<=0){let P=Math.max(x,Math.min(S,g.y)),R={x:-a,y:P+u},F={x:-a,y:P-u};k=[_,A,C,b,R,$,F]}else if(d<0){let P=Math.max(x,Math.min(S,g.x)),R={x:P-u,y:-a},F={x:P+u,y:-a};k=[_,R,$,F,A,C,b]}else{let P=Math.max(x,Math.min(S,g.x)),R={x:P+u,y:a},F={x:P-u,y:a};k=[_,A,C,R,$,F,b]}if(i===0)return k;let v=Math.cos(i*Math.PI/180),L=Math.sin(i*Math.PI/180);return k.map(P=>({x:P.x*v-P.y*L,y:P.x*L+P.y*v}))}function Ee(r,e,t,n,i=0){let a=Math.max(2,Math.round(e)),o=r*(t/100),l=r*(n/100)/2,u=a+1,c=[];for(let g=0;g<u;g++){let $=g/(u-1),w=-r+$*2*r,x=0;g>0&&g<u-1&&(x=g%2===1?o:-o),c.push({x,y:w})}let h=[],d=[];for(let g=0;g<u;g++){if(g===0||g===u-1){h.push({...c[g]}),d.push({...c[g]});continue}let $=c[g-1],w=c[g],x=c[g+1],S=w.x-$.x,_=w.y-$.y,A=Math.hypot(S,_)||1,C=S/A,b=_/A,k=x.x-w.x,v=x.y-w.y,L=Math.hypot(k,v)||1,P=k/L,R=v/L,F=(C+P)/2,I=(b+R)/2,O=Math.hypot(F,I),M,z;O<1e-6?(M=-b,z=C):(M=-I/O,z=F/O),h.push({x:w.x-M*l,y:w.y-z*l}),d.push({x:w.x+M*l,y:w.y+z*l})}let m=[];m.push(h[0]);for(let g=1;g<u-1;g++)m.push(d[g]);m.push(h[u-1]);for(let g=u-2;g>=1;g--)m.push(h[g]);if(i===0)return m;let p=Math.cos(i*Math.PI/180),y=Math.sin(i*Math.PI/180);return m.map(g=>({x:g.x*p-g.y*y,y:g.x*y+g.y*p}))}function Fe(r,e,t,n=0){let i=r,a=Math.max(.3,Math.min(.9,e/100)),o=-i*(t/100),l={x:0,y:i},u={x:0,y:o},c={x:-i*a,y:i*.4},h={x:-i*a,y:-i},d={x:i*a,y:-i},m={x:i*a,y:i*.4},p=[l,c,h,u,d,m,l],y=n===0?p:(()=>{let A=Math.cos(n*Math.PI/180),C=Math.sin(n*Math.PI/180);return p.map(b=>({x:b.x*A-b.y*C,y:b.x*C+b.y*A}))})(),[g,$,w,x,S,_]=y;return`M ${g.x} ${g.y} C ${$.x} ${$.y} ${w.x} ${w.y} ${x.x} ${x.y} C ${S.x} ${S.y} ${_.x} ${_.y} ${g.x} ${g.y} Z`}function Le(r,e,t,n=0){let i=Math.max(3,Math.round(e)),a=Math.max(.3,Math.min(1,t/100)),o=r,l=o*1.7,u=o*1.15,c=[];for(let b=0;b<i;b++){let v=(90+b/i*360)*Math.PI/180;c.push({x:l/2*Math.cos(v),y:-(u/2)*Math.sin(v)})}let h=.15,d=0;for(let b=0;b<i;b++){let k=c[b],v=c[(b+1)%i];d=Math.max(d,Math.hypot(v.x-k.x,v.y-k.y))}let m=d/(2*(1-h))+.001,p=Math.max(m,d*(.68+a*.35)),y=c.map(b=>{let k=b.y/(u/2);return p*(1-h*k)});function g(b){let k=c[b],v=c[(b+1)%i],L=y[b],P=y[(b+1)%i],R=v.x-k.x,F=v.y-k.y,I=Math.hypot(R,F)||1,O=(L*L-P*P+I*I)/(2*I),M=Math.sqrt(Math.max(0,L*L-O*O)),z=k.x+O/I*R,Q=k.y+O/I*F,J=-F/I,xt=R/I,ee={x:z+J*M,y:Q+xt*M},K={x:z-J*M,y:Q-xt*M};return ee.x*ee.x+ee.y*ee.y>K.x*K.x+K.y*K.y?ee:K}let $=[];for(let b=0;b<i;b++)$.push(g(b));let w=14,x=[];for(let b=0;b<i;b++){let k=c[b],v=y[b],L=$[(b-1+i)%i],P=$[b],R=Math.atan2(L.y-k.y,L.x-k.x),I=Math.atan2(P.y-k.y,P.x-k.x)-R;I<=0&&(I+=2*Math.PI);let O=2*Math.PI-I,M=R+I/2,z=R-O/2,Q={x:k.x+v*Math.cos(M),y:k.y+v*Math.sin(M)},J={x:k.x+v*Math.cos(z),y:k.y+v*Math.sin(z)},ee=Q.x*Q.x+Q.y*Q.y>J.x*J.x+J.y*J.y?I:-O;for(let K=0;K<w;K++){let Er=K/w,nr=R+Er*ee;x.push({x:k.x+v*Math.cos(nr),y:k.y+v*Math.sin(nr)})}}let S=0;for(let b of x){let k=Math.max(Math.abs(b.x),Math.abs(b.y));k>S&&(S=k)}if(S>0&&S!==o){let b=o/S;for(let k of x)k.x*=b,k.y*=b}let _=b=>{if(n===0)return b;let k=Math.cos(n*Math.PI/180),v=Math.sin(n*Math.PI/180);return{x:b.x*k-b.y*v,y:b.x*v+b.y*k}},A=x.map(_),C=`M ${A[0].x} ${A[0].y}`;for(let b=1;b<A.length;b++)C+=` L ${A[b].x} ${A[b].y}`;return C+=" Z",C}function V(r,e=0,t=0){if(r.length<3)return"";if(e<=0)return r.map((a,o)=>(o===0?"M":"L")+`${a.x},${a.y}`).join(" ")+" Z";let n=Math.min(e,t*.4),i="";for(let a=0;a<r.length;a++){let o=r[(a-1+r.length)%r.length],l=r[a],u=r[(a+1)%r.length],c={x:o.x-l.x,y:o.y-l.y},h=Math.hypot(c.x,c.y);c.x/=h,c.y/=h;let d={x:u.x-l.x,y:u.y-l.y},m=Math.hypot(d.x,d.y);d.x/=m,d.y/=m;let p=Math.min(n,h/2),y=Math.min(n,m/2),g={x:l.x+c.x*p,y:l.y+c.y*p},$={x:l.x+d.x*y,y:l.y+d.y*y};i+=a===0?`M${g.x},${g.y}`:` L${g.x},${g.y}`,i+=` Q${l.x},${l.y} ${$.x},${$.y}`}return i+" Z"}function De(r,e,t="evenodd"){let n=r*(e/100),i=t==="nonzero"?1:0;return`M ${r} 0 A ${r} ${r} 0 1 1 ${-r} 0 A ${r} ${r} 0 1 1 ${r} 0 Z M ${n} 0 A ${n} ${n} 0 1 ${i} ${-n} 0 A ${n} ${n} 0 1 ${i} ${n} 0 Z`}function Oe(r,e,t,n=1,i=0){let a=r*(t/100),l=Math.round(e*36),u=e*2*Math.PI,c=(r-a/2)/u,h=i*Math.PI/180,d=[],m=[];for(let g=0;g<=l;g++){let $=g/l,w=$*u*n+h,x=c*($*u)+a/2,S=a/2;d.push({x:(x+S*.3)*Math.cos(w),y:(x+S*.3)*Math.sin(w)}),m.push({x:Math.max(0,x-S*.3)*Math.cos(w),y:Math.max(0,x-S*.3)*Math.sin(w)})}let p=`M ${d[0].x} ${d[0].y}`;for(let g=1;g<d.length;g++)p+=` L ${d[g].x} ${d[g].y}`;let y=m[m.length-1];p+=` L ${y.x} ${y.y}`;for(let g=m.length-2;g>=0;g--)p+=` L ${m[g].x} ${m[g].y}`;return p+=" Z",p}var cn=.2;function Rt(r,e,t,n=0){let i=e*(t/100),a=e,o=e-i,l=2*Math.PI/r,u=l*cn/2,c=l/4,h=n*Math.PI/180,d=[];for(let m=0;m<r;m++){let p=h+m*l;d.push({x:o*Math.cos(p),y:o*Math.sin(p)}),d.push({x:a*Math.cos(p+c-u),y:a*Math.sin(p+c-u)}),d.push({x:a*Math.cos(p+c+u),y:a*Math.sin(p+c+u)}),d.push({x:o*Math.cos(p+l/2),y:o*Math.sin(p+l/2)})}return d}function Ge(r,e,t,n=0,i=0,a="evenodd",o=0){let l=Rt(r,e,t,o),u=Math.min(n,e*.1),c=V(l,u,e);if(i>0){let h=e*(i/100),d=a==="nonzero"?1:0;c+=` M ${h} 0 A ${h} ${h} 0 1 ${d} ${-h} 0 A ${h} ${h} 0 1 ${d} ${h} 0 Z`}return c}function Be(r,e,t,n,i,a="round",o="uniform",l){let u=Math.min(t,n)/2,c,h,d,m,p,y,g,$;if(o==="non-uniform"&&l?(c=Math.min(l.radiusTL??i,u),h=Math.min(l.radiusTR??i,u),d=Math.min(l.radiusBR??i,u),m=Math.min(l.radiusBL??i,u),p=l.shapeTL??a,y=l.shapeTR??a,g=l.shapeBR??a,$=l.shapeBL??a):(c=h=d=m=Math.min(i,u),p=y=g=$=a),!(a!=="round"||o==="non-uniform"||c>0&&p!=="round"||h>0&&y!=="round"||d>0&&g!=="round"||m>0&&$!=="round")&&c===h&&h===d&&d===m)return null;let x=`M${r+c},${e}`;return x+=` L${r+t-h},${e}`,x+=Me(y,h,r+t,e,"tr"),x+=` L${r+t},${e+n-d}`,x+=Me(g,d,r+t,e+n,"br"),x+=` L${r+m},${e+n}`,x+=Me($,m,r,e+n,"bl"),x+=` L${r},${e+c}`,x+=Me(p,c,r,e,"tl"),x+=" Z",x}function Me(r,e,t,n,i){if(e<=0)return"";switch(r){case"round":switch(i){case"tr":return` A${e},${e} 0 0 1 ${t},${n+e}`;case"br":return` A${e},${e} 0 0 1 ${t-e},${n}`;case"bl":return` A${e},${e} 0 0 1 ${t},${n-e}`;case"tl":return` A${e},${e} 0 0 1 ${t+e},${n}`}break;case"scoop":switch(i){case"tr":return` A${e},${e} 0 0 0 ${t},${n+e}`;case"br":return` A${e},${e} 0 0 0 ${t-e},${n}`;case"bl":return` A${e},${e} 0 0 0 ${t},${n-e}`;case"tl":return` A${e},${e} 0 0 0 ${t+e},${n}`}break;case"bevel":switch(i){case"tr":return` L${t},${n+e}`;case"br":return` L${t-e},${n}`;case"bl":return` L${t},${n-e}`;case"tl":return` L${t+e},${n}`}break;case"notch":switch(i){case"tr":return` L${t-e},${n+e} L${t},${n+e}`;case"br":return` L${t-e},${n-e} L${t-e},${n}`;case"bl":return` L${t+e},${n-e} L${t},${n-e}`;case"tl":return` L${t+e},${n+e} L${t+e},${n}`}break}return""}function Ue(r,e,t=!1,n=.5,i){if(r.length<2)return r.length===1?`M ${r[0].x} ${r[0].y}`:"";switch(e){case"LINEAR":case"linear":return hr(r,t);case"QUADRATIC":case"quadratic":return dn(r,t);case"CUBIC":case"cubic":return hn(r,t);case"ARC":case"arc":return pn(r,t,i);case"MIXED":case"mixed":return pr(r,t);case"CATMULL_ROM":case"catmull-rom":return fn(r,t,n);case"BASIS":case"basis":return mn(r,t);default:return r.some(a=>a.segmentType)?pr(r,t):hr(r,t)}}function hr(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let i=1;i<r.length;i++)r[i].isSubpathStart?(e&&i-n>2&&(t+=" Z"),t+=` M ${r[i].x} ${r[i].y}`,n=i):t+=` L ${r[i].x} ${r[i].y}`;return e&&r.length-n>2&&(t+=" Z"),t}function dn(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let i=0;i<r.length-1;i++){let a=r[i],o=r[i+1];if(o.isSubpathStart){if(e&&i-n>=1){let u=r[n],c=a.handleOut??{x:(a.x+u.x)/2,y:(a.y+u.y)/2};t+=` Q ${c.x} ${c.y} ${u.x} ${u.y} Z`}t+=` M ${o.x} ${o.y}`,n=i+1;continue}let l=a.handleOut??{x:(a.x+o.x)/2,y:(a.y+o.y)/2};t+=` Q ${l.x} ${l.y} ${o.x} ${o.y}`}if(e&&r.length-n>1){let i=r[r.length-1],a=r[n],o=i.handleOut??{x:(i.x+a.x)/2,y:(i.y+a.y)/2};t+=` Q ${o.x} ${o.y} ${a.x} ${a.y} Z`}return t}function hn(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let i=0;i<r.length-1;i++){let a=r[i],o=r[i+1];if(o.isSubpathStart){if(e&&i-n>=1){let c=r[n],h=a.handleOut??{x:a.x,y:a.y},d=c.handleIn??{x:c.x,y:c.y};t+=` C ${h.x} ${h.y} ${d.x} ${d.y} ${c.x} ${c.y} Z`}t+=` M ${o.x} ${o.y}`,n=i+1;continue}let l=a.handleOut??{x:a.x,y:a.y},u=o.handleIn??{x:o.x,y:o.y};t+=` C ${l.x} ${l.y} ${u.x} ${u.y} ${o.x} ${o.y}`}if(e&&r.length-n>1){let i=r[r.length-1],a=r[n],o=i.handleOut??{x:i.x,y:i.y},l=a.handleIn??{x:a.x,y:a.y};t+=` C ${o.x} ${o.y} ${l.x} ${l.y} ${a.x} ${a.y} Z`}return t}function pn(r,e,t){let n=`M ${r[0].x} ${r[0].y}`,i=0,a={rx:50,ry:50,rotation:0,largeArc:!1,sweep:!0};for(let o=0;o<r.length-1;o++){let l=r[o+1];if(l.isSubpathStart){if(e&&o-i>=1){let c=r[i],h=t?.[o]??a;n+=` A ${h.rx} ${h.ry} ${h.rotation} ${h.largeArc?1:0} ${h.sweep?1:0} ${c.x} ${c.y} Z`}n+=` M ${l.x} ${l.y}`,i=o+1;continue}let u=t?.[o]??a;n+=` A ${u.rx} ${u.ry} ${u.rotation} ${u.largeArc?1:0} ${u.sweep?1:0} ${l.x} ${l.y}`}if(e&&r.length-i>1){let o=r[i],l=t?.[r.length-1]??a;n+=` A ${l.rx} ${l.ry} ${l.rotation} ${l.largeArc?1:0} ${l.sweep?1:0} ${o.x} ${o.y} Z`}return n}function pr(r,e){let t=`M ${r[0].x} ${r[0].y}`,n=0;for(let i=0;i<r.length-1;i++){let a=r[i],o=r[i+1];if(o.isSubpathStart){if(e&&i-n>=1){let l=r[n];t+=vt(a,l,l.segmentType),t+=" Z"}t+=` M ${o.x} ${o.y}`,n=i+1;continue}t+=vt(a,o,o.segmentType)}if(e&&r.length-n>1){let i=r[r.length-1],a=r[n];t+=vt(i,a,a.segmentType),t+=" Z"}return t}function vt(r,e,t){let n=(t??(r.handleOut||e.handleIn?"CUBIC":"LINEAR")).toUpperCase();if(n==="LINEAR")return` L ${e.x} ${e.y}`;if(n==="QUADRATIC"){let o=r.handleOut??{x:(r.x+e.x)/2,y:(r.y+e.y)/2};return` Q ${o.x} ${o.y} ${e.x} ${e.y}`}if(n==="ARC"){let o=e.arcParams;return o?` A ${o.rx} ${o.ry} ${o.rotation} ${o.largeArc?1:0} ${o.sweep?1:0} ${e.x} ${e.y}`:` L ${e.x} ${e.y}`}let i=r.handleOut??{x:r.x,y:r.y},a=e.handleIn??{x:e.x,y:e.y};return` C ${i.x} ${i.y} ${a.x} ${a.y} ${e.x} ${e.y}`}function fn(r,e,t){if(r.length<2)return r.length===1?`M ${r[0].x} ${r[0].y}`:"";let n=t,i=e?[r[r.length-1],...r,r[0],r[1]]:[r[0],...r,r[r.length-1]],a=`M ${r[0].x} ${r[0].y}`,o=e?r.length:r.length-1;for(let l=0;l<o;l++){let u=i[l],c=i[l+1],h=i[l+2],d=i[l+3],m=Math.hypot(h.x-c.x,h.y-c.y),p=Math.hypot(c.x-u.x,c.y-u.y),y=Math.hypot(d.x-h.x,d.y-h.y),g=Math.pow(p,n),$=Math.pow(m,n),w=Math.pow(y,n),x=Math.pow(p,2*n),S=Math.pow(m,2*n),_=Math.pow(y,2*n),A,C,b,k;p<1e-8?(A=c.x,C=c.y):(A=(x*h.x-S*u.x+(2*x+3*g*$+S)*c.x)/(3*g*(g+$)),C=(x*h.y-S*u.y+(2*x+3*g*$+S)*c.y)/(3*g*(g+$))),y<1e-8?(b=h.x,k=h.y):(b=(_*c.x-S*d.x+(2*_+3*w*$+S)*h.x)/(3*w*(w+$)),k=(_*c.y-S*d.y+(2*_+3*w*$+S)*h.y)/(3*w*(w+$))),a+=` C ${A} ${C} ${b} ${k} ${h.x} ${h.y}`}return e&&(a+=" Z"),a}function mn(r,e){let t=r.length;if(t<2)return t===1?`M ${r[0].x} ${r[0].y}`:"";if(t===2)return`M ${r[0].x} ${r[0].y} L ${r[1].x} ${r[1].y}`;if(e){let a=(r[0].x+4*r[1].x+r[2].x)/6,o=(r[0].y+4*r[1].y+r[2].y)/6,l=`M ${a} ${o}`;for(let u=0;u<t;u++){let c=r[(u+1)%t],h=r[(u+2)%t],d=r[(u+3)%t];l+=Mt(c,h,d)}return l+=" Z",l}let n=r,i=`M ${n[0].x} ${n[0].y}`;i+=` L ${(5*n[0].x+n[1].x)/6} ${(5*n[0].y+n[1].y)/6}`;for(let a=0;a<=t-3;a++)i+=Mt(n[a],n[a+1],n[a+2]);return i+=Mt(n[t-2],n[t-1],n[t-1]),i+=` L ${n[t-1].x} ${n[t-1].y}`,i}function Mt(r,e,t){return` C ${(2*r.x+e.x)/3} ${(2*r.y+e.y)/3} ${(r.x+2*e.x)/3} ${(r.y+2*e.y)/3} ${(r.x+4*e.x+t.x)/6} ${(r.y+4*e.y+t.y)/6}`}function ie(r,e,t){let n=Number.isFinite(e)?Math.max(1,e):8,i=Number.isFinite(t)?Math.max(1,t):4;switch(r){case"dashed":case"dotted":case"custom":return`${n} ${i}`;default:return null}}function D(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function gn(r){let e=r.fillType;return e||(r.fillGradient?r.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":r.linearGradient?"linear-gradient":r.radialGradient?"radial-gradient":"solid")}function Ne(r){let e=new Map,t=r.state,n=t;switch(r.type){case"circle":e.set("cx",String(t.x??0)),e.set("cy",String(t.y??0)),e.set("r",String(t.radius??50));break;case"ellipse":e.set("cx",String(t.cx??0)),e.set("cy",String(t.cy??0)),e.set("rx",String(t.rx??50)),e.set("ry",String(t.ry??30));break;case"rectangle":case"square":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),(t.cornerRadius??0)>0&&e.set("rx",String(t.cornerRadius));break;case"line":e.set("x1",String(t.x1??0)),e.set("y1",String(t.y1??0)),e.set("x2",String(t.x2??0)),e.set("y2",String(t.y2??0));break;case"text":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),t.fontSize&&e.set("font-size",String(t.fontSize)),t.fontFamily&&e.set("font-family",t.fontFamily),t.fontWeight&&e.set("font-weight",t.fontWeight),t.fontStyle&&e.set("font-style",t.fontStyle),t.textAnchor&&e.set("text-anchor",t.textAnchor),t.letterSpacing&&e.set("letter-spacing",String(t.letterSpacing));break;case"image":e.set("x",String(t.x??0)),e.set("y",String(t.y??0)),e.set("width",String(t.width??100)),e.set("height",String(t.height??100)),n.href&&e.set("href",String(n.href));break}let i=gn(n);i==="none"?e.set("fill","none"):i==="linear-gradient"||i==="radial-gradient"?e.set("fill",`url(#gradient-fill-${r.id})`):i==="pattern"?e.set("fill",`url(#pattern-fill-${r.id})`):e.set("fill",t.fillColor??"#000000");let a=t.opacity;a!==void 0&&a<1&&e.set("opacity",String(a));let o=t.fillOpacity;o!==void 0&&o<1&&e.set("fill-opacity",String(o)),t.fillRule&&t.fillRule!=="nonzero"&&e.set("fill-rule",t.fillRule);let l=n.strokeType??"solid";if(l==="none")e.set("stroke","none");else if(l==="linear-gradient"||l==="radial-gradient")e.set("stroke",`url(#gradient-stroke-${r.id})`);else{let _=t.borderColor??"none";_!=="none"&&e.set("stroke",_)}let u=t.borderWidth;u!=null&&u!==0&&e.set("stroke-width",String(u));let c=t.strokeOpacity;c!==void 0&&c<1&&e.set("stroke-opacity",String(c));let h=t.lineStyle??"solid",d=t.dashLength??8,m=t.gapLength??4,p=ie(h,d,m);p&&(e.set("stroke-dasharray",p),h==="dotted"&&e.set("stroke-linecap","round"));let y=yn(n);y&&e.set("transform",y);let g=n.filters;g&&g.length>0&&e.set("filter",`url(#filter-${r.id})`);let $=t.shapeRendering;$&&$!=="auto"&&e.set("shape-rendering",$);let w=n.startEndpoint,x=n.endEndpoint;w&&w!=="none"&&e.set("marker-start",`url(#line-marker-${w})`),x&&x!=="none"&&e.set("marker-end",`url(#line-marker-${x})`);let S=n.metadata;return S&&(S.role&&e.set("role",S.role),S.ariaLabel&&e.set("aria-label",S.ariaLabel)),e}function fr(r){switch(r.type){case"circle":return"circle";case"ellipse":return"ellipse";case"rectangle":case"square":return"rect";case"line":return"line";case"text":return"text";case"image":return"image";case"spline":case"polyline":case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":return"path";default:return"g"}}function yn(r){let e=r.rotation??0,t=r.skewX??0,n=r.skewY??0,i=r.scaleX??1,a=r.scaleY??1;if(e===0&&t===0&&n===0&&i===1&&a===1)return null;let o=r.customPivot;if(!o)return null;let l=[];return l.push(`translate(${o.x}, ${o.y})`),e!==0&&l.push(`rotate(${e})`),(i!==1||a!==1)&&l.push(`scale(${i}, ${a})`),t!==0&&l.push(`skewX(${t})`),n!==0&&l.push(`skewY(${n})`),l.push(`translate(${-o.x}, ${-o.y})`),l.join(" ")}function W(r,e){let t=r.viewboxes?.[0];return{width:e.width??t?.width??800,height:e.height??t?.height??600}}function s(r,e){return e==null||e===""?"":` ${r}="${D(String(e))}"`}function Ve(r){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return e?{r:parseInt(e[1],16)/255,g:parseInt(e[2],16)/255,b:parseInt(e[3],16)/255}:{r:0,g:0,b:0}}function bn(r,e,t){let{offsetX:n,offsetY:i,blurRadius:a,spread:o,color:l,opacity:u}=r,c="";if(o===0)c+=`<feDropShadow${s("in",e)}${s("dx",n)}${s("dy",i)}${s("stdDeviation",a/2)}${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_shadow`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_shadow`)}/><feMergeNode${s("in",e)}/></feMerge>`;else{c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`;let h=o>0?"dilate":"erode",d=Math.abs(o);c+=`<feMorphology${s("in",`${t}_alpha`)}${s("operator",h)}${s("radius",d)}${s("result",`${t}_spread`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_spread`)}${s("stdDeviation",a/2)}${s("result",`${t}_blur`)}/>`,c+=`<feOffset${s("in",`${t}_blur`)}${s("dx",n)}${s("dy",i)}${s("result",`${t}_offset`)}/>`,c+=`<feFlood${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_color`)}/>`,c+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_offset`)}${s("operator","in")}${s("result",`${t}_shadow`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_shadow`)}/><feMergeNode${s("in",e)}/></feMerge>`}return c}function $n(r,e,t){let{offsetX:n,offsetY:i,blurRadius:a,choke:o,color:l,opacity:u}=r,c=a*(1-o/100),h="";return h+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,h+=`<feComponentTransfer${s("in",`${t}_alpha`)}${s("result",`${t}_inverted`)}><feFuncA${s("type","table")}${s("tableValues","1 0")}/></feComponentTransfer>`,h+=`<feGaussianBlur${s("in",`${t}_inverted`)}${s("stdDeviation",c/2)}${s("result",`${t}_blur`)}/>`,h+=`<feOffset${s("in",`${t}_blur`)}${s("dx",n)}${s("dy",i)}${s("result",`${t}_offset`)}/>`,h+=`<feFlood${s("flood-color",l)}${s("flood-opacity",u)}${s("result",`${t}_color`)}/>`,h+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_offset`)}${s("operator","in")}${s("result",`${t}_coloredShadow`)}/>`,h+=`<feComposite${s("in",`${t}_coloredShadow`)}${s("in2",`${t}_alpha`)}${s("operator","in")}${s("result",`${t}_innerShadow`)}/>`,h+=`<feComposite${s("in",`${t}_innerShadow`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`,h}function xn(r,e,t){let{blurX:n,blurY:i}=r;return n===0&&i===0?E(e,t):`<feGaussianBlur${s("in",e)}${s("stdDeviation",`${n/2} ${i/2}`)}${s("result",t)}/>`}function Sn(r,e,t){let{distance:n,angle:i}=r;if(n===0)return E(e,t);let a=i*Math.PI/180,o=Math.abs(Math.cos(a)*n),l=Math.abs(Math.sin(a)*n);return`<feGaussianBlur${s("in",e)}${s("stdDeviation",`${o/2} ${l/2}`)}${s("result",t)}/>`}function mr(r,e,t){let{x:n,y:i,z:a,color:o,surfaceScale:l,diffuseConstant:u,specularConstant:c,specularExponent:h}=r,d="";return d+=`<feDiffuseLighting${s("in","SourceAlpha")}${s("surfaceScale",l)}${s("diffuseConstant",u)}${s("lighting-color",o)}${s("result",`${t}_diffuse`)}>`,d+=`<fePointLight${s("x",n)}${s("y",i)}${s("z",a)}/>`,d+="</feDiffuseLighting>",d+=`<feSpecularLighting${s("in","SourceAlpha")}${s("surfaceScale",l)}${s("specularConstant",c)}${s("specularExponent",h)}${s("lighting-color",o)}${s("result",`${t}_specular`)}>`,d+=`<fePointLight${s("x",n)}${s("y",i)}${s("z",a)}/>`,d+="</feSpecularLighting>",d+=`<feComposite${s("in",e)}${s("in2",`${t}_diffuse`)}${s("operator","arithmetic")}${s("k1",1)}${s("k2",0)}${s("k3",0)}${s("k4",0)}${s("result",`${t}_lit`)}/>`,d+=`<feComposite${s("in",`${t}_specular`)}${s("in2",`${t}_lit`)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",1)}${s("k3",1)}${s("k4",0)}${s("result",t)}/>`,d}function gr(r,e,t){let{x:n,y:i,z:a,pointsAtX:o,pointsAtY:l,pointsAtZ:u,coneAngle:c,color:h,surfaceScale:d,specularConstant:m,specularExponent:p}=r,y="";return y+=`<feSpecularLighting${s("in","SourceAlpha")}${s("surfaceScale",d)}${s("specularConstant",m)}${s("specularExponent",p)}${s("lighting-color",h)}${s("result",`${t}_specular`)}>`,y+=`<feSpotLight${s("x",n)}${s("y",i)}${s("z",a)}${s("pointsAtX",o)}${s("pointsAtY",l)}${s("pointsAtZ",u)}${s("limitingConeAngle",c)}/>`,y+="</feSpecularLighting>",y+=`<feComposite${s("in",`${t}_specular`)}${s("in2","SourceAlpha")}${s("operator","in")}${s("result",`${t}_clipped`)}/>`,y+=`<feComposite${s("in",`${t}_clipped`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",1)}${s("k3",1)}${s("k4",0)}${s("result",t)}/>`,y}function yr(r){switch(r.kind){case"point":return`<fePointLight${s("x",r.x)}${s("y",r.y)}${s("z",r.z)}/>`;case"spot":{let e=`<feSpotLight${s("x",r.x)}${s("y",r.y)}${s("z",r.z)}${s("pointsAtX",r.pointsAtX)}${s("pointsAtY",r.pointsAtY)}${s("pointsAtZ",r.pointsAtZ)}`;return r.limitingConeAngle!==void 0&&(e+=s("limitingConeAngle",r.limitingConeAngle)),r.specularExponent!==void 0&&(e+=s("specularExponent",r.specularExponent)),e+"/>"}case"distant":return`<feDistantLight${s("azimuth",r.azimuth)}${s("elevation",r.elevation)}/>`}}function _n(r,e,t){return`<feDiffuseLighting${s("in",e)}${s("surfaceScale",r.surfaceScale)}${s("diffuseConstant",r.diffuseConstant)}${s("lighting-color",r.color)}${s("result",t)}>`+yr(r.lightSource)+"</feDiffuseLighting>"}function kn(r,e,t){return`<feSpecularLighting${s("in",e)}${s("surfaceScale",r.surfaceScale)}${s("specularConstant",r.specularConstant)}${s("specularExponent",r.specularExponent)}${s("lighting-color",r.color)}${s("result",t)}>`+yr(r.lightSource)+"</feSpecularLighting>"}function wn(r,e,t){let{width:n,color:i,opacity:a,position:o}=r,l="";if(o==="inside")l+=`<feMorphology${s("in","SourceAlpha")}${s("operator","erode")}${s("radius",n)}${s("result",`${t}_eroded`)}/>`,l+=`<feComposite${s("in","SourceAlpha")}${s("in2",`${t}_eroded`)}${s("operator","out")}${s("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${s("flood-color",i)}${s("flood-opacity",a)}${s("result",`${t}_color`)}/>`,l+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_outlineAlpha`)}${s("operator","in")}${s("result",`${t}_outline`)}/>`,l+=`<feComposite${s("in",`${t}_outline`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`;else{let u=o==="outside"?n:n/2;l+=`<feMorphology${s("in","SourceAlpha")}${s("operator","dilate")}${s("radius",u)}${s("result",`${t}_dilated`)}/>`,l+=`<feComposite${s("in",`${t}_dilated`)}${s("in2","SourceAlpha")}${s("operator","out")}${s("result",`${t}_outlineAlpha`)}/>`,l+=`<feFlood${s("flood-color",i)}${s("flood-opacity",a)}${s("result",`${t}_color`)}/>`,l+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_outlineAlpha`)}${s("operator","in")}${s("result",`${t}_outline`)}/>`,l+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_outline`)}/><feMergeNode${s("in",e)}/></feMerge>`}return l}function Tn(r,e,t){let{amount:n}=r;if(n===0)return E(e,t);let i=1+4*n,a=-n,o=[0,a,0,a,i,a,0,a,0].join(" ");return`<feConvolveMatrix${s("in",e)}${s("order","3")}${s("kernelMatrix",o)}${s("divisor","1")}${s("bias","0")}${s("preserveAlpha","true")}${s("edgeMode","duplicate")}${s("result",t)}/>`}function Pn(r,e,t){let{blockSize:n}=r;if(n<=1)return E(e,t);let i=n/2,a="";return a+=`<feMorphology${s("in",e)}${s("operator","erode")}${s("radius",i)}${s("result",`${t}_eroded`)}/>`,a+=`<feMorphology${s("in",`${t}_eroded`)}${s("operator","dilate")}${s("radius",i)}${s("result",t)}/>`,a}function vn(r,e,t){let{scale:n,frequency:i,octaves:a,warpType:o}=r;if(n===0)return E(e,t);let l="";return l+=`<feTurbulence${s("type",o)}${s("baseFrequency",i)}${s("numOctaves",a)}${s("seed",0)}${s("result",`${t}_turbulence`)}/>`,l+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_turbulence`)}${s("scale",n)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",t)}/>`,l}function Mn(r,e,t){let{operator:n,radiusX:i,radiusY:a}=r;return i===0&&a===0?E(e,t):`<feMorphology${s("in",e)}${s("operator",n)}${s("radius",`${i} ${a}`)}${s("result",t)}/>`}function Rn(r,e,t){let{levels:n}=r;if(n<2)return E(e,t);let i=[];for(let l=0;l<n;l++)i.push(l/(n-1));let a=i.join(" "),o=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return o+=`<feFuncR${s("type","discrete")}${s("tableValues",a)}/>`,o+=`<feFuncG${s("type","discrete")}${s("tableValues",a)}/>`,o+=`<feFuncB${s("type","discrete")}${s("tableValues",a)}/>`,o+="</feComponentTransfer>",o}function An(r,e,t){let{levels:n,contrast:i}=r;if(n<2)return E(e,t);let a=[];for(let u=0;u<n;u++){let c=u/(n-1),h=c;i!==1&&(h=.5+(c-.5)*i,h=Math.max(0,Math.min(1,h))),a.push(h)}let o=a.join(" "),l=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return l+=`<feFuncR${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function Cn(r,e,t){let{radius:n}=r;if(n===0)return E(e,t);let i="";return i+=`<feGaussianBlur${s("in","SourceAlpha")}${s("stdDeviation",n)}${s("result",`${t}_blurredAlpha`)}/>`,i+=`<feComponentTransfer${s("in",`${t}_blurredAlpha`)}${s("result",`${t}_thresholdAlpha`)}><feFuncA${s("type","linear")}${s("slope",20)}${s("intercept",-9)}/></feComponentTransfer>`,i+=`<feComposite${s("in",e)}${s("in2",`${t}_thresholdAlpha`)}${s("operator","in")}${s("result",t)}/>`,i}function In(r,e,t){let{amount:n}=r;if(n===0)return E(e,t);let i=1-n;return`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","saturate")}${s("values",i)}${s("result",t)}/>`}function En(r,e,t){let{red:n,green:i,blue:a}=r;if(n===1&&i===1&&a===1)return E(e,t);let o=`<feComponentTransfer${s("in",e)}${s("result",t)}>`;return o+=`<feFuncR${s("type","linear")}${s("slope",n)}${s("intercept",0)}/>`,o+=`<feFuncG${s("type","linear")}${s("slope",i)}${s("intercept",0)}/>`,o+=`<feFuncB${s("type","linear")}${s("slope",a)}${s("intercept",0)}/>`,o+="</feComponentTransfer>",o}function Fn(r,e,t){let{amount:n}=r;if(n===1)return E(e,t);let i=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return i+=`<feFuncR${s("type","linear")}${s("slope",n)}${s("intercept",0)}/>`,i+=`<feFuncG${s("type","linear")}${s("slope",n)}${s("intercept",0)}/>`,i+=`<feFuncB${s("type","linear")}${s("slope",n)}${s("intercept",0)}/>`,i+="</feComponentTransfer>",i}function Ln(r,e,t){let{amount:n}=r;if(n===1)return E(e,t);let i=.5*(1-n),a=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return a+=`<feFuncR${s("type","linear")}${s("slope",n)}${s("intercept",i)}/>`,a+=`<feFuncG${s("type","linear")}${s("slope",n)}${s("intercept",i)}/>`,a+=`<feFuncB${s("type","linear")}${s("slope",n)}${s("intercept",i)}/>`,a+="</feComponentTransfer>",a}function Dn(r,e,t){let{amount:n}=r;if(n===1)return E(e,t);let i=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return i+=`<feFuncA${s("type","linear")}${s("slope",n)}${s("intercept",0)}/>`,i+="</feComponentTransfer>",i}function On(r,e,t){let{amount:n}=r;if(n===0)return E(e,t);let i=n,a=1-n,o=`${i} ${a}`,l=`<feComponentTransfer${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("result",t)}>`;return l+=`<feFuncR${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",o)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",o)}/>`,l+="</feComponentTransfer>",l}function Gn(r,e,t){let{angle:n}=r;return n===0||n===360?E(e,t):`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","hueRotate")}${s("values",n)}${s("result",t)}/>`}function Bn(r,e,t){let{amount:n}=r;return n===1?E(e,t):`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","saturate")}${s("values",n)}${s("result",t)}/>`}function Un(r,e,t){let{threshold:n}=r,i="";if(i+=`<feColorMatrix${s("in",e)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`,n===.5)i+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,i+=`<feFuncR${s("type","discrete")}${s("tableValues","0 1")}/>`,i+=`<feFuncG${s("type","discrete")}${s("tableValues","0 1")}/>`,i+=`<feFuncB${s("type","discrete")}${s("tableValues","0 1")}/>`,i+="</feComponentTransfer>";else{let o=[];for(let u=0;u<256;u++)o.push(u/255<n?0:1);let l=o.join(" ");i+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,i+=`<feFuncR${s("type","table")}${s("tableValues",l)}/>`,i+=`<feFuncG${s("type","table")}${s("tableValues",l)}/>`,i+=`<feFuncB${s("type","table")}${s("tableValues",l)}/>`,i+="</feComponentTransfer>"}return i}function Nn(r,e,t){let{amount:n}=r;if(n===0)return E(e,t);let i=[.393,.769,.189,0,0],a=[.349,.686,.168,0,0],o=[.272,.534,.131,0,0],l=[1,0,0,0,0],u=[0,1,0,0,0],c=[0,0,1,0,0],h=(g,$)=>g.map((w,x)=>w*(1-n)+$[x]*n),d=h(l,i),m=h(u,a),p=h(c,o),y=[...d,...m,...p,0,0,0,1,0].join(" ");return`<feColorMatrix${s("color-interpolation-filters","sRGB")}${s("in",e)}${s("type","matrix")}${s("values",y)}${s("result",t)}/>`}function Vn(r,e,t){let{shadowColor:n,highlightColor:i}=r,a=Ve(n),o=Ve(i),l="";return l+=`<feColorMatrix${s("in",e)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`,l+=`<feComponentTransfer${s("in",`${t}_gray`)}${s("result",t)}>`,l+=`<feFuncR${s("type","table")}${s("tableValues",`${a.r} ${o.r}`)}/>`,l+=`<feFuncG${s("type","table")}${s("tableValues",`${a.g} ${o.g}`)}/>`,l+=`<feFuncB${s("type","table")}${s("tableValues",`${a.b} ${o.b}`)}/>`,l+="</feComponentTransfer>",l}function zn(r,e,t){let{intensity:n}=r;if(n===0)return E(e,t);let i="";i+=`<feComponentTransfer${s("in",e)}${s("result",`${t}_invert`)}>`,i+=`<feFuncR${s("type","table")}${s("tableValues","1 0")}/>`,i+=`<feFuncG${s("type","table")}${s("tableValues","1 0")}/>`,i+=`<feFuncB${s("type","table")}${s("tableValues","1 0")}/>`,i+="</feComponentTransfer>",i+=`<feColorMatrix${s("in",`${t}_invert`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_gray`)}/>`;let a=[.1,.1,.1,0,0],o=[.3,.4,.3,0,0],l=[.5,.5,.8,0,0],u=[1,0,0,0,0],c=[0,1,0,0,0],h=[0,0,1,0,0],d=($,w)=>$.map((x,S)=>x*(1-n)+w[S]*n),m=d(u,a),p=d(c,o),y=d(h,l),g=[...m,...p,...y,0,0,0,1,0].join(" ");return i+=`<feColorMatrix${s("in",`${t}_gray`)}${s("type","matrix")}${s("values",g)}${s("result",t)}/>`,i}function jn(r,e,t){let{amount:n,scale:i}=r;if(n===0)return E(e,t);let a=1/i,o="";return o+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",a)}${s("numOctaves",3)}${s("seed",0)}${s("result",`${t}_noise`)}/>`,o+=`<feColorMatrix${s("in",`${t}_noise`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_noiseGray`)}/>`,o+=`<feBlend${s("in",e)}${s("in2",`${t}_noiseGray`)}${s("mode","overlay")}${s("result",`${t}_blended`)}/>`,o+=`<feComposite${s("in",`${t}_blended`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",n)}${s("k3",1-n)}${s("k4",0)}${s("result",`${t}_amt`)}/>`,o+=`<feComposite${s("in",`${t}_amt`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,o}function Wn(r,e,t){let{strength:n,angle:i}=r;if(n===0)return E(e,t);let a=i*Math.PI/180,o=Math.cos(a),l=Math.sin(a),u=n,c=[-(u*(o+l)),-(u*l),u*(-o+l),-(u*o),1,u*o,u*(o-l),u*l,u*(o+l)].join(" ");return`<feConvolveMatrix${s("in",e)}${s("order","3 3")}${s("kernelMatrix",c)}${s("divisor",1)}${s("bias",.5)}${s("preserveAlpha","true")}${s("result",t)}/>`}function Hn(r,e,t){let{amount:n,size:i}=r;if(n===0)return E(e,t);let a=.5/i,o="";return o+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",`${a} ${a}`)}${s("numOctaves",5)}${s("seed",0)}${s("stitchTiles","stitch")}${s("result",`${t}_grain`)}/>`,o+=`<feColorMatrix${s("in",`${t}_grain`)}${s("type","saturate")}${s("values",0)}${s("result",`${t}_grainGray`)}/>`,o+=`<feBlend${s("in",e)}${s("in2",`${t}_grainGray`)}${s("mode","soft-light")}${s("result",`${t}_blended`)}/>`,o+=`<feComposite${s("in",`${t}_blended`)}${s("in2",e)}${s("operator","arithmetic")}${s("k1",0)}${s("k2",n)}${s("k3",1-n)}${s("k4",0)}${s("result",`${t}_amt`)}/>`,o+=`<feComposite${s("in",`${t}_amt`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,o}function Xn(r,e,t){let{wetness:n,turbulence:i}=r;if(n===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",.02+i*.03)}${s("numOctaves",4)}${s("seed",42)}${s("result",`${t}_turb`)}/>`,a+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_turb`)}${s("scale",n*15)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${s("in",`${t}_disp`)}${s("stdDeviation",n*2)}${s("result",`${t}_blur`)}/>`,a+=`<feBlend${s("in",`${t}_blur`)}${s("in2",e)}${s("mode","multiply")}${s("result",t)}/>`,a}function Yn(r,e,t){let{thickness:n,texture:i}=r;if(n===0&&i===0)return E(e,t);let a="";a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.03+i*.02)}${s("numOctaves",3)}${s("seed",1e3)}${s("result",`${t}_brush`)}/>`;let o=Math.max(3,8-Math.floor(n*5)),l=Array.from({length:o+1},(u,c)=>c/o).join(" ");a+=`<feComponentTransfer${s("in",e)}${s("result",`${t}_poster`)}>`;for(let u of["R","G","B"])a+=`<feFunc${u}${s("type","discrete")}${s("tableValues",l)}/>`;return a+="</feComponentTransfer>",a+=`<feDisplacementMap${s("in",`${t}_poster`)}${s("in2",`${t}_brush`)}${s("scale",i*4)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feMorphology${s("in",`${t}_disp`)}${s("operator","dilate")}${s("radius",n*.5)}${s("result",`${t}_thick`)}/>`,a+=`<feComposite${s("in",`${t}_thick`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,a}function qn(r,e,t){let{spread:n,edges:i}=r;if(n===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","fractalNoise")}${s("baseFrequency",.01+i*.02)}${s("numOctaves",5)}${s("seed",1100)}${s("result",`${t}_ink`)}/>`,a+=`<feMorphology${s("in",e)}${s("operator","dilate")}${s("radius",n*3)}${s("result",`${t}_dilate`)}/>`,a+=`<feDisplacementMap${s("in",`${t}_dilate`)}${s("in2",`${t}_ink`)}${s("scale",i*10)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feGaussianBlur${s("in",`${t}_disp`)}${s("stdDeviation",n*.5)}${s("result",t)}/>`,a}function Kn(r,e,t){let{wrinkles:n,shine:i}=r;if(n===0&&i===0)return E(e,t);let a="";return a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.02)}${s("numOctaves",4)}${s("seed",1200)}${s("result",`${t}_wrinkle`)}/>`,a+=`<feDisplacementMap${s("in",e)}${s("in2",`${t}_wrinkle`)}${s("scale",n*15)}${s("xChannelSelector","R")}${s("yChannelSelector","G")}${s("result",`${t}_disp`)}/>`,a+=`<feSpecularLighting${s("in",`${t}_wrinkle`)}${s("surfaceScale",n*2)}${s("specularConstant",i*1.5)}${s("specularExponent",20)}${s("result",`${t}_sheen`)}>`,a+=`<feDistantLight${s("azimuth",45)}${s("elevation",60)}/>`,a+="</feSpecularLighting>",a+=`<feBlend${s("in",`${t}_disp`)}${s("in2",`${t}_sheen`)}${s("mode","screen")}${s("result",`${t}_blend`)}/>`,a+=`<feComposite${s("in",`${t}_blend`)}${s("in2",e)}${s("operator","in")}${s("result",t)}/>`,a}function Zn(r,e,t){let{density:n,size:i}=r;if(n===0)return E(e,t);let a="",o=1-n;a+=`<feTurbulence${s("type","turbulence")}${s("baseFrequency",.1/i)}${s("numOctaves",1)}${s("seed",1400)}${s("result",`${t}_hole`)}/>`,a+=`<feComponentTransfer${s("in",`${t}_hole`)}${s("result",`${t}_thresh`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${s("type","linear")}${s("slope",10)}${s("intercept",-o*10+5)}/>`;a+="</feComponentTransfer>",a+=`<feComponentTransfer${s("in",`${t}_thresh`)}${s("result",`${t}_clamp`)}>`;for(let l of["R","G","B","A"])a+=`<feFunc${l}${s("type","table")}${s("tableValues","0 0 1 1")}/>`;return a+="</feComponentTransfer>",a+=`<feComposite${s("in",e)}${s("in2",`${t}_clamp`)}${s("operator","in")}${s("result",t)}/>`,a}function Qn(r,e,t){let{color:n,radius:i,intensity:a}=r;if(a===0||i===0)return E(e,t);let{r:o,g:l,b:u}=Ve(n),c="";return c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_alpha`)}${s("stdDeviation",i/2)}${s("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${s("in",`${t}_blur`)}${s("type","matrix")}${s("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a} 0`)}${s("result",`${t}_color`)}/>`,c+=`<feMerge${s("result",t)}><feMergeNode${s("in",`${t}_color`)}/><feMergeNode${s("in",e)}/></feMerge>`,c}function Jn(r,e,t){let{color:n,radius:i,intensity:a}=r;if(a===0||i===0)return E(e,t);let{r:o,g:l,b:u}=Ve(n),c="";return c+=`<feColorMatrix${s("in",e)}${s("type","matrix")}${s("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0")}${s("result",`${t}_alpha`)}/>`,c+=`<feMorphology${s("in",`${t}_alpha`)}${s("operator","erode")}${s("radius",i/4)}${s("result",`${t}_erode`)}/>`,c+=`<feComposite${s("in",`${t}_alpha`)}${s("in2",`${t}_erode`)}${s("operator","out")}${s("result",`${t}_edge`)}/>`,c+=`<feGaussianBlur${s("in",`${t}_edge`)}${s("stdDeviation",i/3)}${s("result",`${t}_blur`)}/>`,c+=`<feColorMatrix${s("in",`${t}_blur`)}${s("type","matrix")}${s("values",`0 0 0 0 ${o} 0 0 0 0 ${l} 0 0 0 0 ${u} 0 0 0 ${a*2} 0`)}${s("result",`${t}_color`)}/>`,c+=`<feComposite${s("in",`${t}_color`)}${s("in2",`${t}_alpha`)}${s("operator","in")}${s("result",`${t}_clipped`)}/>`,c+=`<feComposite${s("in",`${t}_clipped`)}${s("in2",e)}${s("operator","over")}${s("result",t)}/>`,c}function E(r,e){return`<feMerge${s("result",e)}><feMergeNode${s("in",r)}/></feMerge>`}function At(r,e,t,n){switch(r.type){case"drop-shadow":return bn(r,e,t);case"inner-shadow":return $n(r,e,t);case"gaussian-blur":return xn(r,e,t);case"motion-blur":return Sn(r,e,t);case"point-light":{let i=r;return mr(n?{...i,x:i.x+n.x,y:i.y+n.y}:i,e,t)}case"spot-light":{let i=r;return gr(n?{...i,x:i.x+n.x,y:i.y+n.y,pointsAtX:i.pointsAtX+n.x,pointsAtY:i.pointsAtY+n.y}:i,e,t)}case"diffuse-lighting":return _n(r,e,t);case"specular-lighting":return kn(r,e,t);case"outline":return wn(r,e,t);case"sharpen":return Tn(r,e,t);case"pixelate":return Pn(r,e,t);case"warp":return vn(r,e,t);case"morphology":return Mn(r,e,t);case"contouring-discrete":return Rn(r,e,t);case"contouring-table":return An(r,e,t);case"round-edges":return Cn(r,e,t);case"grayscale":return In(r,e,t);case"channel-painter":return En(r,e,t);case"brightness":return Fn(r,e,t);case"contrast":return Ln(r,e,t);case"opacity":return Dn(r,e,t);case"invert":return On(r,e,t);case"hue-rotate":return Gn(r,e,t);case"saturate":return Bn(r,e,t);case"black-and-white":return Un(r,e,t);case"sepia":return Nn(r,e,t);case"duotone":return Vn(r,e,t);case"xray":return zn(r,e,t);case"noise":return jn(r,e,t);case"emboss":return Wn(r,e,t);case"film-grain":return Hn(r,e,t);case"watercolor":return Xn(r,e,t);case"gouache":return Yn(r,e,t);case"ink-blot":return qn(r,e,t);case"crumpled-plastic":return Kn(r,e,t);case"riddled":return Zn(r,e,t);case"glow":return Qn(r,e,t);case"inner-glow":return Jn(r,e,t);case"raw-svg":return r.svgContent;default:return E(e,t)}}function ei(r){return r.some(e=>e.type==="gaussian-blur"||e.type==="motion-blur"||e.type==="drop-shadow"||e.type==="inner-shadow"||e.type==="glow"||e.type==="inner-glow"||e.type==="outline"||e.type==="morphology"||e.type==="warp")}function Ct(r,e,t={}){let n=e.filter(S=>S.enabled);if(n.length===0)return"";let i=t.colorInterpolation&&t.colorInterpolation!=="auto"?s("color-interpolation-filters",t.colorInterpolation):"",a=n.find(S=>S.type==="raw-svg");if(a){let S=t.colorInterpolation&&t.colorInterpolation!=="auto"?t.colorInterpolation:a.colorInterpolationFilters,_=t.filterUnits??a.filterUnits,A=t.primitiveUnits??a.primitiveUnits,C=t.x??a.x,b=t.y??a.y,k=t.width??a.width,v=t.height??a.height;return`<filter${s("id",r)}${s("x",C)}${s("y",b)}${s("width",k)}${s("height",v)}${s("filterUnits",_)}${s("primitiveUnits",A)}${s("color-interpolation-filters",S)}${s("flood-color",a.floodColor)}${s("flood-opacity",a.floodOpacity)}${s("lighting-color",a.lightingColor)}>${a.svgContent}</filter>`}let o=n.some(S=>S.type==="gaussian-blur"&&S.quality==="high"||S.type==="motion-blur"&&S.quality==="high"),l=ei(n),u=l?o?"-200%":"-100%":"-10%",c=l?o?"500%":"300%":"120%",h="",d="SourceGraphic",m=0;for(let S of n){let _=`result${m++}`;h+=At(S,d,_),d=_}let p=t.filterUnits??"objectBoundingBox",y=t.primitiveUnits??"userSpaceOnUse",g=t.x??u,$=t.y??u,w=t.width??c,x=t.height??c;return`<filter${s("id",r)}${s("x",g)}${s("y",$)}${s("width",w)}${s("height",x)}${s("filterUnits",p)}${s("primitiveUnits",y)}${i}>${h}</filter>`}function br(r){let e="",t=new Set;for(let n of r){let i=n.state.filters;if(!i||i.length===0)continue;let a=i.filter(c=>c.enabled);if(a.length===0)continue;let o=n.state.filterLibraryIds,l=Array.isArray(o)&&o.length>0?o[0]:`filter-${n.id}`;if(t.has(l))continue;t.add(l);let u=n.state;e+=Ct(l,a,{colorInterpolation:u.filterColorInterpolation,filterUnits:u.filterUnits,primitiveUnits:u.primitiveUnits,x:u.filterX,y:u.filterY,width:u.filterWidth,height:u.filterHeight})}return e}function ze(r,e,t){return!e||e.length===0||e.filter(i=>i.enabled).length===0?"":Array.isArray(t)&&t.length>0?` filter="${t.map(a=>`url(#${D(a)})`).join(" ")}"`:` filter="url(#filter-${D(r)})"`}function ue(r,e,t,n){let i=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/10);switch(r){case"stripes":return[{tag:"rect",attrs:{width:n?.strokeWidth!=null?Math.max(.01,Math.min(1,n.strokeWidth))*e:e/2,height:e,fill:t}}];case"dots":{let a=n?.dotRadius!=null?Math.max(.05,Math.min(.45,n.dotRadius)):.25;return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e*a,fill:t}}]}case"grid":return[{tag:"path",attrs:{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"none",stroke:t,"stroke-width":i}}];case"checkerboard":return[{tag:"rect",attrs:{width:e/2,height:e/2,fill:t}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e/2,height:e/2,fill:t}}];case"diagonal":{let a=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/5);return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0`,stroke:t,"stroke-width":a}}]}case"crosshatch":return[{tag:"path",attrs:{d:`M 0 ${e} L ${e} 0 M 0 0 L ${e} ${e}`,stroke:t,"stroke-width":i}}];case"zigzag":{let a=n?.amplitude!=null?Math.max(.05,Math.min(.5,n.amplitude)):.25,o=e*a;return[{tag:"path",attrs:{d:`M 0 ${o} L ${e/4} 0 L ${e/2} ${o} L ${e*3/4} 0 L ${e} ${o}`,fill:"none",stroke:t,"stroke-width":i}}]}case"waves":{let a=n?.amplitude!=null?Math.max(.05,Math.min(.5,n.amplitude)):.25,o=e*a,l=e/2;return[{tag:"path",attrs:{d:`M 0 ${l} Q ${e/4} ${l-o} ${e/2} ${l} T ${e} ${l}`,fill:"none",stroke:t,"stroke-width":i}}]}case"triangles":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${a} L 0 ${a} Z`,fill:"none",stroke:t,"stroke-width":i}}]}case"hexagons":{let a=e*.866;return[{tag:"path",attrs:{d:`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${a*.5} L ${e*.75} ${a} L ${e*.25} ${a} L 0 ${a*.5} Z`,fill:"none",stroke:t,"stroke-width":i}}]}case"diamonds":return[{tag:"path",attrs:{d:`M ${e/2} 0 L ${e} ${e/2} L ${e/2} ${e} L 0 ${e/2} Z`,fill:"none",stroke:t,"stroke-width":i}}];case"circles":return[{tag:"circle",attrs:{cx:e/2,cy:e/2,r:e/3,fill:"none",stroke:t,"stroke-width":i}}];case"bricks":{let a=n?.strokeWidth!=null?Math.max(.5,e*n.strokeWidth):Math.max(1,e/15);return[{tag:"rect",attrs:{x:0,y:0,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:-e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}},{tag:"rect",attrs:{x:e/2,y:e/2,width:e,height:e/2,fill:"none",stroke:t,"stroke-width":a}}]}case"herringbone":return[{tag:"path",attrs:{d:`M 0 0 L ${e/2} ${e/2} L 0 ${e} M ${e/2} ${e/2} L ${e} 0 M ${e/2} ${e/2} L ${e} ${e}`,fill:"none",stroke:t,"stroke-width":i}}];default:return[]}}function ti(r){let e=Object.entries(r.attrs).map(([t,n])=>` ${t}="${n}"`).join("");return`<${r.tag}${e}/>`}function je(r,e,t,n,i){let a=10*e,o="";o+=`<rect width="${a}" height="${a}" fill="${n}"/>`;let l=ue(r,a,t,i);for(let u of l)o+=ti(u);return{svgContent:o,width:a,height:a}}var ce="0 0 10 10",We=6,He=6;function te(){return[{id:"line-marker-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-open-arrow",refX:10,refY:5,element:{tag:"path",attrs:{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"context-stroke","stroke-width":1.5,"stroke-linejoin":"round","stroke-linecap":"round"}}},{id:"line-marker-circle",refX:5,refY:5,element:{tag:"circle",attrs:{cx:5,cy:5,r:3.2,fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-diamond",refX:5,refY:5,element:{tag:"path",attrs:{d:"M 5 0 L 10 5 L 5 10 L 0 5 Z",fill:"context-stroke",stroke:"context-stroke"}}},{id:"line-marker-square",refX:5,refY:5,element:{tag:"rect",attrs:{x:1.5,y:1.5,width:7,height:7,fill:"context-stroke",stroke:"context-stroke"}}}]}var It={"line-marker-arrow":"mkr-builtin-arrow","line-marker-open-arrow":"mkr-builtin-open-arrow","line-marker-circle":"mkr-builtin-circle","line-marker-diamond":"mkr-builtin-diamond","line-marker-square":"mkr-builtin-square"},ri={"mkr-builtin-arrow":"Arrow","mkr-builtin-open-arrow":"Open Arrow","mkr-builtin-circle":"Circle","mkr-builtin-diamond":"Diamond","mkr-builtin-square":"Square"};function $r(){return te().map(r=>{let e=It[r.id]??r.id;return{kind:"marker",id:e,name:ri[e]??e,viewBox:ce,refX:r.refX,refY:r.refY,markerWidth:6,markerHeight:6,markerUnits:"strokeWidth",orient:"auto-start-reverse",shapes:[],builtIn:!0}})}function f(r,e){return e==null||e===""?"":` ${r}="${D(String(e))}"`}function Z(r,e){let t=r.rawTransform;if(t)return t;let n=r.rotation??0,i=r.skewX??0,a=r.skewY??0,o=r.scaleX??1,l=r.scaleY??1;if(n===0&&i===0&&a===0&&o===1&&l===1)return null;let u=r.customPivot??e;if(!u)return null;let c=[];return c.push(`translate(${u.x}, ${u.y})`),n!==0&&c.push(`rotate(${n})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),i!==0&&c.push(`skewX(${i})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`),c.join(" ")}function ni(r,e,t){let n=r.rotation??0,i=r.skewX??0,a=r.skewY??0,o=r.scaleX??1,l=r.scaleY??1,u=r.customPivot??{x:e,y:t},c=[];return(n!==0||i!==0||a!==0||o!==1||l!==1)&&(c.push(`translate(${u.x}, ${u.y})`),n!==0&&c.push(`rotate(${n})`),(o!==1||l!==1)&&c.push(`scale(${o}, ${l})`),i!==0&&c.push(`skewX(${i})`),a!==0&&c.push(`skewY(${a})`),c.push(`translate(${-u.x}, ${-u.y})`)),c.push(`translate(${e}, ${t})`),c.join(" ")}function ii(r){if(typeof r=="string"){let n=r.trim();return n.length>0?n:void 0}if(!r||typeof r!="object")return;let e=r,t=[];return e.underline&&t.push("underline"),e.strikethrough&&t.push("line-through"),e.overline&&t.push("overline"),t.length>0?t.join(" "):void 0}function si(r){if(typeof r.strokeDasharray=="string")return r.strokeDasharray;let e=r.lineStyle??"solid",t=r.dashLength??8,n=r.gapLength??4;return ie(e,t,n)}function ai(r){let e=r.fillType;return e||(r.fillGradient?r.fillGradient.r!==void 0?"radial-gradient":"linear-gradient":r.linearGradient?"linear-gradient":r.radialGradient?"radial-gradient":"solid")}function oi(r){return r.fillGradient??r.linearGradient??r.radialGradient??void 0}function H(r,e){let t=f("data-shape-id",e),n=ai(r),i=oi(r);if(n==="none")t+=f("fill","none");else if(n==="linear-gradient"||n==="radial-gradient"){let _=r.fillLibraryId??i?.id;t+=f("fill",`url(#${_??`gradient-fill-${e}`})`)}else if(n==="pattern"){let _=r.fillLibraryId??i?.id;t+=f("fill",`url(#${_??`pattern-fill-${e}`})`)}else t+=f("fill",r.fillColor??"#000000");let a=r.opacity;a!==void 0&&a<1&&(t+=f("opacity",a));let o=r.fillOpacity;o!==void 0&&o<1&&(t+=f("fill-opacity",o));let l=r.fillRule;l&&l!=="nonzero"&&(t+=f("fill-rule",l));let u=r.strokeType??"solid",c=r.strokeGradient;if(u==="none")t+=f("stroke","none");else if(u==="linear-gradient"||u==="radial-gradient"){let _=r.strokeLibraryId??c?.id;t+=f("stroke",`url(#${_??`gradient-stroke-${e}`})`)}else if(u==="pattern"){let _=r.strokeLibraryId??c?.id;t+=f("stroke",`url(#${_??`pattern-stroke-${e}`})`)}else t+=f("stroke",r.borderColor??"none");let h=r.borderWidth;h!=null&&(t+=f("stroke-width",h));let d=r.strokeOpacity;d!==void 0&&d<1&&(t+=f("stroke-opacity",d));let m=r.paintOrder;m&&m!=="normal"&&(t+=f("paint-order",m));let p=r.markerStart,y=r.markerMid,g=r.markerEnd;p&&(t+=f("marker-start",`url(#${p})`)),y&&(t+=f("marker-mid",`url(#${y})`)),g&&(t+=f("marker-end",`url(#${g})`));let $=si(r);$&&(t+=f("stroke-dasharray",$),!r.strokeDasharray&&r.lineStyle==="dotted"&&(t+=f("stroke-linecap","round")));let w=r.dashOffset;w!==void 0&&w!==0&&(t+=f("stroke-dashoffset",w));let x=r.shapeRendering;x&&x!=="auto"&&(t+=f("shape-rendering",x)),t+=ze(e,r.filters,r.filterLibraryIds);let S=r.metadata;return S&&(S.role&&(t+=f("role",S.role)),S.ariaLabel&&(t+=f("aria-label",S.ariaLabel))),t}function li(r){let e=r.metadata;if(!e)return"";let t="";return e.title&&(t+=`<title>${D(e.title)}</title>`),e.description&&(t+=`<desc>${D(e.description)}</desc>`),t}function ui(r,e){let t=li(e);if(!t)return r;let n=r.lastIndexOf("/>");if(n===-1){let o=r.indexOf(">");return o===-1?r:r.slice(0,o+1)+t+r.slice(o+1)}let i=r.match(/^<(\w+)/),a=i?i[1]:"g";return r.slice(0,n)+">"+t+`</${a}>`}function Et(r){let e="",t=r.startEndpoint,n=r.endEndpoint;return t&&t!=="none"&&(e+=f("marker-start",`url(#line-marker-${t})`)),n&&n!=="none"&&(e+=f("marker-end",`url(#line-marker-${n})`)),e}function Ft(r){let e=r.state,t=e.x??0,n=e.y??0,i=e.radius??50,a=Z(e,{x:t,y:n});return`<circle${f("cx",t)}${f("cy",n)}${f("r",i)}${H(e,r.id)}${a?f("transform",a):""}/>`}function Lt(r){let e=r.state,t=e.cx??0,n=e.cy??0,i=e.rx??50,a=e.ry??30,o=Z(e,{x:t,y:n});return`<ellipse${f("cx",t)}${f("cy",n)}${f("rx",i)}${f("ry",a)}${H(e,r.id)}${o?f("transform",o):""}/>`}function Dt(r){let e=r.state,t=e,n=e.x??0,i=e.y??0,a=e.width??100,o=e.height??100,l=e.cornerRadius??0,u=t.cornerShape??"round",c=t.cornerMode??"uniform",h={x:n+a/2,y:i+o/2},d=Z(e,h);if(u!=="round"||c==="non-uniform"){let m=Be(n,i,a,o,l,u,c,c==="non-uniform"?{radiusTL:t.cornerRadiusTL,radiusTR:t.cornerRadiusTR,radiusBR:t.cornerRadiusBR,radiusBL:t.cornerRadiusBL,shapeTL:t.cornerShapeTL,shapeTR:t.cornerShapeTR,shapeBR:t.cornerShapeBR,shapeBL:t.cornerShapeBL}:void 0);if(m)return`<path${f("d",m)}${H(e,r.id)}${d?f("transform",d):""}/>`}return`<rect${f("x",n)}${f("y",i)}${f("width",a)}${f("height",o)}${l>0?f("rx",l):""}${H(e,r.id)}${d?f("transform",d):""}/>`}function Ot(r){let e=r.state,t=e.x1??0,n=e.y1??0,i=e.x2??100,a=e.y2??100,o={x:(t+i)/2,y:(n+a)/2},l=Z(e,o);return`<line${f("x1",t)}${f("y1",n)}${f("x2",i)}${f("y2",a)}${H(e,r.id)}${Et(e)}${l?f("transform",l):""}/>`}function Gt(r){let e=r.state,t=e.x??0,n=e.y??0,i=e.text??"",a=e.fontSize??16,o=e.fontFamily??"sans-serif",l=e.fontWeight??"normal",u=e.fontStyle??"normal",c=e.textAnchor??"start",h=ii(e.textDecoration),d=e.letterSpacing,p=Z(e,{x:t,y:n}),y=f("x",t)+f("y",n);y+=f("font-size",a),y+=f("font-family",o),l!=="normal"&&(y+=f("font-weight",l)),u!=="normal"&&(y+=f("font-style",u)),c!=="start"&&(y+=f("text-anchor",c)),h&&(y+=f("text-decoration",h)),d&&(y+=f("letter-spacing",d));let g=e.textLength;g!==void 0&&g>0&&(y+=f("textLength",g),e.lengthAdjust==="spacingAndGlyphs"&&(y+=f("lengthAdjust","spacingAndGlyphs")));let $=e.textDirection;$&&$!=="ltr"&&(y+=f("direction",$));let w=e.unicodeBidi;w&&w!=="normal"&&(y+=f("unicode-bidi",w));let x=e.fontVariationSettings;if(x&&Object.keys(x).length>0){let _=Object.entries(x).map(([A,C])=>`'${A}' ${C}`).join(", ");y+=f("style",`font-variation-settings: ${_}`)}if(y+=H(e,r.id),p&&(y+=f("transform",p)),e.isTextPath&&e.textPathPoints){let _=e.textPathPoints,A=e.textPathStartOffset??0,C=e.textPathSide,b=`text-path-${r.id}`,k="";if(_.length>=2)if(C==="right"){let v=_[_.length-1];k=`M ${v.x} ${v.y}`;for(let L=_.length-1;L>0;L--){let P=_[L],R=_[L-1],F=P.handleIn??P,I=R.handleOut??R;k+=` C ${F.x} ${F.y}, ${I.x} ${I.y}, ${R.x} ${R.y}`}}else{k=`M ${_[0].x} ${_[0].y}`;for(let v=0;v<_.length-1;v++){let L=_[v],P=_[v+1],R=L.handleOut??L,F=P.handleIn??P;k+=` C ${R.x} ${R.y}, ${F.x} ${F.y}, ${P.x} ${P.y}`}}return`<defs><path id="${D(b)}"${f("d",k)} fill="none"/></defs><text${y}><textPath href="#${D(b)}"${f("startOffset",`${A}%`)}>${D(i)}</textPath></text>`}if(e.charOffsets&&Array.isArray(e.charOffsets)&&e.charOffsets.length>0){let _=Array.from(i),A=0,C=0,b="";for(let k=0;k<_.length;k++){let v=e.charOffsets[k]??{x:0,y:0,rotate:0},L=v.x-A,P=v.y-C,R=f("dx",L)+f("dy",P);v.rotate!==0&&(R+=f("rotate",v.rotate)),b+=`<tspan${R}>${D(_[k])}</tspan>`,A=v.x,C=v.y}return`<text${y}>${b}</text>`}if(e.richTextData&&typeof e.richTextData=="object"){let _=e.richTextData;if(Array.isArray(_.lines)&&_.lines.length>0){let A=e.linePositions,C=typeof _.lineHeight=="number"?_.lineHeight:1.2,b=a*C,k=_.baseStyle??{},v="";return _.lines.forEach((L,P)=>{L.segments.forEach((R,F)=>{let I="";if(F===0){let O=A?.[P];O?((Math.abs(O.x)>.001||P>0)&&(I+=f("x",t+O.x)),(Math.abs(O.dy)>.001||P>0)&&(I+=f("dy",O.dy))):P>0&&(I+=f("x",t),I+=f("dy",`${b}px`))}I+=ci(R.style??{},k),I+=' xml:space="preserve"',v+=`<tspan${I}>${D(R.text)}</tspan>`})}),`<text${y}>${v}</text>`}}return`<text${y}>${D(i)}</text>`}function ci(r,e){let t="";r.fontFamily!==void 0&&r.fontFamily!==e.fontFamily&&(t+=f("font-family",String(r.fontFamily))),r.fontSize!==void 0&&r.fontSize!==e.fontSize&&(t+=f("font-size",String(r.fontSize))),r.fontWeight!==void 0&&r.fontWeight!==e.fontWeight&&(t+=f("font-weight",String(r.fontWeight))),r.fontStyle!==void 0&&r.fontStyle!==e.fontStyle&&(t+=f("font-style",String(r.fontStyle)));let n=r.textDecoration,i=e.textDecoration;if(n&&(!i||n.underline!==i.underline||n.strikethrough!==i.strikethrough||n.overline!==i.overline)){let o=[];n.underline&&o.push("underline"),n.strikethrough&&o.push("line-through"),n.overline&&o.push("overline"),o.length>0&&(t+=f("text-decoration",o.join(" ")))}if(r.baselineShift!==void 0&&r.baselineShift!==e.baselineShift){let a=r.baselineShift;a==="super"||a==="sub"?t+=f("baseline-shift",a):typeof a=="number"&&(t+=f("baseline-shift",`${a}px`))}return r.letterSpacing!==void 0&&r.letterSpacing!==e.letterSpacing&&(t+=f("letter-spacing",String(r.letterSpacing))),r.fill!==void 0&&r.fill!==e.fill&&(t+=f("fill",String(r.fill))),r.fillOpacity!==void 0&&r.fillOpacity!==e.fillOpacity&&(t+=f("fill-opacity",String(r.fillOpacity))),r.direction!==void 0&&r.direction!==e.direction&&(t+=f("direction",String(r.direction))),r.unicodeBidi!==void 0&&r.unicodeBidi!==e.unicodeBidi&&(t+=f("unicode-bidi",String(r.unicodeBidi))),t}function Bt(r){let e=r.state,t=e.splinePoints??[],n=e.splineCurveType??"CUBIC",i=e.splineClosed??!1,a=e.splineTension??.5,o=e.splineArcParams,l=Ue(t,n,i,a,o),u=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,c=u?Z(e,u):null;return`<path${f("d",l)}${H(e,r.id)}${Et(e)}${c?f("transform",c):""}/>`}function Ut(r){let e=r.state,t=e.polylinePoints??[],n=e.polylineClosed??!1,i=t.map(u=>`${u.x},${u.y}`).join(" "),a=t.length>0?e.customPivot??{x:t[0].x,y:t[0].y}:void 0,o=a?Z(e,a):null;return`<${n?"polygon":"polyline"}${f("points",i)}${H(e,r.id)}${Et(e)}${o?f("transform",o):""}/>`}function Nt(r){let e=r.state,t=e.x??0,n=e.y??0,i=e.width??100,a=e.height??100,o=e.href??"",l=e.imageOpacity,u=e.preserveAspectRatio?"xMidYMid meet":"none",c={x:t+i/2,y:n+a/2},h=Z(e,c);return`<image${f("x",t)}${f("y",n)}${f("width",i)}${f("height",a)}${f("href",o)}${f("preserveAspectRatio",u)}${l!==void 0&&l<1?f("opacity",l):""}${H(e,r.id)}${h?f("transform",h):""}/>`}function Vt(r){let e=r.state,t=e.cx??0,n=e.cy??0,i=e.radius??50,a=e.cornerRadius??0,o=e.shiftAngle??-90,l=e.fillRule??"nonzero",u=ni(e,t,n),c="";switch(r.type){case"triangle":c=V(le(3,i,o),a,i);break;case"ngon":{let d=e.sides??6;c=V(le(d,i,o),a,i);break}case"star":{let d=e.arms??5,m=e.innerRadiusPercent??50;c=V(Re(d,i,m,o),a,i);break}case"cross":{let d=e.armWidthPercent??40;c=V(Ae(i,d,o),a,i);break}case"ring":{let d=e.innerRadiusPercent??50;c=De(i,d,l);break}case"spiral":{let d=e.turns??3,m=e.thicknessPercent??20,p=e.spiralDirection??1;c=Oe(i,d,m,p,o);break}case"gear":{let d=e.teeth??8,m=e.toothDepthPercent??30,p=e.holeRadiusPercent??0;c=Ge(d,i,m,a,p,l,o);break}case"arrow":{let d=e.headWidthPercent??100,m=e.headLengthPercent??30,p=e.shaftWidthPercent??40;c=V(Ce(i,d,m,p,o),a,i);break}case"speechBubble":{let d=e.tailAngleDeg??45,m=e.tailLengthPercent??40,p=e.tailWidthPercent??25;c=V(Ie(i,d,m,p,o),a,i);break}case"lightning":{let d=e.boltSegments??3,m=e.boltJaggednessPercent??40,p=e.boltWidthPercent??30;c=V(Ee(i,d,m,p,o),a,i);break}case"heart":{let d=e.lobeRadiusPercent??50,m=e.cleftDepthPercent??25;c=Fe(i,d,m,o);break}case"cloud":{let d=e.cloudBumps??5,m=e.cloudPuffinessPercent??60;c=Le(i,d,m,o);break}default:return`<!-- unsupported polygon shape: ${D(r.type)} -->`}let h="";return(r.type==="ring"||r.type==="gear")&&(h=f("fill-rule",l)),`<path${f("d",c)}${h}${H(e,r.id)}${f("transform",u)}/>`}function G(r){let e;switch(r.type){case"circle":e=Ft(r);break;case"ellipse":e=Lt(r);break;case"rectangle":case"square":e=Dt(r);break;case"line":e=Ot(r);break;case"text":e=Gt(r);break;case"spline":e=Bt(r);break;case"polyline":e=Ut(r);break;case"image":e=Nt(r);break;case"triangle":case"ngon":case"star":case"cross":case"ring":case"spiral":case"gear":case"arrow":case"speechBubble":case"lightning":case"heart":case"cloud":e=Vt(r);break;default:return`<!-- unsupported shape type: ${D(r.type)} -->`}return ui(e,r.state)}function xr(r,e){let t=(e.stops??[]).map(n=>{let i=`<stop${f("offset",`${n.offset*100}%`)}${f("stop-color",n.color)}`;return n.opacity!==void 0&&n.opacity<1&&(i+=f("stop-opacity",n.opacity)),i+="/>",i}).join("");return`<linearGradient${f("id",r)}${f("x1",`${e.x1*100}%`)}${f("y1",`${e.y1*100}%`)}${f("x2",`${e.x2*100}%`)}${f("y2",`${e.y2*100}%`)}${e.spreadMethod?f("spreadMethod",e.spreadMethod):""}>${t}</linearGradient>`}function Sr(r,e){let t=(e.stops??[]).map(o=>{let l=`<stop${f("offset",`${o.offset*100}%`)}${f("stop-color",o.color)}`;return o.opacity!==void 0&&o.opacity<1&&(l+=f("stop-opacity",o.opacity)),l+="/>",l}).join(""),n="",i=e.ry!==void 0&&e.ry!==e.r,a=!!e.rotation;if(i||a){let o=e.cx??.5,l=e.cy??.5,u=[];u.push(`translate(${o}, ${l})`),a&&u.push(`rotate(${e.rotation})`),i&&e.ry!==0&&u.push(`scale(1, ${e.ry/e.r})`),u.push(`translate(-${o}, -${l})`),n=f("gradientTransform",u.join(" "))}return`<radialGradient${f("id",r)}${f("cx",`${e.cx*100}%`)}${f("cy",`${e.cy*100}%`)}${f("fx",`${e.fx*100}%`)}${f("fy",`${e.fy*100}%`)}${f("r",`${e.r*100}%`)}${e.spreadMethod?f("spreadMethod",e.spreadMethod):""}${n}>${t}</radialGradient>`}function _r(r,e){if(e.svgContent!=null){let l=e.width??10,u=e.height??10,c=e.patternUnits??"userSpaceOnUse",h=e.patternContentUnits,d=e.patternTransform,m=e.viewBox,p=e.preserveAspectRatio,y=e.x??0,g=e.y??0,$=`<pattern${f("id",r)}`;return $+=f("patternUnits",c),h&&($+=f("patternContentUnits",h)),y&&($+=f("x",y)),g&&($+=f("y",g)),$+=f("width",l),$+=f("height",u),m&&($+=f("viewBox",m)),p&&($+=f("preserveAspectRatio",p)),d&&($+=f("patternTransform",d)),$+=`>${e.svgContent}</pattern>`,$}let t=10*(e.scale??1),n=e.rotation??0,i=e.color||"#000000",a=e.backgroundColor||"#ffffff",o="";return o+=`<rect${f("width",t)}${f("height",t)}${f("fill",a)}/>`,o+=di(e.patternType,t,i),`<pattern${f("id",r)}${f("patternUnits","userSpaceOnUse")}${f("width",t)}${f("height",t)}${n?f("patternTransform",`rotate(${n})`):""}>${o}</pattern>`}function di(r,e,t){return ue(r,e,t).map(i=>{let a=Object.entries(i.attrs).map(([o,l])=>f(o,l)).join("");return`<${i.tag}${a}/>`}).join("")}function hi(r){let e=new Set,t=new Set;for(let n of r){let i=n.state;i.markerStart&&e.add(i.markerStart),i.markerMid&&e.add(i.markerMid),i.markerEnd&&e.add(i.markerEnd);let a=i.startEndpoint,o=i.endEndpoint;a&&a!=="none"&&t.add(a),o&&o!=="none"&&t.add(o)}return{ids:e,legacyEndpoints:t}}function X(r){let e=Array.isArray(r)?hi(r):r;if(e.ids.size===0&&e.legacyEndpoints.size===0)return"";let t="",n=te();for(let i of n){let a=i.id,o=a.replace("line-marker-",""),l=`mkr-builtin-${o}`,u=e.legacyEndpoints.has(o)||e.ids.has(a),c=e.ids.has(l);if(!u&&!c)continue;let h=i.element,d=Object.entries(h.attrs).map(([y,g])=>f(y,g)).join(""),m=`<${h.tag}${d}/>`,p=y=>{t+=`<marker${f("id",y)}${f("viewBox",ce)}${f("refX",i.refX)}${f("refY",i.refY)}${f("markerWidth",6)}${f("markerHeight",6)}${f("orient","auto-start-reverse")}>${m}</marker>`};u&&p(a),c&&p(l)}return t}var re=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),zt=["linear-gradient","radial-gradient","pattern","filter","marker","symbol"];function jt(r){switch(r.kind){case"symbol":return Wt(r);case"marker":return Ht(r);case"linear-gradient":return Xt(r);case"radial-gradient":return Yt(r);case"pattern":return qt(r);case"filter":return Kt(r)}}function Wt(r){let e=r.shapes.map(t=>G(t)).join("");return`<symbol id="${re(r.id)}" viewBox="${re(r.viewBox)}">${e}</symbol>`}function Ht(r){let e;if(r.builtIn){let n=te().find(i=>r.id.includes(i.id)||r.id===i.id);if(n){let i=Object.entries(n.element.attrs).map(([a,o])=>` ${a}="${re(String(o))}"`).join("");e=`<${n.element.tag}${i}/>`}else e=""}else e=r.shapes.map(n=>G(n)).join("");let t=typeof r.orient=="number"?String(r.orient):r.orient;return`<marker id="${re(r.id)}" viewBox="${re(r.viewBox)}" refX="${r.refX}" refY="${r.refY}" markerWidth="${r.markerWidth}" markerHeight="${r.markerHeight}" markerUnits="${re(r.markerUnits)}" orient="${re(t)}">${e}</marker>`}function Xt(r){let e={...r.gradient,type:"linear-gradient",id:r.id};return xr(r.id,e)}function Yt(r){let e={...r.gradient,type:"radial-gradient",id:r.id};return Sr(r.id,e)}function qt(r){let e={...r.pattern,type:"pattern",id:r.id};return _r(r.id,e)}function Kt(r){return Ct(r.id,r.filters,{colorInterpolation:r.colorInterpolation,filterUnits:r.filterUnits,primitiveUnits:r.primitiveUnits,x:r.x,y:r.y,width:r.width,height:r.height})}function Zt(r){let e=new Map;for(let n of r){let i=e.get(n.kind);i?i.push(n):e.set(n.kind,[n])}let t="";for(let n of zt){let i=e.get(n);if(i)for(let a of i)t+=jt(a)}return t}function kr(r){let e=new Set,t=n=>{typeof n=="string"&&n&&e.add(n)};for(let n of r){let i=n.state;if(!i)continue;t(i.fillLibraryId),t(i.strokeLibraryId),t(i.markerStart),t(i.markerMid),t(i.markerEnd),t(i.symbolId);let a=i.filterLibraryIds;if(Array.isArray(a))for(let o of a)t(o)}return e}function Y(r,e){let t=new Map;for(let l of e)t.set(l.id,l);let n=new Map,i=l=>{if(!l)return;let u=t.get(l);u&&n.set(l,u)},a=(l,u)=>{if(!l||typeof l!="object")return;let c=l;if(!c.id||n.has(c.id))return;let h=u==="linear-gradient"?"linear-gradient":u==="radial-gradient"?"radial-gradient":u==="pattern"?"pattern":null;if(!h)return;let{id:d,sourceId:m,...p}=l,y;if(h==="linear-gradient")y={kind:"linear-gradient",id:c.id,name:m??c.id,sourceId:m,gradient:p};else if(h==="radial-gradient")y={kind:"radial-gradient",id:c.id,name:m??c.id,sourceId:m,gradient:p};else{let{customPatternId:g,...$}=p;y={kind:"pattern",id:c.id,name:m??c.id,sourceId:m,pattern:$}}n.set(c.id,y)},o=(l,u)=>{let c=l.filters;if(!Array.isArray(c)||c.length===0)return;let h=`filter-${u}`;n.has(h)||n.set(h,{kind:"filter",id:h,name:h,filters:c,...l.filterColorInterpolation&&l.filterColorInterpolation!=="auto"?{colorInterpolation:l.filterColorInterpolation}:{},...l.filterUnits?{filterUnits:l.filterUnits}:{},...l.primitiveUnits?{primitiveUnits:l.primitiveUnits}:{},...typeof l.filterX=="string"?{x:l.filterX}:{},...typeof l.filterY=="string"?{y:l.filterY}:{},...typeof l.filterWidth=="string"?{width:l.filterWidth}:{},...typeof l.filterHeight=="string"?{height:l.filterHeight}:{}})};for(let l of r){let u=l.state;if(!u)continue;i(u.fillLibraryId),i(u.strokeLibraryId),i(u.markerStart),i(u.markerMid),i(u.markerEnd),i(u.symbolId);let c=u.filterLibraryIds;if(Array.isArray(c))for(let h of c)typeof h=="string"&&i(h);u.fillLibraryId||a(u.fillGradient,u.fillType),u.strokeLibraryId||a(u.strokeGradient,u.strokeType),(!Array.isArray(c)||c.length===0)&&o(u,l.id)}return n.size===0?"":Zt(Array.from(n.values()))}var pi={x:"x",y:"y",cx:"cx",cy:"cy",x1:"x1",y1:"y1",x2:"x2",y2:"y2",posX:"x",posY:"y",radius:"r",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",opacity:"opacity",fillOpacity:"fill-opacity",strokeOpacity:"stroke-opacity",fillColor:"fill",strokeColor:"stroke",strokeWidth:"stroke-width",borderWidth:"stroke-width",cornerRadius:"rx",fontSize:"font-size"},fi=new Set(["rotation","skewX","skewY"]);function mi(r){let t=me[r];return t?t.join(" "):"0 0 1 1"}function de(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Qt(r){return r.cycleDuration!==void 0&&r.cycleDuration>0?r.cycleDuration:r.keyframes.length===0?0:r.keyframes[r.keyframes.length-1].time}function Jt(r,e){let t=r.keyframes;if(t.length===0)return{values:[],keyTimes:[],keySplines:[]};let n=t.map(o=>String(o.value)),i=t.map(o=>e>0?(o.time/e).toFixed(4):"0"),a=[];for(let o=1;o<t.length;o++)a.push(mi(t[o].easing));return{values:n,keyTimes:i,keySplines:a}}function er(r){let e=r.beginTrigger;if(!e)return"0s";switch(e.type){case"time":return`${e.value}s`;case"event":return e.value;default:return"0s"}}function tr(r){return r.cycleInfinite?"indefinite":r.cycleRepeats&&r.cycleRepeats>1?String(r.cycleRepeats):null}function gi(r){let e=pi[r.property];if(!e)return"";let t=Qt(r);if(t<=0)return"";let{values:n,keyTimes:i,keySplines:a}=Jt(r,t);if(n.length<2)return"";let o=`<animate attributeName="${de(e)}"`;o+=` values="${de(n.join(";"))}"`,o+=` keyTimes="${i.join(";")}"`,a.length>0&&a.some(u=>u!=="0 0 1 1")&&(o+=' calcMode="spline"',o+=` keySplines="${a.join(";")}"`),o+=` dur="${t}s"`,o+=` begin="${er(r)}"`;let l=tr(r);return l&&(o+=` repeatCount="${l}"`),o+=' fill="freeze"',o+="/>",o}function yi(r){let e;switch(r.property){case"rotation":e="rotate";break;case"skewX":e="skewX";break;case"skewY":e="skewY";break;default:return""}let t=Qt(r);if(t<=0)return"";let{values:n,keyTimes:i,keySplines:a}=Jt(r,t);if(n.length<2)return"";let o=e==="rotate"&&r.transformOrigin?n.map(c=>`${c} ${r.transformOrigin.x} ${r.transformOrigin.y}`):n,l='<animateTransform attributeName="transform"';l+=` type="${e}"`,l+=` values="${de(o.join(";"))}"`,l+=` keyTimes="${i.join(";")}"`,a.length>0&&a.some(c=>c!=="0 0 1 1")&&(l+=' calcMode="spline"',l+=` keySplines="${a.join(";")}"`),l+=` dur="${t}s"`,l+=` begin="${er(r)}"`;let u=tr(r);return u&&(l+=` repeatCount="${u}"`),l+=` additive="${r.additive??"sum"}"`,l+=' fill="freeze"',l+="/>",l}function bi(r){if(!r.motionPath)return"";let e=Qt(r);if(e<=0)return"";let{keyTimes:t,keySplines:n}=Jt(r,e),i=r.keyframes.map(c=>{let h=typeof c.value=="number"?c.value:parseFloat(c.value);return Math.max(0,Math.min(1,h))}),a=!!r.motionPathRef&&(r.motionPathRef.mode??"trackShape")==="curveTemplate",o="<animateMotion";a||(o+=` path="${de(r.motionPath)}"`),o+=` keyTimes="${t.join(";")}"`,o+=` keyPoints="${i.join(";")}"`,n.length>0&&n.some(c=>c!=="0 0 1 1")&&(o+=' calcMode="spline"',o+=` keySplines="${n.join(";")}"`),o+=` dur="${e}s"`,o+=` begin="${er(r)}"`;let l=tr(r);l&&(o+=` repeatCount="${l}"`),o+=' fill="freeze"';let u=r.motionRotate??"auto";return o+=` rotate="${u}"`,a?o+=`><mpath href="#${de(r.motionPathRef.shapeId)}"/></animateMotion>`:o+="/>",o}function Xe(r){let e=new Map;for(let t of r.tracks){if(!t.enabled||t.keyframes.length<2)continue;let n=[...t.keyframes].sort((o,l)=>o.time-l.time),i={...t,locked:t.locked??!1,keyframes:n.map(o=>({time:o.time,value:o.value,easing:o.easing}))},a="";if(t.property==="pathMotion"&&t.motionPath?a=bi(i):fi.has(t.property)?a=yi(i):a=gi(i),a){let o=e.get(t.shapeId)??[];o.push(a),e.set(t.shapeId,o)}}return e}function se(r,e={}){let{xmlDeclaration:t=!0,backgroundColor:n,indent:i=!0,className:a}=e,o=r.viewboxes?.[0],l=e.width??o?.width??800,u=e.height??o?.height??600,c=e.viewBox??`0 0 ${l} ${u}`,h=i?`
|
|
7
|
+
`:"",d=i?" ":"",m=r.shapes??[],p=m.filter(R=>R.state?.displayMode==="motionOnly"),y=m.filter(R=>R.state?.displayMode!=="motionOnly"),g=_i(r),$=ki(r),w=[...Array.isArray(r.library)?r.library:[],...($??[]).filter(R=>!R.builtIn&&!(Array.isArray(r.library)&&r.library.some(F=>F.id===R.id)))],x=Y(y,w),S=X(y),_=Mi(g,y),A=$i(p),C=x.length>0||S.length>0||_.length>0||A.length>0,b="";C&&(b=`${h}${d}<defs>${h}`,x.length>0&&(b+=`${d}${d}${x}${h}`),S.length>0&&(b+=`${d}${d}${S}${h}`),_.length>0&&(b+=`${d}${d}${_}${h}`),A.length>0&&(b+=`${d}${d}${A}${h}`),b+=`${d}</defs>`);let k="";n&&(k=`${h}${d}<rect width="${l}" height="${u}" fill="${n}"/>`);let v=r.animationTimeline?Xe(r.animationTimeline):null,L=y.map(R=>{let F=R.type==="symbol-instance"?vi(R,g):G(R),I=v?.get(R.id);return I&&I.length>0&&(F=Ri(F,I,d)),`${d}${F}`}).join(h),P="";return t&&(P+=`<?xml version="1.0" encoding="UTF-8"?>${h}`),P+='<svg xmlns="http://www.w3.org/2000/svg"',P+=` width="${l}" height="${u}"`,P+=` viewBox="${c}"`,a&&(P+=` class="${a}"`),P+=">",P+=b,P+=k,y.length>0&&(P+=`${h}${L}`),P+=`${h}</svg>${h}`,P}function $i(r){if(r.length===0)return"";let e=[];for(let t of r){let n=xi(t);if(!n)continue;let i=Si(n);e.push(`<path id="${wr(t.id)}" d="${wr(i)}"/>`)}return e.join("")}function xi(r){let e=r.state;if(typeof e?.d=="string")return e.d;switch(r.type){case"rectangle":{let t=e?.x??0,n=e?.y??0,i=e?.width??0,a=e?.height??0;return i<=0||a<=0?null:`M${t},${n}h${i}v${a}h${-i}Z`}case"circle":{let t=e?.cx??0,n=e?.cy??0,i=e?.radius??0;return i<=0?null:`M${t-i},${n}A${i},${i} 0 1 0 ${t+i},${n}A${i},${i} 0 1 0 ${t-i},${n}Z`}case"ellipse":{let t=e?.cx??0,n=e?.cy??0,i=e?.rx??0,a=e?.ry??0;return i<=0||a<=0?null:`M${t-i},${n}A${i},${a} 0 1 0 ${t+i},${n}A${i},${a} 0 1 0 ${t-i},${n}Z`}case"line":{let t=e?.x1??0,n=e?.y1??0,i=e?.x2??0,a=e?.y2??0;return`M${t},${n}L${i},${a}`}default:return null}}function Si(r){let e=/[Mm]\s*(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)[\s,]+(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/.exec(r);if(!e)return r;let t=parseFloat(e[1]),n=parseFloat(e[2]);if(!isFinite(t)||!isFinite(n)||t===0&&n===0)return r;let i=!0;return r.replace(/([MLCQSTHVAZ])\s*([\d\s.,e+-]*)/gi,(a,o,l)=>{let u=o.toUpperCase(),c=o!==u,h=i;if(i=!1,u==="Z")return a;let d=l.trim().split(/[\s,]+/).filter(p=>p.length>0).map(Number);if(d.length===0||c&&!h)return a;let m=[];if(u==="H")for(let p of d)m.push(p-t);else if(u==="V")for(let p of d)m.push(p-n);else if(u==="A")for(let p=0;p<d.length;p+=7)m.push(d[p],d[p+1],d[p+2],d[p+3],d[p+4]),p+5<d.length&&m.push(d[p+5]-t),p+6<d.length&&m.push(d[p+6]-n);else for(let p=0;p<d.length;p+=2)m.push(d[p]-t),p+1<d.length&&m.push(d[p+1]-n);return`${o} ${m.join(" ")}`})}function wr(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function _i(r){let t=(Array.isArray(r.library)?r.library:[]).filter(n=>n.kind==="symbol");return t.length>0?t:r.symbols??[]}function ki(r){let t=(Array.isArray(r.library)?r.library:[]).filter(n=>n.kind==="marker");return t.length>0?t:r.markers}var rr=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),wi=r=>r.replace(/[^a-zA-Z0-9_-]/g,"_");function Tr(r){let e=r.state.symbolId??"",t=r.state.variantKey??"";return r.state.symbolOverrides&&Object.keys(r.state.symbolOverrides).length>0?`${e}--ovr-${r.id}`:t?`${e}--${wi(t)}`:e}function Ti(r,e){return r.map(t=>{let n=e[t.id];return!n||Object.keys(n).length===0?t:{...t,state:{...t.state,...n}}})}function Pi(r,e){return e?r.variants?.[e]??r.shapes:r.shapes}function vi(r,e){let t=Tr(r),n=r.state.x??0,i=r.state.y??0,a=r.state.width??100,o=r.state.height??100;return`<use href="#${rr(t)}" x="${n}" y="${i}" width="${a}" height="${o}"/>`}function Mi(r,e){if(r.length===0)return"";let t=new Map;for(let a of r)t.set(a.id,a);let n=new Map;for(let a of e){if(a.type!=="symbol-instance")continue;let o=a.state.symbolId??"",l=t.get(o);if(!l)continue;let u=Tr(a);if(n.has(u))continue;let c=Pi(l,a.state.variantKey??""),h=a.state.symbolOverrides;h&&Object.keys(h).length>0&&(c=Ti(c,h)),n.set(u,{def:l,resolved:c})}if(n.size===0)return"";let i=[];for(let[a,{def:o,resolved:l}]of n){let u=l.map(c=>G(c)).join("");i.push(`<symbol id="${rr(a)}" viewBox="${rr(o.viewBox)}">${u}</symbol>`)}return i.join("")}function Ri(r,e,t){let n=e.join(""),i=r.lastIndexOf("/>");if(i!==-1){let o=r.match(/^<(\w+)/),l=o?o[1]:"g";return r.slice(0,i)+">"+n+`</${l}>`}let a=r.match(/<\/(\w+)>$/);if(a){let o=r.lastIndexOf(`</${a[1]}>`);return r.slice(0,o)+n+r.slice(o)}return r+n}function Ye(r,e){let t=W(r,e);return se(r,{width:t.width,height:t.height,xmlDeclaration:e.xmlDeclaration??!1,indent:!0})}function Ai(r){return r==="class"?"className":r==="for"?"htmlFor":r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Pr(r){return r.replace(/\s([a-z][a-z-]*?)=/g,(e,t)=>t.startsWith("data-")||t.startsWith("aria-")?e:` ${Ai(t)}=`)}function qe(r,e){let t=e.componentName??"SvgComponent",n=W(r,e),i=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=Array.isArray(r.library)?r.library:[],u=Y(a,l),c=X(a),h=u+c,d=h.length>0,m=a.map(y=>{let g=G(y);return`${i}${i}${i}${Pr(g)}`}),p=[];p.push("import React from 'react';"),p.push(""),o?(p.push(`interface ${t}Props {`),p.push(`${i}className?: string;`),p.push(`${i}style?: React.CSSProperties;`),p.push("}"),p.push(""),p.push(`const ${t}: React.FC<${t}Props> = ({ className, style }) => {`)):p.push(`const ${t} = ({ className, style }) => {`),p.push(`${i}return (`),p.push(`${i}${i}<svg xmlns="http://www.w3.org/2000/svg" width="${n.width}" height="${n.height}" viewBox="0 0 ${n.width} ${n.height}" className={className} style={style}>`),d&&(p.push(`${i}${i}${i}<defs>`),p.push(`${i}${i}${i}${i}${Pr(h)}`),p.push(`${i}${i}${i}</defs>`));for(let y of m)p.push(y);return p.push(`${i}${i}</svg>`),p.push(`${i});`),p.push("};"),p.push(""),p.push(`export default ${t};`),p.push(""),p.join(`
|
|
8
|
+
`)}function Ke(r,e){let t=e.componentName??"SvgComponent",n=W(r,e),i=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=Array.isArray(r.library)?r.library:[],u=Y(a,l),c=X(a),h=u+c,d=h.length>0,m=a.map(y=>`${i}${i}${G(y)}`),p=[];p.push("<template>"),p.push(`${i}<svg xmlns="http://www.w3.org/2000/svg" width="${n.width}" height="${n.height}" viewBox="0 0 ${n.width} ${n.height}" :class="className" :style="style">`),d&&(p.push(`${i}${i}<defs>`),p.push(`${i}${i}${i}${h}`),p.push(`${i}${i}</defs>`));for(let y of m)p.push(y);return p.push(`${i}</svg>`),p.push("</template>"),p.push(""),o?p.push('<script setup lang="ts">'):p.push("<script setup>"),p.push(`// ${t}`),o?(p.push("defineProps<{"),p.push(`${i}className?: string;`),p.push(`${i}style?: Record<string, string>;`),p.push("}>();")):(p.push("defineProps({"),p.push(`${i}className: { type: String, default: '' },`),p.push(`${i}style: { type: Object, default: () => ({}) },`),p.push("});")),p.push("</script>"),p.push(""),p.join(`
|
|
9
|
+
`)}var Ci=new Set(["circle","ellipse","rectangle","square","line","text","image"]);function vr(r){return r.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function Mr(r){return r.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Ii(r){if(!Ci.has(r.type))return!0;let e=r.state.metadata;return!!(e?.title||e?.description||r.type==="text"&&r.state.isTextPath)}function Ze(r,e){let t=e.componentName??"createSvg",n=W(r,e),i=e.indent??" ",a=r.shapes??[],o=e.typescript??!1,l=[];l.push("import * as d3 from 'd3';"),l.push(""),o?l.push(`export function ${t}(container: string | HTMLElement): d3.Selection<SVGSVGElement, unknown, HTMLElement, unknown> {`):l.push(`export function ${t}(container) {`),l.push(`${i}const svg = d3.select(container)`),l.push(`${i}${i}.append('svg')`),l.push(`${i}${i}.attr('xmlns', 'http://www.w3.org/2000/svg')`),l.push(`${i}${i}.attr('width', ${n.width})`),l.push(`${i}${i}.attr('height', ${n.height})`),l.push(`${i}${i}.attr('viewBox', '0 0 ${n.width} ${n.height}');`),l.push("");let u=Array.isArray(r.library)?r.library:[],c=Y(a,u),h=X(a),d=`${c}${h}`;d.length>0&&(l.push(`${i}svg.append('defs').html(\`${Mr(d)}\`);`),l.push(""));for(let m=0;m<a.length;m++){let p=a[m];if(l.push(`${i}// ${p.type}${p.state.metadata?.name?` \u2014 ${p.state.metadata.name}`:""}`),Ii(p)){l.push(`${i}svg.append('g').html(\`${Mr(G(p))}\`);`),l.push("");continue}let y=fr(p),g=Ne(p),$=`shape${m+1}`;l.push(`${i}const ${$} = svg.append('${y}')`);for(let[w,x]of g)l.push(`${i}${i}.attr('${w}', '${vr(x)}')`);p.type==="text"&&p.state.text&&l.push(`${i}${i}.text('${vr(p.state.text)}')`),l[l.length-1]=l[l.length-1]+";",l.push("")}return l.push(`${i}return svg;`),l.push("}"),l.push(""),l.join(`
|
|
10
|
+
`)}function Rr(r,e){let t=r.state.metadata?.name;return t?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):`${r.type}-${e+1}`}var Ei=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linecap","opacity","transform","filter"]);function Qe(r,e){let t=W(r,e),n=e.indent??" ",i=r.shapes??[],a=[];for(let u=0;u<i.length;u++){let c=i[u],h=Rr(c,u),d=Ne(c),m=[];for(let[p,y]of d)Ei.has(p)&&m.push(`${n}${p}: ${y};`);m.length>0&&a.push(`.${h} {
|
|
11
|
+
${m.join(`
|
|
12
12
|
`)}
|
|
13
|
-
}`)}let o=[];for(let u=0;u<i.length;u++){let c=i[u],
|
|
14
|
-
`)}function Je(n,e){let t=hi(n,e),r={...e};switch(r.format){case"svg":return Xe(t,r);case"react":return qe(t,r);case"vue":return Ke(t,r);case"d3":return Ze(t,r);case"css":return Qe(t,r);default:throw new Error(`Unsupported code format: ${r.format}`)}}function hi(n,e){return Array.isArray(n)?{shapes:n,viewboxes:[{id:"default",x:0,y:0,width:e.width??800,height:e.height??600}]}:n}var et=class n{_snapshot;constructor(e={}){let{width:t=800,height:r=600,viewboxId:i}=e,a=ae(0,0,t,r,i);this._snapshot=ge({viewboxes:[a]})}static fromSnapshot(e){let t=new n;return t._snapshot=JSON.parse(JSON.stringify(e)),t}static fromJSON(e,t){let r=ye(e,t),i=new n;return i._snapshot=r,i}add(e){let t="build"in e&&typeof e.build=="function"?e.build():e;return this._snapshot.shapes.push(t),this}addAll(...e){for(let t of e)this.add(t);return this}remove(e){let t=this._snapshot.shapes.length;return this._snapshot.shapes=this._snapshot.shapes.filter(r=>r.id!==e),this._snapshot.shapes.length<t}get shapes(){return this._snapshot.shapes}findShape(e){return this._snapshot.shapes.find(t=>t.id===e)}size(e,t){return this._snapshot.viewboxes.length>0?(this._snapshot.viewboxes[0].width=e,this._snapshot.viewboxes[0].height=t):this._snapshot.viewboxes=[ae(0,0,e,t)],this}get width(){return this._snapshot.viewboxes[0]?.width??800}get height(){return this._snapshot.viewboxes[0]?.height??600}title(e){return this._ensureMetadata(),this._snapshot.documentMetadata.title=e,this}description(e){return this._ensureMetadata(),this._snapshot.documentMetadata.description=e,this}author(e){return this._ensureMetadata(),this._snapshot.documentMetadata.author=e,this}keywords(...e){return this._ensureMetadata(),this._snapshot.documentMetadata.keywords=e,this}license(e,t){return this._ensureMetadata(),this._snapshot.documentMetadata.license=e,t!==void 0&&(this._snapshot.documentMetadata.licenseUrl=t),this}language(e){return this._ensureMetadata(),this._snapshot.documentMetadata.language=e,this}customMetadata(e){return this._ensureMetadata(),this._snapshot.documentMetadata.customMetadata={...this._snapshot.documentMetadata.customMetadata,...e},this}get meta(){return this._snapshot.documentMetadata}defineSymbol(e,t,r){this._snapshot.symbols||(this._snapshot.symbols=[]);let i=w(),a=t.map(l=>"build"in l&&typeof l.build=="function"?l.build():l),o={id:i,name:e,viewBox:r?.viewBox??"0 0 100 100",shapes:a};return r?.groups&&(o.groups=r.groups),r?.thumbnail&&(o.thumbnail=r.thumbnail),this._snapshot.symbols.push(o),i}placeSymbolInstance(e,t,r,i,a){let o={id:w(),type:"symbol-instance",state:{symbolId:e,x:t,y:r,width:i??100,height:a??100}};return this._snapshot.shapes.push(o),this}removeSymbol(e){if(!this._snapshot.symbols)return!1;let t=this._snapshot.symbols.length;return this._snapshot.symbols=this._snapshot.symbols.filter(r=>r.id!==e),this._snapshot.symbols.length<t}get symbols(){return this._snapshot.symbols??[]}addClipGroup(e,t,r){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let i=w(),a={id:i,type:"clip",clipShapeIds:e,contentShapeIds:t,parentId:null};return r?.clipPathUnits&&(a.clipPathUnits=r.clipPathUnits),r?.rawDefinition&&(a.rawDefinition=r.rawDefinition),this._snapshot.clipMaskGroups.push(a),i}addMaskGroup(e,t,r){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let i=w(),a={id:i,type:"mask",clipShapeIds:e,contentShapeIds:t,parentId:null};return r?.maskUnits&&(a.maskUnits=r.maskUnits),r?.maskContentUnits&&(a.maskContentUnits=r.maskContentUnits),r?.maskBounds&&(a.maskBounds=r.maskBounds),r?.maskType&&(a.maskType=r.maskType),r?.rawDefinition&&(a.rawDefinition=r.rawDefinition),this._snapshot.clipMaskGroups.push(a),i}removeClipMaskGroup(e){if(!this._snapshot.clipMaskGroups)return!1;let t=this._snapshot.clipMaskGroups.length;return this._snapshot.clipMaskGroups=this._snapshot.clipMaskGroups.filter(r=>r.id!==e),this._snapshot.clipMaskGroups.length<t}addGuide(e,t,r){this._snapshot.guides||(this._snapshot.guides=[]);let i=w(),a={id:i,orientation:e,position:t,controlPointOffset:0};return r?.color&&(a.color=r.color),r?.opacity!==void 0&&(a.opacity=r.opacity),this._snapshot.guides.push(a),i}removeGuide(e){if(!this._snapshot.guides)return!1;let t=this._snapshot.guides.length;return this._snapshot.guides=this._snapshot.guides.filter(r=>r.id!==e),this._snapshot.guides.length<t}clearGuides(){return this._snapshot.guides=[],this}get guides(){return this._snapshot.guides??[]}addMeasurement(e,t,r){this._snapshot.measurements||(this._snapshot.measurements=[]);let i=w(),a={id:i,type:e,points:t,visible:r?.visible??!0,snapDivisions:r?.snapDivisions??1};return r?.color&&(a.color=r.color),r?.opacity!==void 0&&(a.opacity=r.opacity),this._snapshot.measurements.push(a),i}removeMeasurement(e){if(!this._snapshot.measurements)return!1;let t=this._snapshot.measurements.length;return this._snapshot.measurements=this._snapshot.measurements.filter(r=>r.id!==e),this._snapshot.measurements.length<t}get measurements(){return this._snapshot.measurements??[]}addCustomPattern(e,t,r,i){this._snapshot.customPatterns||(this._snapshot.customPatterns=[]);let a=w();return this._snapshot.customPatterns.push({id:a,name:e,svgContent:t,width:r,height:i}),a}removeCustomPattern(e){if(!this._snapshot.customPatterns)return!1;let t=this._snapshot.customPatterns.length;return this._snapshot.customPatterns=this._snapshot.customPatterns.filter(r=>r.id!==e),this._snapshot.customPatterns.length<t}get customPatterns(){return this._snapshot.customPatterns??[]}addGroup(e,t){this._snapshot.groups||(this._snapshot.groups=[]);let r=e??w();return this._snapshot.groups.push({id:r,parentId:t??null}),r}removeGroup(e){if(!this._snapshot.groups)return!1;let t=this._snapshot.groups.length;this._snapshot.groups=this._snapshot.groups.filter(r=>r.id!==e);for(let r of this._snapshot.shapes)r.state.groupId===e&&delete r.state.groupId;return this._snapshot.groups.length<t}moveToGroup(e,t){let r=this._snapshot.shapes.find(i=>i.id===e);return r&&(r.state.groupId=t),this}removeFromGroup(e){let t=this._snapshot.shapes.find(r=>r.id===e);return t&&delete t.state.groupId,this}bringToFront(e){let t=this._snapshot.shapes.findIndex(r=>r.id===e);if(t>=0){let[r]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.push(r)}return this}sendToBack(e){let t=this._snapshot.shapes.findIndex(r=>r.id===e);if(t>=0){let[r]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.unshift(r)}return this}reorder(e,t){let r=this._snapshot.shapes.findIndex(i=>i.id===e);if(r>=0){let[i]=this._snapshot.shapes.splice(r,1),a=Math.max(0,Math.min(t,this._snapshot.shapes.length));this._snapshot.shapes.splice(a,0,i)}return this}defineVariable(e,t,r,i){this._snapshot.templateVariables||(this._snapshot.templateVariables=[]);let a=this._snapshot.templateVariables.find(o=>o.name===e);if(a)a.type=t,a.defaultValue=r,i?.label!==void 0&&(a.label=i.label),i?.description!==void 0&&(a.description=i.description);else{let o={name:e,type:t,defaultValue:r};i?.label!==void 0&&(o.label=i.label),i?.description!==void 0&&(o.description=i.description),this._snapshot.templateVariables.push(o)}return this}removeVariable(e){return this._snapshot.templateVariables&&(this._snapshot.templateVariables=this._snapshot.templateVariables.filter(t=>t.name!==e)),this}get variables(){return this._snapshot.templateVariables??[]}inspectVariables(){return ke(this._snapshot)}setTimeline(e){return"build"in e&&typeof e.build=="function"?this._snapshot.animationTimeline=e.build():this._snapshot.animationTimeline=e,this}clearTimeline(){return delete this._snapshot.animationTimeline,this}get timeline(){return this._snapshot.animationTimeline}toSVG(e){let{variables:t,...r}=e??{},i=_e(this._snapshot,t);return ie(i,r)}toJSON(e){return $e(this._snapshot,e)}toSnapshot(){return JSON.parse(JSON.stringify(this._snapshot))}toCode(e,t){return Je(this._snapshot,{...t,format:e})}_ensureMetadata(){this._snapshot.documentMetadata||(this._snapshot.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{}})}};var tt=class{_track;constructor(e,t){this._track={id:w(),shapeId:e,property:t,keyframes:[],enabled:!0,locked:!1}}id(e){return this._track.id=e,this}keyframe(e,t,r="linear"){return this._track.keyframes.push({time:e,value:t,easing:r}),this}keyframeBezier(e,t,r){return this._track.keyframes.push({time:e,value:t,easing:"custom-bezier",customBezier:r}),this}keyframeLinear(e,t,r){return this._track.keyframes.push({time:e,value:t,easing:"linear-function",linearPoints:r}),this}keyframes(...e){return this._track.keyframes.push(...e),this}disabled(){return this._track.enabled=!1,this}locked(){return this._track.locked=!0,this}motionPath(e){return this._track.motionPath=e,this}beginTrigger(e,t){return this._track.beginTrigger={type:e,value:t},this}endTrigger(e,t){return this._track.endTrigger={type:e,value:t},this}cycleDuration(e){return this._track.cycleDuration=e,this}cycleRepeats(e){return this._track.cycleRepeats=e,this}infinite(){return this._track.cycleInfinite=!0,this}cycle(e){return this._track.cycleBehavior=e,this}transformOrigin(e,t){return this._track.transformOrigin={x:e,y:t},this}motionRotate(e){return this._track.motionRotate=e,this}additive(e){return this._track.additive=e,this}build(){let e=[...this._track.keyframes].sort((t,r)=>t.time-r.time);return{...this._track,keyframes:e}}},nt=class{_duration;_loop=!1;_playbackSpeed=1;_tracks=[];constructor(e){this._duration=e}loop(e=!0){return this._loop=e,this}speed(e){return this._playbackSpeed=e,this}duration(e){return this._duration=e,this}addTrack(e){return this._tracks.push(e),this}addTracks(...e){return this._tracks.push(...e),this}buildTimeline(){return{duration:this._duration,loop:this._loop,playbackSpeed:this._playbackSpeed,tracks:this._tracks.map(e=>e.build())}}build(){let e=this.buildTimeline();return{duration:e.duration,loop:e.loop,playbackSpeed:e.playbackSpeed,tracks:e.tracks.map(t=>({id:t.id,shapeId:t.shapeId,property:t.property,enabled:t.enabled,locked:t.locked||void 0,motionPath:t.motionPath,beginTrigger:t.beginTrigger,endTrigger:t.endTrigger,cycleDuration:t.cycleDuration,cycleRepeats:t.cycleRepeats,cycleInfinite:t.cycleInfinite,cycleBehavior:t.cycleBehavior,transformOrigin:t.transformOrigin,motionRotate:t.motionRotate,additive:t.additive,keyframes:t.keyframes.map(r=>({time:r.time,value:r.value,easing:r.easing,...r.customBezier?{customBezier:r.customBezier}:{},...r.linearPoints?{linearPoints:r.linearPoints}:{}}))}))}}};var L=class{_id;_type;_state={};constructor(e,t){this._type=e,this._id=t??w()}id(e){return this._id=e,this}locked(e=!0){return this._state.locked=e,this}visible(e=!0){return this._state.visible=e,this}fill(e,t){return this._state.fillColor=e,this._state.fillType="solid",t!==void 0&&(this._state.fillOpacity=t),this}noFill(){return this._state.fillType="none",this}fillGradient(e){let t="build"in e?e.build():e;return this._state.fillType=t.type,this._state.fillGradient=t,this}fillPattern(e){let t="build"in e?e.build():e;return this._state.fillType="pattern",this._state.fillGradient=t,this}fillOpacity(e){return this._state.fillOpacity=e,this}fillRule(e){return this._state.fillRule=e,this}stroke(e,t){return this._state.borderColor=e,t!==void 0&&(this._state.borderWidth=t),this}noStroke(){return this._state.borderColor="none",this._state.borderWidth=0,this}strokeWidth(e){return this._state.borderWidth=e,this}strokeOpacity(e){return this._state.strokeOpacity=e,this}strokeGradient(e){let t="build"in e?e.build():e;return this._state.strokeType=t.type,this._state.strokeGradient=t,this}strokePattern(e){let t="build"in e?e.build():e;return this._state.strokeType="pattern",this._state.strokeGradient=t,this}strokeLinejoin(e){return this._state.strokeLinejoin=e,this}strokeLinecap(e){return this._state.strokeLinecap=e,this}strokeMiterlimit(e){return this._state.strokeMiterlimit=e,this}dashOffset(e){return this._state.dashOffset=e,this}strokeDasharray(e){return this._state.strokeDasharray=e,this}dash(e,t,r){return this._state.lineStyle=e,e==="custom"&&(t!==void 0&&(this._state.dashLength=t),r!==void 0&&(this._state.gapLength=r)),this}opacity(e){return this._state.opacity=e,this}rotate(e){return this._state.rotation=e,this}skew(e,t){return this._state.skewX=e,this._state.skewY=t,this}scale(e,t){return this._state.scaleX=e,this._state.scaleY=t??e,this}pivot(e,t){return this._state.customPivot={x:e,y:t},this}filter(...e){let t=this._state.filters??[];return this._state.filters=[...t,...e],this}dropShadow(e={}){let t={id:`drop-shadow-${w()}`,type:"drop-shadow",enabled:!0,offsetX:e.offsetX??4,offsetY:e.offsetY??4,blurRadius:e.blurRadius??8,spread:e.spread??0,color:e.color??"#000000",opacity:e.opacity??.3};return this.filter(t)}innerShadow(e={}){let t={id:`inner-shadow-${w()}`,type:"inner-shadow",enabled:!0,offsetX:e.offsetX??2,offsetY:e.offsetY??2,blurRadius:e.blurRadius??4,choke:e.choke??0,color:e.color??"#000000",opacity:e.opacity??.5};return this.filter(t)}blur(e,t,r){let i=e??4,a=t??i,o={id:`gaussian-blur-${w()}`,type:"gaussian-blur",enabled:!0,blurX:i,blurY:a,linked:i===a,quality:r?.quality??"normal"};return this.filter(o)}glow(e={}){let t={id:`glow-${w()}`,type:"glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}innerGlow(e={}){let t={id:`inner-glow-${w()}`,type:"inner-glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}grayscale(e=1){let t={id:`grayscale-${w()}`,type:"grayscale",enabled:!0,amount:e};return this.filter(t)}sepia(e=1){let t={id:`sepia-${w()}`,type:"sepia",enabled:!0,amount:e};return this.filter(t)}outline(e={}){return this.filter({id:`outline-${w()}`,type:"outline",enabled:!0,width:e.width??3,color:e.color??"#000000",opacity:e.opacity??1,position:e.position??"outside"})}motionBlur(e={}){let t={id:`motion-blur-${w()}`,type:"motion-blur",enabled:!0,distance:e.distance??10,angle:e.angle??0,quality:e.quality??"normal"};return this.filter(t)}pointLight(e={}){let t={id:`point-light-${w()}`,type:"point-light",enabled:!0,x:e.x??100,y:e.y??100,z:e.z??200,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,diffuseConstant:e.diffuseConstant??1,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}spotLight(e={}){let t={id:`spot-light-${w()}`,type:"spot-light",enabled:!0,x:e.x??100,y:e.y??0,z:e.z??200,pointsAtX:e.pointsAtX??100,pointsAtY:e.pointsAtY??100,pointsAtZ:e.pointsAtZ??0,coneAngle:e.coneAngle??30,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}sharpen(e=1){let t={id:`sharpen-${w()}`,type:"sharpen",enabled:!0,amount:e};return this.filter(t)}pixelate(e=8){let t={id:`pixelate-${w()}`,type:"pixelate",enabled:!0,blockSize:e};return this.filter(t)}warp(e={}){let t={id:`warp-${w()}`,type:"warp",enabled:!0,scale:e.scale??10,frequency:e.frequency??.02,octaves:e.octaves??1,warpType:e.warpType??"turbulence"};return this.filter(t)}morphology(e={}){let t=e.radiusX??2,r=e.radiusY??t,i={id:`morphology-${w()}`,type:"morphology",enabled:!0,operator:e.operator??"dilate",radiusX:t,radiusY:r,linked:e.linked??t===r};return this.filter(i)}contouring(e={}){if((e.mode??"discrete")==="table"){let i={id:`contouring-table-${w()}`,type:"contouring-table",enabled:!0,levels:e.levels??4,contrast:e.contrast??1};return this.filter(i)}let r={id:`contouring-discrete-${w()}`,type:"contouring-discrete",enabled:!0,levels:e.levels??4};return this.filter(r)}roundEdges(e=4){let t={id:`round-edges-${w()}`,type:"round-edges",enabled:!0,radius:e};return this.filter(t)}channelPainter(e={}){let t={id:`channel-painter-${w()}`,type:"channel-painter",enabled:!0,red:e.red??1,green:e.green??1,blue:e.blue??1};return this.filter(t)}brightness(e=1){let t={id:`brightness-${w()}`,type:"brightness",enabled:!0,amount:e};return this.filter(t)}contrast(e=1){let t={id:`contrast-${w()}`,type:"contrast",enabled:!0,amount:e};return this.filter(t)}filterOpacity(e=1){let t={id:`opacity-${w()}`,type:"opacity",enabled:!0,amount:e};return this.filter(t)}invert(e=1){let t={id:`invert-${w()}`,type:"invert",enabled:!0,amount:e};return this.filter(t)}hueRotate(e=0){let t={id:`hue-rotate-${w()}`,type:"hue-rotate",enabled:!0,angle:e};return this.filter(t)}saturate(e=1){let t={id:`saturate-${w()}`,type:"saturate",enabled:!0,amount:e};return this.filter(t)}blackAndWhite(e=.5){let t={id:`black-and-white-${w()}`,type:"black-and-white",enabled:!0,threshold:e};return this.filter(t)}duotone(e={}){let t={id:`duotone-${w()}`,type:"duotone",enabled:!0,shadowColor:e.shadowColor??"#000000",highlightColor:e.highlightColor??"#ffffff"};return this.filter(t)}xray(e=1){let t={id:`xray-${w()}`,type:"xray",enabled:!0,intensity:e};return this.filter(t)}noise(e={}){let t={id:`noise-${w()}`,type:"noise",enabled:!0,amount:e.amount??.3,scale:e.scale??1};return this.filter(t)}emboss(e={}){let t={id:`emboss-${w()}`,type:"emboss",enabled:!0,strength:e.strength??1,angle:e.angle??135};return this.filter(t)}filmGrain(e={}){let t={id:`film-grain-${w()}`,type:"film-grain",enabled:!0,amount:e.amount??.3,size:e.size??1};return this.filter(t)}watercolor(e={}){let t={id:`watercolor-${w()}`,type:"watercolor",enabled:!0,wetness:e.wetness??.5,turbulence:e.turbulence??.5};return this.filter(t)}gouache(e={}){let t={id:`gouache-${w()}`,type:"gouache",enabled:!0,thickness:e.thickness??.5,texture:e.texture??.5};return this.filter(t)}inkBlot(e={}){let t={id:`ink-blot-${w()}`,type:"ink-blot",enabled:!0,spread:e.spread??.5,edges:e.edges??.5};return this.filter(t)}crumpledPlastic(e={}){let t={id:`crumpled-plastic-${w()}`,type:"crumpled-plastic",enabled:!0,wrinkles:e.wrinkles??.5,shine:e.shine??.5};return this.filter(t)}riddled(e={}){let t={id:`riddled-${w()}`,type:"riddled",enabled:!0,density:e.density??.5,size:e.size??1};return this.filter(t)}cssClipPath(e){return this._state.cssClipPath=e,this}cssMaskProperties(e){return this._state.cssMaskProperties=e,this}metadata(e){return this._state.metadata={...this._state.metadata,...e},this}group(e){return this._state.groupId=e,this}build(){return{id:this._id,type:this._type,state:{...this._state}}}},rt=class extends L{constructor(e,t,r){if(r<0)throw new RangeError("Circle radius must be non-negative");super("circle"),this._state.x=e,this._state.y=t,this._state.radius=r}position(e,t){return this._state.x=e,this._state.y=t,this}radius(e){return this._state.radius=e,this}},it=class extends L{constructor(e,t,r,i){if(r<0||i<0)throw new RangeError("Ellipse radii must be non-negative");super("ellipse"),this._state.cx=e,this._state.cy=t,this._state.rx=r,this._state.ry=i}position(e,t){return this._state.cx=e,this._state.cy=t,this}radii(e,t){return this._state.rx=e,this._state.ry=t,this}},st=class extends L{constructor(e,t,r,i){if(r<0||i<0)throw new RangeError("Rectangle dimensions must be non-negative");super("rectangle"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=i}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}cornerRadius(e){return this._state.cornerRadius=e,this}},at=class extends L{constructor(e,t,r){if(r<0)throw new RangeError("Square size must be non-negative");super("square"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=r}position(e,t){return this._state.x=e,this._state.y=t,this}size(e){return this._state.width=e,this._state.height=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},ot=class extends L{constructor(e,t,r,i){super("line"),this._state.x1=e,this._state.y1=t,this._state.x2=r,this._state.y2=i}from(e,t){return this._state.x1=e,this._state.y1=t,this}to(e,t){return this._state.x2=e,this._state.y2=t,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},lt=class extends L{constructor(e,t,r){super("text"),this._state.x=e,this._state.y=t,this._state.text=r}position(e,t){return this._state.x=e,this._state.y=t,this}content(e){return this._state.text=e,this}fontSize(e){return this._state.fontSize=e,this}fontFamily(e){return this._state.fontFamily=e,this}fontWeight(e){return this._state.fontWeight=e,this}fontStyle(e){return this._state.fontStyle=e,this}anchor(e){return this._state.textAnchor=e,this}letterSpacing(e){return this._state.letterSpacing=e,this}lineHeight(e){return this._state.lineHeight=e,this}decoration(e){return this._state.textDecoration=e,this}transform(e){return this._state.textTransform=e,this}textPath(e,t=0){return this._state.isTextPath=!0,this._state.textPathPoints=e,this._state.textPathStartOffset=t,this}textPathOffset(e){return this._state.textPathStartOffset=e,this}textPathSide(e){return this._state.textPathSide=e,this}direction(e){return this._state.textDirection=e,this}unicodeBidi(e){return this._state.unicodeBidi=e,this}dominantBaseline(e){return this._state.dominantBaseline=e,this}writingMode(e){return this._state.writingMode=e,this}wordSpacing(e){return this._state.wordSpacing=e,this}baselineShift(e){return this._state.baselineShift=e,this}inlineSize(e){return this._state.inlineSize=e,this}overflowWrap(e){return this._state.overflowWrap=e,this}whiteSpace(e){return this._state.whiteSpace=e,this}fontVariationSettings(e){return this._state.fontVariationSettings=e,this}charOffsets(e){return this._state.charOffsets=e,this}shapeInsideRef(e){return this._state.shapeInsideRef=e,this}shapePadding(e){return this._state.shapePadding=e,this}richTextData(e){return this._state.richTextData=e,this}},Y=class extends L{constructor(e,t,r,i){super(e),this._state.cx=t,this._state.cy=r,this._state.radius=i}position(e,t){return this._state.cx=e,this._state.cy=t,this}radius(e){return this._state.radius=e,this}shiftAngle(e){return this._state.shiftAngle=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},ut=class extends Y{constructor(e,t,r){super("triangle",e,t,r)}},ct=class extends Y{constructor(e,t,r,i=5){super("ngon",e,t,r),this._state.sides=i}sides(e){return this._state.sides=e,this}},ht=class extends Y{constructor(e,t,r){super("star",e,t,r),this._state.arms=5,this._state.innerRadiusPercent=40}arms(e){return this._state.arms=e,this}innerRadius(e){return this._state.innerRadiusPercent=e,this}},dt=class extends Y{constructor(e,t,r){super("cross",e,t,r),this._state.armWidthPercent=35}armWidth(e){return this._state.armWidthPercent=e,this}},pt=class extends Y{constructor(e,t,r){super("ring",e,t,r),this._state.innerRadiusPercent=60}innerRadius(e){return this._state.innerRadiusPercent=e,this}},mt=class extends Y{constructor(e,t,r){super("spiral",e,t,r),this._state.turns=3,this._state.thicknessPercent=15,this._state.spiralDirection=1}turns(e){return this._state.turns=e,this}thickness(e){return this._state.thicknessPercent=e,this}direction(e){return this._state.spiralDirection=e,this}},ft=class extends Y{constructor(e,t,r){super("gear",e,t,r),this._state.teeth=8,this._state.toothDepthPercent=25}teeth(e){return this._state.teeth=e,this}toothDepth(e){return this._state.toothDepthPercent=e,this}holeRadius(e){return this._state.holeRadiusPercent=e,this}},gt=class extends Y{constructor(e,t,r){super("arrow",e,t,r),this._state.headWidthPercent=100,this._state.headLengthPercent=35,this._state.shaftWidthPercent=35}headWidth(e){return this._state.headWidthPercent=e,this}headLength(e){return this._state.headLengthPercent=e,this}shaftWidth(e){return this._state.shaftWidthPercent=e,this}},$t=class extends L{constructor(e=[]){super("spline"),this._state.splinePoints=[...e],this._state.splineCurveType="cubic",this._state.splineClosed=!1}points(e){return this._state.splinePoints=[...e],this}addPoint(e,t){let r=this._state.splinePoints??[];return r.push({x:e,y:t}),this._state.splinePoints=r,this}curveType(e){return this._state.splineCurveType=e,this}closed(e=!0){return this._state.splineClosed=e,this}tension(e){return this._state.splineTension=e,this}arcParams(e){return this._state.splineArcParams=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},yt=class extends L{constructor(e=[]){super("polyline"),this._state.polylinePoints=[...e],this._state.polylineClosed=!1}points(e){return this._state.polylinePoints=[...e],this}addPoint(e,t){let r=this._state.polylinePoints??[];return r.push({x:e,y:t}),this._state.polylinePoints=r,this}closed(e=!0){return this._state.polylineClosed=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},bt=class extends L{constructor(e,t,r,i,a){super("image"),this._state.x=e,this._state.y=t,this._state.width=r,this._state.height=i,this._state.href=a}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}src(e){return this._state.href=e,this}preserveAspectRatio(e){return this._state.preserveAspectRatio=e,this}};var he=class{_x1;_y1;_x2;_y2;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(e=0,t=0,r=1,i=0){this._x1=e,this._y1=t,this._x2=r,this._y2=i,this._id=w()}stop(e,t,r=1){return this._stops.push({offset:e,color:t,opacity:r}),this}direction(e,t,r,i){return this._x1=e,this._y1=t,this._x2=r,this._y2=i,this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"linear-gradient",id:this._id,x1:this._x1,y1:this._y1,x2:this._x2,y2:this._y2,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},de=class{_cx=.5;_cy=.5;_fx=.5;_fy=.5;_r=.5;_ry=.5;_rotation=0;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(){this._id=w()}center(e,t){return this._cx=e,this._cy=t,this}focus(e,t){return this._fx=e,this._fy=t,this}radius(e,t){return this._r=e,this._ry=t??e,this}rotation(e){return this._rotation=e,this}stop(e,t,r=1){return this._stops.push({offset:e,color:t,opacity:r}),this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"radial-gradient",id:this._id,cx:this._cx,cy:this._cy,fx:this._fx,fy:this._fy,r:this._r,ry:this._ry,rotation:this._rotation,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},pe=class{_patternType;_color;_backgroundColor;_scale=1;_rotation=0;_opacity=1;_patternParams;_id;_svgContent;_width;_height;_patternUnits;_patternContentUnits;_patternTransform;_viewBox;_preserveAspectRatio;_x;_y;_customPatternId;constructor(e="stripes",t="#000000",r="#ffffff"){this._patternType=e,this._color=t,this._backgroundColor=r,this._id=w()}scale(e){return this._scale=e,this}rotation(e){return this._rotation=e,this}opacity(e){return this._opacity=e,this}params(e){return this._patternParams=e,this}svgContent(e){return this._svgContent=e,this}size(e,t){return this._width=e,this._height=t,this}patternUnits(e){return this._patternUnits=e,this}patternContentUnits(e){return this._patternContentUnits=e,this}patternTransform(e){return this._patternTransform=e,this}viewBox(e){return this._viewBox=e,this}preserveAspectRatio(e){return this._preserveAspectRatio=e,this}position(e,t){return this._x=e,this._y=t,this}customPatternId(e){return this._customPatternId=e,this}build(){let e,t,r;if(this._svgContent!==void 0)e=this._svgContent,t=this._width??10,r=this._height??10;else{let a=Ve(this._patternType,this._scale,this._color,this._backgroundColor,this._patternParams);e=a.svgContent,t=this._width??a.width,r=this._height??a.height}let i={type:"pattern",id:this._id,patternType:this._svgContent!==void 0?"custom":this._patternType,color:this._color,backgroundColor:this._backgroundColor,scale:this._scale,rotation:this._rotation,opacity:this._opacity,svgContent:e,width:t,height:r,patternUnits:this._patternUnits??"userSpaceOnUse",patternParams:this._patternParams,patternTransform:this._patternTransform??(this._rotation?`rotate(${this._rotation})`:void 0)};return this._patternContentUnits&&(i.patternContentUnits=this._patternContentUnits),this._viewBox&&(i.viewBox=this._viewBox),this._preserveAspectRatio&&(i.preserveAspectRatio=this._preserveAspectRatio),this._x!==void 0&&(i.x=this._x),this._y!==void 0&&(i.y=this._y),this._customPatternId&&(i.customPatternId=this._customPatternId),i}};function fn(n=0,e=0,t=1,r=0){return new he(n,e,t,r)}function gn(){return new de}function $n(n="stripes",e="#000000",t="#ffffff"){return new pe(n,e,t)}0&&(module.exports={Arrow,BUILTIN_MARKER_ID_MAP,CURRENT_SCHEMA_VERSION,Circle,Cross,DEFAULT_COORDINATE_PRECISION,Document,EASING_CURVES,EVENT_TRIGGER_OPTIONS,EasingType,Ellipse,Gear,ImageShape,Line,LinearGradientBuilder,MARKER_HEIGHT,MARKER_VIEWBOX,MARKER_WIDTH,MAX_COORDINATE_PRECISION,MIGRATIONS,NGon,PatternBuilder,Polyline,RadialGradientBuilder,Rectangle,Ring,ShapeBuilder,Spiral,Spline,SplineCurveType,SplinePointType,Square,Star,Text,Timeline,Track,Triangle,computeArrowVertices,computeCloudPath,computeCrossVertices,computeDashArray,computeGearPath,computeGearVertices,computeHeartPath,computeLightningVertices,computePolygonVertices,computeRectanglePath,computeRingPath,computeSpeechBubbleVertices,computeSpiralPath,computeSplinePath,computeStarVertices,createDocument,createShape,createViewbox,escXml,extractVariables,filterAttr,generateCode,generateCssCode,generateD3Code,generateId,generatePatternSvgContent,generateReactCode,generateSvgCode,generateVueCode,getBuiltInMarkerDefs,getEasingCubicBezier,getEffectivePrecision,getMarkerDescriptors,getPatternElements,linearGradient,migrateSnapshot,parseDocument,parseVariableArgs,pattern,radialGradient,renderAnimationElements,renderCircle,renderEllipse,renderFilterDefs,renderFilterPrimitivesForType,renderImage,renderLine,renderPolygonShape,renderPolyline,renderRectangle,renderShape,renderSpline,renderText,renderToSvg,roundCoord,roundNumberString,roundSerializedShape,roundSnapshot,stringifyDocument,substituteString,substituteVariables,validateSnapshot,verticesToPath});
|
|
13
|
+
}`)}let o=[];for(let u=0;u<i.length;u++){let c=i[u],h=Rr(c,u),d=G(c),m=d.indexOf(" ");m!==-1&&(d=d.slice(0,m)+` class="${h}"`+d.slice(m)),o.push(`${n}${d}`)}let l=[];l.push("<style>");for(let u of a)l.push(u);l.push("</style>"),l.push(""),l.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" viewBox="0 0 ${t.width} ${t.height}">`);for(let u of o)l.push(u);return l.push("</svg>"),l.push(""),l.join(`
|
|
14
|
+
`)}function Je(r,e){let t=Fi(r,e),n={...e};switch(n.format){case"svg":return Ye(t,n);case"react":return qe(t,n);case"vue":return Ke(t,n);case"d3":return Ze(t,n);case"css":return Qe(t,n);default:throw new Error(`Unsupported code format: ${n.format}`)}}function Fi(r,e){return Array.isArray(r)?{shapes:r,viewboxes:[{id:"default",x:0,y:0,width:e.width??800,height:e.height??600}]}:r}var et=class r{_snapshot;constructor(e={}){let{width:t=800,height:n=600,viewboxId:i}=e,a=oe(0,0,t,n,i);this._snapshot=be({viewboxes:[a]})}static fromSnapshot(e){let t=new r;return t._snapshot=JSON.parse(JSON.stringify(e)),t}static fromJSON(e,t){let n=xe(e,t),i=new r;return i._snapshot=n,i}add(e){let t="build"in e&&typeof e.build=="function"?e.build():e;return this._snapshot.shapes.push(t),this}addAll(...e){for(let t of e)this.add(t);return this}remove(e){let t=this._snapshot.shapes.length;return this._snapshot.shapes=this._snapshot.shapes.filter(n=>n.id!==e),this._snapshot.shapes.length<t}get shapes(){return this._snapshot.shapes}findShape(e){return this._snapshot.shapes.find(t=>t.id===e)}size(e,t){return this._snapshot.viewboxes.length>0?(this._snapshot.viewboxes[0].width=e,this._snapshot.viewboxes[0].height=t):this._snapshot.viewboxes=[oe(0,0,e,t)],this}get width(){return this._snapshot.viewboxes[0]?.width??800}get height(){return this._snapshot.viewboxes[0]?.height??600}title(e){return this._ensureMetadata(),this._snapshot.documentMetadata.title=e,this}description(e){return this._ensureMetadata(),this._snapshot.documentMetadata.description=e,this}author(e){return this._ensureMetadata(),this._snapshot.documentMetadata.author=e,this}keywords(...e){return this._ensureMetadata(),this._snapshot.documentMetadata.keywords=e,this}license(e,t){return this._ensureMetadata(),this._snapshot.documentMetadata.license=e,t!==void 0&&(this._snapshot.documentMetadata.licenseUrl=t),this}language(e){return this._ensureMetadata(),this._snapshot.documentMetadata.language=e,this}customMetadata(e){return this._ensureMetadata(),this._snapshot.documentMetadata.customMetadata={...this._snapshot.documentMetadata.customMetadata,...e},this}get meta(){return this._snapshot.documentMetadata}defineSymbol(e,t,n){this._snapshot.symbols||(this._snapshot.symbols=[]);let i=T(),a=t.map(l=>"build"in l&&typeof l.build=="function"?l.build():l),o={kind:"symbol",id:i,name:e,viewBox:n?.viewBox??"0 0 100 100",shapes:a};return n?.groups&&(o.groups=n.groups),n?.thumbnail&&(o.thumbnail=n.thumbnail),this._snapshot.symbols.push(o),i}placeSymbolInstance(e,t,n,i,a){let o={id:T(),type:"symbol-instance",state:{symbolId:e,x:t,y:n,width:i??100,height:a??100}};return this._snapshot.shapes.push(o),this}removeSymbol(e){if(!this._snapshot.symbols)return!1;let t=this._snapshot.symbols.length;return this._snapshot.symbols=this._snapshot.symbols.filter(n=>n.id!==e),this._snapshot.symbols.length<t}get symbols(){return this._snapshot.symbols??[]}addClipGroup(e,t,n){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let i=T(),a={id:i,type:"clip",clipShapeIds:e,contentShapeIds:t,parentId:null};return n?.clipPathUnits&&(a.clipPathUnits=n.clipPathUnits),n?.rawDefinition&&(a.rawDefinition=n.rawDefinition),this._snapshot.clipMaskGroups.push(a),i}addMaskGroup(e,t,n){this._snapshot.clipMaskGroups||(this._snapshot.clipMaskGroups=[]);let i=T(),a={id:i,type:"mask",clipShapeIds:e,contentShapeIds:t,parentId:null};return n?.maskUnits&&(a.maskUnits=n.maskUnits),n?.maskContentUnits&&(a.maskContentUnits=n.maskContentUnits),n?.maskBounds&&(a.maskBounds=n.maskBounds),n?.maskType&&(a.maskType=n.maskType),n?.rawDefinition&&(a.rawDefinition=n.rawDefinition),this._snapshot.clipMaskGroups.push(a),i}removeClipMaskGroup(e){if(!this._snapshot.clipMaskGroups)return!1;let t=this._snapshot.clipMaskGroups.length;return this._snapshot.clipMaskGroups=this._snapshot.clipMaskGroups.filter(n=>n.id!==e),this._snapshot.clipMaskGroups.length<t}addGuide(e,t,n){this._snapshot.guides||(this._snapshot.guides=[]);let i=T(),a={id:i,orientation:e,position:t,controlPointOffset:0};return n?.color&&(a.color=n.color),n?.opacity!==void 0&&(a.opacity=n.opacity),this._snapshot.guides.push(a),i}removeGuide(e){if(!this._snapshot.guides)return!1;let t=this._snapshot.guides.length;return this._snapshot.guides=this._snapshot.guides.filter(n=>n.id!==e),this._snapshot.guides.length<t}clearGuides(){return this._snapshot.guides=[],this}get guides(){return this._snapshot.guides??[]}addMeasurement(e,t,n){this._snapshot.measurements||(this._snapshot.measurements=[]);let i=T(),a={id:i,type:e,points:t,visible:n?.visible??!0,snapDivisions:n?.snapDivisions??1};return n?.color&&(a.color=n.color),n?.opacity!==void 0&&(a.opacity=n.opacity),this._snapshot.measurements.push(a),i}removeMeasurement(e){if(!this._snapshot.measurements)return!1;let t=this._snapshot.measurements.length;return this._snapshot.measurements=this._snapshot.measurements.filter(n=>n.id!==e),this._snapshot.measurements.length<t}get measurements(){return this._snapshot.measurements??[]}addCustomPattern(e,t,n,i){this._snapshot.customPatterns||(this._snapshot.customPatterns=[]);let a=T();return this._snapshot.customPatterns.push({id:a,name:e,svgContent:t,width:n,height:i}),a}removeCustomPattern(e){if(!this._snapshot.customPatterns)return!1;let t=this._snapshot.customPatterns.length;return this._snapshot.customPatterns=this._snapshot.customPatterns.filter(n=>n.id!==e),this._snapshot.customPatterns.length<t}get customPatterns(){return this._snapshot.customPatterns??[]}addGroup(e,t){this._snapshot.groups||(this._snapshot.groups=[]);let n=e??T();return this._snapshot.groups.push({id:n,parentId:t??null}),n}removeGroup(e){if(!this._snapshot.groups)return!1;let t=this._snapshot.groups.length;this._snapshot.groups=this._snapshot.groups.filter(n=>n.id!==e);for(let n of this._snapshot.shapes)n.state.groupId===e&&delete n.state.groupId;return this._snapshot.groups.length<t}moveToGroup(e,t){let n=this._snapshot.shapes.find(i=>i.id===e);return n&&(n.state.groupId=t),this}removeFromGroup(e){let t=this._snapshot.shapes.find(n=>n.id===e);return t&&delete t.state.groupId,this}bringToFront(e){let t=this._snapshot.shapes.findIndex(n=>n.id===e);if(t>=0){let[n]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.push(n)}return this}sendToBack(e){let t=this._snapshot.shapes.findIndex(n=>n.id===e);if(t>=0){let[n]=this._snapshot.shapes.splice(t,1);this._snapshot.shapes.unshift(n)}return this}reorder(e,t){let n=this._snapshot.shapes.findIndex(i=>i.id===e);if(n>=0){let[i]=this._snapshot.shapes.splice(n,1),a=Math.max(0,Math.min(t,this._snapshot.shapes.length));this._snapshot.shapes.splice(a,0,i)}return this}defineVariable(e,t,n,i){this._snapshot.templateVariables||(this._snapshot.templateVariables=[]);let a=this._snapshot.templateVariables.find(o=>o.name===e);if(a)a.type=t,a.defaultValue=n,i?.label!==void 0&&(a.label=i.label),i?.description!==void 0&&(a.description=i.description);else{let o={name:e,type:t,defaultValue:n};i?.label!==void 0&&(o.label=i.label),i?.description!==void 0&&(o.description=i.description),this._snapshot.templateVariables.push(o)}return this}removeVariable(e){return this._snapshot.templateVariables&&(this._snapshot.templateVariables=this._snapshot.templateVariables.filter(t=>t.name!==e)),this}get variables(){return this._snapshot.templateVariables??[]}inspectVariables(){return Te(this._snapshot)}setTimeline(e){return"build"in e&&typeof e.build=="function"?this._snapshot.animationTimeline=e.build():this._snapshot.animationTimeline=e,this}clearTimeline(){return delete this._snapshot.animationTimeline,this}get timeline(){return this._snapshot.animationTimeline}toSVG(e){let{variables:t,...n}=e??{},i=we(this._snapshot,t);return se(i,n)}toJSON(e){return $e(this._snapshot,e)}toSnapshot(){return JSON.parse(JSON.stringify(this._snapshot))}toCode(e,t){return Je(this._snapshot,{...t,format:e})}_ensureMetadata(){this._snapshot.documentMetadata||(this._snapshot.documentMetadata={title:"",description:"",author:"",keywords:[],license:"",licenseUrl:"",language:"en",customMetadata:{}})}};var tt=class{_track;constructor(e,t){this._track={id:T(),shapeId:e,property:t,keyframes:[],enabled:!0,locked:!1}}id(e){return this._track.id=e,this}keyframe(e,t,n="linear"){return this._track.keyframes.push({time:e,value:t,easing:n}),this}keyframeBezier(e,t,n){return this._track.keyframes.push({time:e,value:t,easing:"custom-bezier",customBezier:n}),this}keyframeLinear(e,t,n){return this._track.keyframes.push({time:e,value:t,easing:"linear-function",linearPoints:n}),this}keyframes(...e){return this._track.keyframes.push(...e),this}disabled(){return this._track.enabled=!1,this}locked(){return this._track.locked=!0,this}motionPath(e){return this._track.motionPath=e,this}motionPathRef(e,t="trackShape"){return this._track.motionPathRef={shapeId:e,mode:t},this}beginTrigger(e,t){return this._track.beginTrigger={type:e,value:t},this}endTrigger(e,t){return this._track.endTrigger={type:e,value:t},this}cycleDuration(e){return this._track.cycleDuration=e,this}cycleRepeats(e){return this._track.cycleRepeats=e,this}infinite(){return this._track.cycleInfinite=!0,this}cycle(e){return this._track.cycleBehavior=e,this}transformOrigin(e,t){return this._track.transformOrigin={x:e,y:t},this}motionRotate(e){return this._track.motionRotate=e,this}additive(e){return this._track.additive=e,this}build(){let e=[...this._track.keyframes].sort((t,n)=>t.time-n.time);return{...this._track,keyframes:e}}},rt=class{_duration;_loop=!1;_playbackSpeed=1;_tracks=[];constructor(e){this._duration=e}loop(e=!0){return this._loop=e,this}speed(e){return this._playbackSpeed=e,this}duration(e){return this._duration=e,this}addTrack(e){return this._tracks.push(e),this}addTracks(...e){return this._tracks.push(...e),this}buildTimeline(){return{duration:this._duration,loop:this._loop,playbackSpeed:this._playbackSpeed,tracks:this._tracks.map(e=>e.build())}}build(){let e=this.buildTimeline();return{duration:e.duration,loop:e.loop,playbackSpeed:e.playbackSpeed,tracks:e.tracks.map(t=>({id:t.id,shapeId:t.shapeId,property:t.property,enabled:t.enabled,locked:t.locked||void 0,motionPath:t.motionPath,motionPathRef:t.motionPathRef,beginTrigger:t.beginTrigger,endTrigger:t.endTrigger,cycleDuration:t.cycleDuration,cycleRepeats:t.cycleRepeats,cycleInfinite:t.cycleInfinite,cycleBehavior:t.cycleBehavior,transformOrigin:t.transformOrigin,motionRotate:t.motionRotate,additive:t.additive,keyframes:t.keyframes.map(n=>({time:n.time,value:n.value,easing:n.easing,...n.customBezier?{customBezier:n.customBezier}:{},...n.linearPoints?{linearPoints:n.linearPoints}:{}}))}))}}};var B=class{_id;_type;_state={};constructor(e,t){this._type=e,this._id=t??T()}id(e){return this._id=e,this}locked(e=!0){return this._state.locked=e,this}visible(e=!0){return this._state.visible=e,this}displayMode(e){return this._state.displayMode=e,this}motionOnly(){return this._state.displayMode="motionOnly",this}fill(e,t){return this._state.fillColor=e,this._state.fillType="solid",t!==void 0&&(this._state.fillOpacity=t),this}noFill(){return this._state.fillType="none",this}fillGradient(e){let t="build"in e?e.build():e;return this._state.fillType=t.type,this._state.fillGradient=t,this}fillPattern(e){let t="build"in e?e.build():e;return this._state.fillType="pattern",this._state.fillGradient=t,this}fillOpacity(e){return this._state.fillOpacity=e,this}fillRule(e){return this._state.fillRule=e,this}stroke(e,t){return this._state.borderColor=e,t!==void 0&&(this._state.borderWidth=t),this}noStroke(){return this._state.borderColor="none",this._state.borderWidth=0,this}strokeWidth(e){return this._state.borderWidth=e,this}strokeOpacity(e){return this._state.strokeOpacity=e,this}strokeGradient(e){let t="build"in e?e.build():e;return this._state.strokeType=t.type,this._state.strokeGradient=t,this}strokePattern(e){let t="build"in e?e.build():e;return this._state.strokeType="pattern",this._state.strokeGradient=t,this}strokeLinejoin(e){return this._state.strokeLinejoin=e,this}strokeLinecap(e){return this._state.strokeLinecap=e,this}strokeMiterlimit(e){return this._state.strokeMiterlimit=e,this}dashOffset(e){return this._state.dashOffset=e,this}strokeDasharray(e){return this._state.strokeDasharray=e,this}dash(e,t,n){return this._state.lineStyle=e,e==="custom"&&(t!==void 0&&(this._state.dashLength=t),n!==void 0&&(this._state.gapLength=n)),this}opacity(e){return this._state.opacity=e,this}rotate(e){return this._state.rotation=e,this}skew(e,t){return this._state.skewX=e,this._state.skewY=t,this}scale(e,t){return this._state.scaleX=e,this._state.scaleY=t??e,this}pivot(e,t){return this._state.customPivot={x:e,y:t},this}filter(...e){let t=this._state.filters??[];return this._state.filters=[...t,...e],this}dropShadow(e={}){let t={id:`drop-shadow-${T()}`,type:"drop-shadow",enabled:!0,offsetX:e.offsetX??4,offsetY:e.offsetY??4,blurRadius:e.blurRadius??8,spread:e.spread??0,color:e.color??"#000000",opacity:e.opacity??.3};return this.filter(t)}innerShadow(e={}){let t={id:`inner-shadow-${T()}`,type:"inner-shadow",enabled:!0,offsetX:e.offsetX??2,offsetY:e.offsetY??2,blurRadius:e.blurRadius??4,choke:e.choke??0,color:e.color??"#000000",opacity:e.opacity??.5};return this.filter(t)}blur(e,t,n){let i=e??4,a=t??i,o={id:`gaussian-blur-${T()}`,type:"gaussian-blur",enabled:!0,blurX:i,blurY:a,linked:i===a,quality:n?.quality??"normal"};return this.filter(o)}glow(e={}){let t={id:`glow-${T()}`,type:"glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}innerGlow(e={}){let t={id:`inner-glow-${T()}`,type:"inner-glow",enabled:!0,color:e.color??"#ffffff",radius:e.radius??10,intensity:e.intensity??.8};return this.filter(t)}grayscale(e=1){let t={id:`grayscale-${T()}`,type:"grayscale",enabled:!0,amount:e};return this.filter(t)}sepia(e=1){let t={id:`sepia-${T()}`,type:"sepia",enabled:!0,amount:e};return this.filter(t)}outline(e={}){return this.filter({id:`outline-${T()}`,type:"outline",enabled:!0,width:e.width??3,color:e.color??"#000000",opacity:e.opacity??1,position:e.position??"outside"})}motionBlur(e={}){let t={id:`motion-blur-${T()}`,type:"motion-blur",enabled:!0,distance:e.distance??10,angle:e.angle??0,quality:e.quality??"normal"};return this.filter(t)}pointLight(e={}){let t={id:`point-light-${T()}`,type:"point-light",enabled:!0,x:e.x??100,y:e.y??100,z:e.z??200,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,diffuseConstant:e.diffuseConstant??1,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}spotLight(e={}){let t={id:`spot-light-${T()}`,type:"spot-light",enabled:!0,x:e.x??100,y:e.y??0,z:e.z??200,pointsAtX:e.pointsAtX??100,pointsAtY:e.pointsAtY??100,pointsAtZ:e.pointsAtZ??0,coneAngle:e.coneAngle??30,color:e.color??"#ffffff",surfaceScale:e.surfaceScale??5,specularConstant:e.specularConstant??1,specularExponent:e.specularExponent??20};return this.filter(t)}sharpen(e=1){let t={id:`sharpen-${T()}`,type:"sharpen",enabled:!0,amount:e};return this.filter(t)}pixelate(e=8){let t={id:`pixelate-${T()}`,type:"pixelate",enabled:!0,blockSize:e};return this.filter(t)}warp(e={}){let t={id:`warp-${T()}`,type:"warp",enabled:!0,scale:e.scale??10,frequency:e.frequency??.02,octaves:e.octaves??1,warpType:e.warpType??"turbulence"};return this.filter(t)}morphology(e={}){let t=e.radiusX??2,n=e.radiusY??t,i={id:`morphology-${T()}`,type:"morphology",enabled:!0,operator:e.operator??"dilate",radiusX:t,radiusY:n,linked:e.linked??t===n};return this.filter(i)}contouring(e={}){if((e.mode??"discrete")==="table"){let i={id:`contouring-table-${T()}`,type:"contouring-table",enabled:!0,levels:e.levels??4,contrast:e.contrast??1};return this.filter(i)}let n={id:`contouring-discrete-${T()}`,type:"contouring-discrete",enabled:!0,levels:e.levels??4};return this.filter(n)}roundEdges(e=4){let t={id:`round-edges-${T()}`,type:"round-edges",enabled:!0,radius:e};return this.filter(t)}channelPainter(e={}){let t={id:`channel-painter-${T()}`,type:"channel-painter",enabled:!0,red:e.red??1,green:e.green??1,blue:e.blue??1};return this.filter(t)}brightness(e=1){let t={id:`brightness-${T()}`,type:"brightness",enabled:!0,amount:e};return this.filter(t)}contrast(e=1){let t={id:`contrast-${T()}`,type:"contrast",enabled:!0,amount:e};return this.filter(t)}filterOpacity(e=1){let t={id:`opacity-${T()}`,type:"opacity",enabled:!0,amount:e};return this.filter(t)}invert(e=1){let t={id:`invert-${T()}`,type:"invert",enabled:!0,amount:e};return this.filter(t)}hueRotate(e=0){let t={id:`hue-rotate-${T()}`,type:"hue-rotate",enabled:!0,angle:e};return this.filter(t)}saturate(e=1){let t={id:`saturate-${T()}`,type:"saturate",enabled:!0,amount:e};return this.filter(t)}blackAndWhite(e=.5){let t={id:`black-and-white-${T()}`,type:"black-and-white",enabled:!0,threshold:e};return this.filter(t)}duotone(e={}){let t={id:`duotone-${T()}`,type:"duotone",enabled:!0,shadowColor:e.shadowColor??"#000000",highlightColor:e.highlightColor??"#ffffff"};return this.filter(t)}xray(e=1){let t={id:`xray-${T()}`,type:"xray",enabled:!0,intensity:e};return this.filter(t)}noise(e={}){let t={id:`noise-${T()}`,type:"noise",enabled:!0,amount:e.amount??.3,scale:e.scale??1};return this.filter(t)}emboss(e={}){let t={id:`emboss-${T()}`,type:"emboss",enabled:!0,strength:e.strength??1,angle:e.angle??135};return this.filter(t)}filmGrain(e={}){let t={id:`film-grain-${T()}`,type:"film-grain",enabled:!0,amount:e.amount??.3,size:e.size??1};return this.filter(t)}watercolor(e={}){let t={id:`watercolor-${T()}`,type:"watercolor",enabled:!0,wetness:e.wetness??.5,turbulence:e.turbulence??.5};return this.filter(t)}gouache(e={}){let t={id:`gouache-${T()}`,type:"gouache",enabled:!0,thickness:e.thickness??.5,texture:e.texture??.5};return this.filter(t)}inkBlot(e={}){let t={id:`ink-blot-${T()}`,type:"ink-blot",enabled:!0,spread:e.spread??.5,edges:e.edges??.5};return this.filter(t)}crumpledPlastic(e={}){let t={id:`crumpled-plastic-${T()}`,type:"crumpled-plastic",enabled:!0,wrinkles:e.wrinkles??.5,shine:e.shine??.5};return this.filter(t)}riddled(e={}){let t={id:`riddled-${T()}`,type:"riddled",enabled:!0,density:e.density??.5,size:e.size??1};return this.filter(t)}cssClipPath(e){return this._state.cssClipPath=e,this}cssMaskProperties(e){return this._state.cssMaskProperties=e,this}metadata(e){return this._state.metadata={...this._state.metadata,...e},this}group(e){return this._state.groupId=e,this}build(){return{id:this._id,type:this._type,state:{...this._state}}}},nt=class extends B{constructor(e,t,n){if(n<0)throw new RangeError("Circle radius must be non-negative");super("circle"),this._state.x=e,this._state.y=t,this._state.radius=n}position(e,t){return this._state.x=e,this._state.y=t,this}radius(e){return this._state.radius=e,this}},it=class extends B{constructor(e,t,n,i){if(n<0||i<0)throw new RangeError("Ellipse radii must be non-negative");super("ellipse"),this._state.cx=e,this._state.cy=t,this._state.rx=n,this._state.ry=i}position(e,t){return this._state.cx=e,this._state.cy=t,this}radii(e,t){return this._state.rx=e,this._state.ry=t,this}},st=class extends B{constructor(e,t,n,i){if(n<0||i<0)throw new RangeError("Rectangle dimensions must be non-negative");super("rectangle"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=i}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}cornerRadius(e){return this._state.cornerRadius=e,this}},at=class extends B{constructor(e,t,n){if(n<0)throw new RangeError("Square size must be non-negative");super("square"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=n}position(e,t){return this._state.x=e,this._state.y=t,this}size(e){return this._state.width=e,this._state.height=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},ot=class extends B{constructor(e,t,n,i){super("line"),this._state.x1=e,this._state.y1=t,this._state.x2=n,this._state.y2=i}from(e,t){return this._state.x1=e,this._state.y1=t,this}to(e,t){return this._state.x2=e,this._state.y2=t,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},lt=class extends B{constructor(e,t,n){super("text"),this._state.x=e,this._state.y=t,this._state.text=n}position(e,t){return this._state.x=e,this._state.y=t,this}content(e){return this._state.text=e,this}fontSize(e){return this._state.fontSize=e,this}fontFamily(e){return this._state.fontFamily=e,this}fontWeight(e){return this._state.fontWeight=e,this}fontStyle(e){return this._state.fontStyle=e,this}anchor(e){return this._state.textAnchor=e,this}letterSpacing(e){return this._state.letterSpacing=e,this}lineHeight(e){return this._state.lineHeight=e,this}decoration(e){return this._state.textDecoration=e,this}transform(e){return this._state.textTransform=e,this}textPath(e,t=0){return this._state.isTextPath=!0,this._state.textPathPoints=e,this._state.textPathStartOffset=t,this}textPathOffset(e){return this._state.textPathStartOffset=e,this}textPathSide(e){return this._state.textPathSide=e,this}direction(e){return this._state.textDirection=e,this}unicodeBidi(e){return this._state.unicodeBidi=e,this}dominantBaseline(e){return this._state.dominantBaseline=e,this}writingMode(e){return this._state.writingMode=e,this}wordSpacing(e){return this._state.wordSpacing=e,this}baselineShift(e){return this._state.baselineShift=e,this}inlineSize(e){return this._state.inlineSize=e,this}overflowWrap(e){return this._state.overflowWrap=e,this}whiteSpace(e){return this._state.whiteSpace=e,this}fontVariationSettings(e){return this._state.fontVariationSettings=e,this}charOffsets(e){return this._state.charOffsets=e,this}shapeInsideRef(e){return this._state.shapeInsideRef=e,this}shapePadding(e){return this._state.shapePadding=e,this}richTextData(e){return this._state.richTextData=e,this}},q=class extends B{constructor(e,t,n,i){super(e),this._state.cx=t,this._state.cy=n,this._state.radius=i}position(e,t){return this._state.cx=e,this._state.cy=t,this}radius(e){return this._state.radius=e,this}shiftAngle(e){return this._state.shiftAngle=e,this}cornerRadius(e){return this._state.cornerRadius=e,this}},ut=class extends q{constructor(e,t,n){super("triangle",e,t,n)}},ct=class extends q{constructor(e,t,n,i=5){super("ngon",e,t,n),this._state.sides=i}sides(e){return this._state.sides=e,this}},dt=class extends q{constructor(e,t,n){super("star",e,t,n),this._state.arms=5,this._state.innerRadiusPercent=40}arms(e){return this._state.arms=e,this}innerRadius(e){return this._state.innerRadiusPercent=e,this}},ht=class extends q{constructor(e,t,n){super("cross",e,t,n),this._state.armWidthPercent=35}armWidth(e){return this._state.armWidthPercent=e,this}},pt=class extends q{constructor(e,t,n){super("ring",e,t,n),this._state.innerRadiusPercent=60}innerRadius(e){return this._state.innerRadiusPercent=e,this}},ft=class extends q{constructor(e,t,n){super("spiral",e,t,n),this._state.turns=3,this._state.thicknessPercent=15,this._state.spiralDirection=1}turns(e){return this._state.turns=e,this}thickness(e){return this._state.thicknessPercent=e,this}direction(e){return this._state.spiralDirection=e,this}},mt=class extends q{constructor(e,t,n){super("gear",e,t,n),this._state.teeth=8,this._state.toothDepthPercent=25}teeth(e){return this._state.teeth=e,this}toothDepth(e){return this._state.toothDepthPercent=e,this}holeRadius(e){return this._state.holeRadiusPercent=e,this}},gt=class extends q{constructor(e,t,n){super("arrow",e,t,n),this._state.headWidthPercent=100,this._state.headLengthPercent=35,this._state.shaftWidthPercent=35}headWidth(e){return this._state.headWidthPercent=e,this}headLength(e){return this._state.headLengthPercent=e,this}shaftWidth(e){return this._state.shaftWidthPercent=e,this}},yt=class extends B{constructor(e=[]){super("spline"),this._state.splinePoints=[...e],this._state.splineCurveType="cubic",this._state.splineClosed=!1}points(e){return this._state.splinePoints=[...e],this}addPoint(e,t){let n=this._state.splinePoints??[];return n.push({x:e,y:t}),this._state.splinePoints=n,this}curveType(e){return this._state.splineCurveType=e,this}closed(e=!0){return this._state.splineClosed=e,this}tension(e){return this._state.splineTension=e,this}arcParams(e){return this._state.splineArcParams=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},bt=class extends B{constructor(e=[]){super("polyline"),this._state.polylinePoints=[...e],this._state.polylineClosed=!1}points(e){return this._state.polylinePoints=[...e],this}addPoint(e,t){let n=this._state.polylinePoints??[];return n.push({x:e,y:t}),this._state.polylinePoints=n,this}closed(e=!0){return this._state.polylineClosed=e,this}markerStart(e){return this._state.startEndpoint=e,this}markerEnd(e){return this._state.endEndpoint=e,this}markers(e,t){return this._state.startEndpoint=e,this._state.endEndpoint=t,this}},$t=class extends B{constructor(e,t,n,i,a){super("image"),this._state.x=e,this._state.y=t,this._state.width=n,this._state.height=i,this._state.href=a}position(e,t){return this._state.x=e,this._state.y=t,this}size(e,t){return this._state.width=e,this._state.height=t,this}src(e){return this._state.href=e,this}preserveAspectRatio(e){return this._state.preserveAspectRatio=e,this}};var he=class{_x1;_y1;_x2;_y2;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(e=0,t=0,n=1,i=0){this._x1=e,this._y1=t,this._x2=n,this._y2=i,this._id=T()}stop(e,t,n=1){return this._stops.push({offset:e,color:t,opacity:n}),this}direction(e,t,n,i){return this._x1=e,this._y1=t,this._x2=n,this._y2=i,this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"linear-gradient",id:this._id,x1:this._x1,y1:this._y1,x2:this._x2,y2:this._y2,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},pe=class{_cx=.5;_cy=.5;_fx=.5;_fy=.5;_r=.5;_ry=.5;_rotation=0;_stops=[];_spreadMethod="pad";_opacity=1;_id;constructor(){this._id=T()}center(e,t){return this._cx=e,this._cy=t,this}focus(e,t){return this._fx=e,this._fy=t,this}radius(e,t){return this._r=e,this._ry=t??e,this}rotation(e){return this._rotation=e,this}stop(e,t,n=1){return this._stops.push({offset:e,color:t,opacity:n}),this}spread(e){return this._spreadMethod=e,this}opacity(e){return this._opacity=e,this}build(){return{type:"radial-gradient",id:this._id,cx:this._cx,cy:this._cy,fx:this._fx,fy:this._fy,r:this._r,ry:this._ry,rotation:this._rotation,stops:[...this._stops],spreadMethod:this._spreadMethod,opacity:this._opacity}}},fe=class{_patternType;_color;_backgroundColor;_scale=1;_rotation=0;_opacity=1;_patternParams;_id;_svgContent;_width;_height;_patternUnits;_patternContentUnits;_patternTransform;_viewBox;_preserveAspectRatio;_x;_y;_customPatternId;constructor(e="stripes",t="#000000",n="#ffffff"){this._patternType=e,this._color=t,this._backgroundColor=n,this._id=T()}scale(e){return this._scale=e,this}rotation(e){return this._rotation=e,this}opacity(e){return this._opacity=e,this}params(e){return this._patternParams=e,this}svgContent(e){return this._svgContent=e,this}size(e,t){return this._width=e,this._height=t,this}patternUnits(e){return this._patternUnits=e,this}patternContentUnits(e){return this._patternContentUnits=e,this}patternTransform(e){return this._patternTransform=e,this}viewBox(e){return this._viewBox=e,this}preserveAspectRatio(e){return this._preserveAspectRatio=e,this}position(e,t){return this._x=e,this._y=t,this}customPatternId(e){return this._customPatternId=e,this}build(){let e,t,n;if(this._svgContent!==void 0)e=this._svgContent,t=this._width??10,n=this._height??10;else{let a=je(this._patternType,this._scale,this._color,this._backgroundColor,this._patternParams);e=a.svgContent,t=this._width??a.width,n=this._height??a.height}let i={type:"pattern",id:this._id,patternType:this._svgContent!==void 0?"custom":this._patternType,color:this._color,backgroundColor:this._backgroundColor,scale:this._scale,rotation:this._rotation,opacity:this._opacity,svgContent:e,width:t,height:n,patternUnits:this._patternUnits??"userSpaceOnUse",patternParams:this._patternParams,patternTransform:this._patternTransform??(this._rotation?`rotate(${this._rotation})`:void 0)};return this._patternContentUnits&&(i.patternContentUnits=this._patternContentUnits),this._viewBox&&(i.viewBox=this._viewBox),this._preserveAspectRatio&&(i.preserveAspectRatio=this._preserveAspectRatio),this._x!==void 0&&(i.x=this._x),this._y!==void 0&&(i.y=this._y),this._customPatternId&&(i.customPatternId=this._customPatternId),i}};function Ar(r=0,e=0,t=1,n=0){return new he(r,e,t,n)}function Cr(){return new pe}function Ir(r="stripes",e="#000000",t="#ffffff"){return new fe(r,e,t)}0&&(module.exports={Arrow,BUILTIN_MARKER_ID_MAP,CURRENT_SCHEMA_VERSION,Circle,Cross,DEFAULT_COORDINATE_PRECISION,Document,EASING_CURVES,EVENT_TRIGGER_OPTIONS,EasingType,Ellipse,Gear,ImageShape,LIBRARY_EMIT_ORDER,Line,LinearGradientBuilder,MARKER_HEIGHT,MARKER_VIEWBOX,MARKER_WIDTH,MAX_COORDINATE_PRECISION,MIGRATIONS,NGon,PatternBuilder,Polyline,RadialGradientBuilder,Rectangle,Ring,ShapeBuilder,Spiral,Spline,SplineCurveType,SplinePointType,Square,Star,Text,Timeline,Track,Triangle,collectReferencedLibraryIds,computeArrowVertices,computeCloudPath,computeCrossVertices,computeDashArray,computeGearPath,computeGearVertices,computeHeartPath,computeLightningVertices,computePolygonVertices,computeRectanglePath,computeRingPath,computeSpeechBubbleVertices,computeSpiralPath,computeSplinePath,computeStarVertices,createDocument,createShape,createViewbox,escXml,extractVariables,filterAttr,generateCode,generateCssCode,generateD3Code,generateId,generatePatternSvgContent,generateReactCode,generateSvgCode,generateVueCode,getBuiltInMarkerDefs,getEasingCubicBezier,getEffectivePrecision,getMarkerDescriptors,getPatternElements,linearGradient,migrateSnapshot,parseDocument,parseVariableArgs,pattern,radialGradient,renderAnimationElements,renderBuiltinMarkerDefs,renderCircle,renderEllipse,renderFilterDefs,renderFilterLibraryDef,renderFilterPrimitivesForType,renderImage,renderLibraryDef,renderLibraryDefs,renderLine,renderLinearGradientLibraryDef,renderMarkerLibraryDef,renderPatternLibraryDef,renderPolygonShape,renderPolyline,renderRadialGradientLibraryDef,renderRectangle,renderReferencedLibraryDefs,renderShape,renderSpline,renderSymbolLibraryDef,renderText,renderToSvg,roundCoord,roundNumberString,roundSerializedShape,roundSnapshot,stringifyDocument,substituteString,substituteVariables,validateSnapshot,verticesToPath});
|