semiotic 3.8.1 → 3.8.3

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.
Files changed (178) hide show
  1. package/CLAUDE.md +3 -1
  2. package/README.md +54 -52
  3. package/ai/behaviorContracts.cjs +9 -0
  4. package/ai/dist/mcp-server.js +142 -13
  5. package/ai/schema.json +616 -42
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/system-prompt.md +5 -2
  8. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
  9. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
  10. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
  11. package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
  12. package/dist/chunk-chunk-2CCFBTQC.module.min.js +2 -0
  13. package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
  14. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
  15. package/dist/chunk-chunk-2RXP3FS3.module.min.js +1 -0
  16. package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
  17. package/dist/chunk-chunk-4TMZXLCR.module.min.js +1 -0
  18. package/dist/chunk-chunk-5APBQXZA.module.min.js +1 -0
  19. package/dist/chunk-chunk-5RKXZQ2P.module.min.js +1 -0
  20. package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
  21. package/dist/chunk-chunk-6HSGDMTA.module.min.js +2 -0
  22. package/dist/chunk-chunk-7FW6EGLP.module.min.js +2 -0
  23. package/dist/chunk-chunk-7OEOSCBP.module.min.js +1 -0
  24. package/dist/chunk-chunk-A63CTACR.module.min.js +2 -0
  25. package/dist/chunk-chunk-ANYDWOZF.module.min.js +1 -0
  26. package/dist/chunk-chunk-AZJUDQRM.module.min.js +2 -0
  27. package/dist/chunk-chunk-B6V35LMY.module.min.js +2 -0
  28. package/dist/chunk-chunk-BOSVL645.module.min.js +2 -0
  29. package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
  30. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
  31. package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
  32. package/dist/chunk-chunk-EMO5NUGE.module.min.js +2 -0
  33. package/dist/chunk-chunk-F25UA5HT.module.min.js +1 -0
  34. package/dist/chunk-chunk-FRIO6MCV.module.min.js +1 -0
  35. package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
  36. package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
  37. package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
  38. package/dist/chunk-chunk-GWSWSPXN.module.min.js +1 -0
  39. package/dist/chunk-chunk-I6C3KR5H.module.min.js +2 -0
  40. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  41. package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
  42. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  43. package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
  44. package/dist/chunk-chunk-J5RL6GXU.module.min.js +2 -0
  45. package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
  46. package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
  47. package/dist/chunk-chunk-JNCHKRIR.module.min.js +2 -0
  48. package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
  49. package/dist/chunk-chunk-L3H6DQCR.module.min.js +2 -0
  50. package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
  51. package/dist/chunk-chunk-M7VYYHCE.module.min.js +2 -0
  52. package/dist/chunk-chunk-MC35ILYP.module.min.js +2 -0
  53. package/dist/chunk-chunk-N72SWNBV.module.min.js +1 -0
  54. package/dist/chunk-chunk-OBQRFTIL.module.min.js +2 -0
  55. package/dist/chunk-chunk-OQTLSTGI.module.min.js +2 -0
  56. package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
  57. package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
  58. package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
  59. package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
  60. package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
  61. package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
  62. package/dist/chunk-chunk-SA3D43RA.module.min.js +2 -0
  63. package/dist/chunk-chunk-SANERMIZ.module.min.js +2 -0
  64. package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
  65. package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
  66. package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
  67. package/dist/chunk-chunk-UHSZEB74.module.min.js +1 -0
  68. package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
  69. package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
  70. package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
  71. package/dist/chunk-chunk-XQYVEKEJ.module.min.js +2 -0
  72. package/dist/chunk-chunk-Y6AXCRVO.module.min.js +1 -0
  73. package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
  74. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
  75. package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
  76. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
  77. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
  78. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  79. package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
  80. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -6
  81. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +11 -0
  82. package/dist/components/charts/shared/areaSeriesData.d.ts +15 -0
  83. package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
  84. package/dist/components/charts/shared/chartMode.d.ts +67 -0
  85. package/dist/components/charts/shared/colorUtils.d.ts +8 -0
  86. package/dist/components/charts/shared/geoStyleDefaults.d.ts +3 -0
  87. package/dist/components/charts/shared/hooks.d.ts +13 -80
  88. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  89. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  90. package/dist/components/charts/shared/useXYLineStyle.d.ts +3 -2
  91. package/dist/components/charts/shared/xyLineStyle.d.ts +21 -0
  92. package/dist/components/charts/xy/LineChart.d.ts +3 -0
  93. package/dist/components/legendLayout.d.ts +31 -0
  94. package/dist/components/server/serverChartConfigShared.d.ts +29 -0
  95. package/dist/components/server/serverChartConfigs.d.ts +2 -13
  96. package/dist/components/server/serverChartConfigsXY.d.ts +3 -0
  97. package/dist/components/server/serverGaugeOverlay.d.ts +28 -0
  98. package/dist/components/server/staticLegend.d.ts +7 -1
  99. package/dist/components/server/staticSVGChrome.d.ts +60 -2
  100. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  101. package/dist/components/stream/GeoSVGOverlay.d.ts +2 -0
  102. package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
  103. package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
  104. package/dist/components/stream/SceneToSVG.d.ts +8 -6
  105. package/dist/components/stream/SceneToSVGGeo.d.ts +10 -0
  106. package/dist/components/stream/SceneToSVGNetwork.d.ts +12 -0
  107. package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
  108. package/dist/components/stream/canvasBackground.d.ts +7 -0
  109. package/dist/components/stream/networkTypes.d.ts +2 -4
  110. package/dist/components/stream/renderBackend.d.ts +14 -0
  111. package/dist/components/stream/sceneToSVGShared.d.ts +51 -0
  112. package/dist/components/types/legendTypes.d.ts +16 -3
  113. package/dist/controls.min.js +1 -1
  114. package/dist/controls.module.min.js +1 -1
  115. package/dist/geo.min.js +1 -1
  116. package/dist/geo.module.min.js +1 -1
  117. package/dist/network.min.js +1 -1
  118. package/dist/network.module.min.js +1 -1
  119. package/dist/ordinal.min.js +1 -1
  120. package/dist/ordinal.module.min.js +1 -1
  121. package/dist/physics-matter.min.js +1 -1
  122. package/dist/physics-matter.module.min.js +1 -1
  123. package/dist/physics-rapier.min.js +1 -1
  124. package/dist/physics-rapier.module.min.js +1 -1
  125. package/dist/physics.min.js +1 -1
  126. package/dist/physics.module.min.js +1 -1
  127. package/dist/realtime.min.js +1 -1
  128. package/dist/realtime.module.min.js +1 -1
  129. package/dist/rough.min.js +1 -1
  130. package/dist/rough.module.min.js +1 -1
  131. package/dist/semiotic-ai-core.min.js +1 -1
  132. package/dist/semiotic-ai-core.module.min.js +1 -1
  133. package/dist/semiotic-ai.min.js +1 -1
  134. package/dist/semiotic-ai.module.min.js +1 -1
  135. package/dist/semiotic-data.min.js +1 -1
  136. package/dist/semiotic-data.module.min.js +1 -1
  137. package/dist/semiotic-experimental.min.js +1 -1
  138. package/dist/semiotic-experimental.module.min.js +1 -1
  139. package/dist/semiotic-realtime-core.min.js +1 -1
  140. package/dist/semiotic-realtime-core.module.min.js +1 -1
  141. package/dist/semiotic-realtime-react.min.js +1 -1
  142. package/dist/semiotic-realtime-react.module.min.js +1 -1
  143. package/dist/semiotic-recipes-core.min.js +1 -1
  144. package/dist/semiotic-recipes-core.module.min.js +1 -1
  145. package/dist/semiotic-recipes-react.min.js +1 -1
  146. package/dist/semiotic-recipes-react.module.min.js +1 -1
  147. package/dist/semiotic-recipes.min.js +1 -1
  148. package/dist/semiotic-recipes.module.min.js +1 -1
  149. package/dist/semiotic-server-edge.min.js +1 -1
  150. package/dist/semiotic-server-edge.module.min.js +1 -1
  151. package/dist/semiotic-server-node.min.js +1 -1
  152. package/dist/semiotic-server-node.module.min.js +1 -1
  153. package/dist/semiotic-themes-core.min.js +1 -1
  154. package/dist/semiotic-themes-core.module.min.js +1 -1
  155. package/dist/semiotic-themes-react.min.js +1 -1
  156. package/dist/semiotic-themes-react.module.min.js +1 -1
  157. package/dist/semiotic-themes.min.js +1 -1
  158. package/dist/semiotic-themes.module.min.js +1 -1
  159. package/dist/semiotic-utils-core.min.js +1 -1
  160. package/dist/semiotic-utils-core.module.min.js +1 -1
  161. package/dist/semiotic-utils-react.min.js +1 -1
  162. package/dist/semiotic-utils-react.module.min.js +1 -1
  163. package/dist/semiotic-utils.min.js +1 -1
  164. package/dist/semiotic-utils.module.min.js +1 -1
  165. package/dist/semiotic-value.min.js +1 -1
  166. package/dist/semiotic-value.module.min.js +1 -1
  167. package/dist/semiotic.min.js +1 -1
  168. package/dist/semiotic.module.min.js +1 -1
  169. package/dist/server.min.js +1 -1
  170. package/dist/server.module.min.js +1 -1
  171. package/dist/xy.min.js +1 -1
  172. package/dist/xy.module.min.js +1 -1
  173. package/package.json +4 -4
  174. package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
  175. package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
  176. package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
  177. package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
  178. package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
package/dist/rough.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(e,t,o,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))a.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(s=n(t,l))||s.enumerable});return e},l={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(l,{createRoughRenderMode:()=>W,stableRoughSeed:()=>P}),module.exports=(e=l,s(r({},"__esModule",{value:!0}),e));var c=((e,n,i)=>(i=null!=e?t(o(e)):{},s(e&&e.__esModule?i:r(i,"default",{value:e,enumerable:!0}),e)))(require("roughjs")),f=/^var\(\s*(--[^,)]+)(?:\s*,\s*([^)]+))?\s*\)$/,u=new WeakMap,p=0,d=!1,y=null,h=null;function g(e,t){if(!t)return t;const r=f.exec(t);if(!r)return t;const n=e.canvas;if(!n)return r[2]?.trim()||t;!function(){if(d)return;if("undefined"==typeof window||"undefined"==typeof document)return;d=!0;const e=()=>{p++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"]}),"function"==typeof window.matchMedia)try{y=window.matchMedia("(prefers-color-scheme: dark)"),h=e,"function"==typeof y.addEventListener?y.addEventListener("change",h):"function"==typeof y.addListener&&y.addListener(h)}catch{}}();let i=u.get(n);i&&i.version===p||(i={version:p,map:new Map},u.set(n,i));const o=i.map.get(t);if(void 0!==o)return o;const a=getComputedStyle(n).getPropertyValue(r[1]).trim()||r[2]?.trim()||t;return i.map.set(t,a),a}var k=require("react/jsx-runtime"),m=1,b=2147483647;function v(e){return"number"==typeof e&&Number.isFinite(e)}function x(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){if(!Array.isArray(r)||!v(r[0])||!v(r[1]))return null;t.push([r[0],r[1]])}return t}function O(e){if(e.style?.icon||e.fillGradient||e.strokeGradient||e.colorThresholds||e.clipRect)return null;if("rect"===e.type&&v(e.x)&&v(e.y)&&v(e.w)&&v(e.h))return{kind:"rectangle",x:e.x,y:e.y,width:e.w,height:e.h};if("point"===e.type&&v(e.x)&&v(e.y)&&v(e.r))return{kind:"circle",x:e.x,y:e.y,diameter:2*e.r};if("circle"===e.type&&v(e.cx)&&v(e.cy)&&v(e.r))return{kind:"circle",x:e.cx,y:e.cy,diameter:2*e.r};if("line"===e.type){const t=x(e.path);if(t&&t.length>=2&&!e._decayOpacities)return{kind:"linearPath",points:t};if(v(e.x1)&&v(e.y1)&&v(e.x2)&&v(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}if("area"===e.type){const t=x(e.topPath),r=x(e.bottomPath);if(t&&r&&t.length>1&&r.length>1&&!e._decayOpacities)return{kind:"polygon",points:[...t,...r.slice().reverse()]}}if("geoarea"===e.type&&"string"==typeof e.pathData&&e.pathData)return{kind:"path",d:e.pathData};if(("bezier"===e.type||"ribbon"===e.type||"curved"===e.type)&&"string"==typeof e.pathD&&e.pathD)return{kind:"path",d:e.pathD};if("trapezoid"===e.type){const t=x(e.points);if(t&&t.length>=3)return{kind:"polygon",points:t}}if("connector"===e.type&&v(e.x1)&&v(e.y1)&&v(e.x2)&&v(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2};if("violin"===e.type&&"string"==typeof e.pathString&&v(e.translateX)&&v(e.translateY))return{kind:"path",d:e.pathString,transform:{x:e.translateX,y:e.translateY}};if("symbol"===e.type&&"string"==typeof e.path){const t=v(e.x)?e.x:e.cx,r=v(e.y)?e.y:e.cy;if(v(t)&&v(r))return{kind:"path",d:e.path,transform:{x:t,y:r,rotation:v(e.rotation)?e.rotation:void 0}}}return"arc"===e.type&&v(e.cx)&&v(e.cy)&&v(e.outerR)&&v(e.startAngle)&&v(e.endAngle)?{kind:"arc",x:e.cx,y:e.cy,width:2*e.outerR,height:2*e.outerR,start:e.startAngle,stop:e.endAngle,closed:!0}:null}function D(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>D(e,t));const r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,D(r[e],t)]))}function w(e){return JSON.stringify(D(e))??e+""}function P(e){const t="string"==typeof e?e:w(e);let r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%b+1}function S(e){const t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function j(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function M(e){if(!e)return;const t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function L(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function A(e,t,r){e.beginPath();for(const n of t.ops){const t="number"!=typeof r||0>r?n.data:n.data.map(e=>+e.toFixed(r));"move"===n.op?e.moveTo(t[0],t[1]):"lineTo"===n.op?e.lineTo(t[0],t[1]):"bcurveTo"===n.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function W(e={}){const t=function(e){return v(e)&&Math.trunc(Math.abs(e))%b||m}(e.seed),r=v(e.cacheSize)?Math.max(1,Math.trunc(e.cacheSize)):1e3,n=Object.fromEntries(Object.entries({roughness:e.roughness,bowing:e.bowing,maxRandomnessOffset:e.maxRandomnessOffset,curveFitting:e.curveFitting,curveTightness:e.curveTightness,curveStepCount:e.curveStepCount,fillStyle:e.fillStyle,fillWeight:e.fillWeight,hachureAngle:e.hachureAngle,hachureGap:e.hachureGap,dashOffset:e.dashOffset,dashGap:e.dashGap,zigzagOffset:e.zigzagOffset,disableMultiStroke:e.disableMultiStroke,disableMultiStrokeFill:e.disableMultiStrokeFill,preserveVertices:e.preserveVertices,simplification:e.simplification,fixedDecimalPlaceDigits:e.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),i=w({...n,seed:t}),o=c.default.generator(),a=new Map;function s(e,r){const n=O(e);return w({backend:"roughjs",identity:S(e),type:e.type,geometry:n,style:j(r),options:i,seed:t})}function l(e,i,l){const c=O(e);if(!c)return null;const f=function(e,t){if(t.fill&&"string"!=typeof t.fill)return null;if("string"==typeof t.fill&&t.fill.startsWith("url("))return null;const r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,n=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:n??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:n??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:n??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:n??"none"};case"symbol":return{fill:r,stroke:n??(r?"none":"#4e79a7")};default:return{fill:r,stroke:n??"#007bff"}}}(e,i);if(!f)return null;const u=l?{fill:f.fill?g(l,f.fill)||f.fill:void 0,stroke:g(l,f.stroke)||f.stroke}:f,p=`${s(e,i)}:${w(u)}`,d=a.get(p);if(d)return a.delete(p),a.set(p,d),d;const y=P(`${t}:${S(e)??w(c)}`),h={...n,seed:y,fill:u.fill,stroke:u.stroke,strokeWidth:i.strokeWidth??1,strokeLineDash:M(i.strokeDasharray)},k={drawable:L(o,c,h),geometry:c,style:i};for(a.set(p,k);a.size>r;){const e=a.keys().next().value;if(void 0===e)break;a.delete(e)}return k}const f={id:"roughjs",seed:t,cacheKey:s,drawCanvas({context:e,node:t,style:r}){const n=l(t,r,e);return!!n&&(function(e,t){const{drawable:r,geometry:n,style:i}=t,o=r.options,a=e.globalAlpha,s="path"===n.kind?n.transform:void 0;s&&(e.translate(s.x,s.y),s.rotation&&e.rotate(s.rotation));for(const t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===o.stroke?"transparent":o.stroke,e.lineWidth=o.strokeWidth,e.globalAlpha=a*(i.opacity??1),o.strokeLineDash&&e.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(e.lineDashOffset=o.strokeLineDashOffset),A(e,t,o.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=o.fill??"transparent",e.globalAlpha=a*(i.opacity??1)*(i.fillOpacity??1),A(e,t,o.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{const r=0>o.fillWeight?o.strokeWidth/2:o.fillWeight;e.strokeStyle=o.fill??"transparent",e.lineWidth=r,e.globalAlpha=a*(i.opacity??1)*(i.fillOpacity??1),o.fillLineDash&&e.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(e.lineDashOffset=o.fillLineDashOffset),A(e,t,o.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,n),!0)},renderStaticSVG({node:e,style:t,key:r}){const n=l(e,t);if(!n)return null;const i="path"===n.geometry.kind?n.geometry.transform:void 0,a=o.toPaths(n.drawable).map((e,n)=>(0,k.jsx)("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${n}`));return(0,k.jsx)("g",{"data-semiotic-render-backend":"roughjs",transform:i?`translate(${i.x} ${i.y})${i.rotation?` rotate(${180*i.rotation/Math.PI})`:""}`:void 0,children:a},r)},clearCache(){a.clear()},get cacheEntries(){return a.size}};return f}
1
+ var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(e,t,o,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))a.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(s=n(t,l))||s.enumerable});return e},l={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(l,{createRoughRenderMode:()=>W,stableRoughSeed:()=>P}),module.exports=(e=l,s(r({},"__esModule",{value:!0}),e));var c=((e,n,i)=>(i=null!=e?t(o(e)):{},s(e&&e.__esModule?i:r(i,"default",{value:e,enumerable:!0}),e)))(require("roughjs")),f=/^var\(\s*(--[^,)]+)(?:\s*,\s*([^)]+))?\s*\)$/,u=new WeakMap,p=0,d=!1,y=null,h=null;function g(e,t){if(!t)return t;const r=f.exec(t);if(!r)return t;const n=e.canvas;if(!n)return r[2]?.trim()||t;!function(){if(d)return;if("undefined"==typeof window||"undefined"==typeof document)return;d=!0;const e=()=>{p++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"]}),"function"==typeof window.matchMedia)try{y=window.matchMedia("(prefers-color-scheme: dark)"),h=e,"function"==typeof y.addEventListener?y.addEventListener("change",h):"function"==typeof y.addListener&&y.addListener(h)}catch{}}();let i=u.get(n);i&&i.version===p||(i={version:p,map:new Map},u.set(n,i));const o=i.map.get(t);if(void 0!==o)return o;const a=getComputedStyle(n).getPropertyValue(r[1]).trim()||r[2]?.trim()||t;return i.map.set(t,a),a}var k=require("react/jsx-runtime"),m=1,b=2147483647;function v(e){return"number"==typeof e&&Number.isFinite(e)}function x(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){if(!Array.isArray(r)||!v(r[0])||!v(r[1]))return null;t.push([r[0],r[1]])}return t}function O(e){if(e.style?.icon||e.fillGradient||e.strokeGradient||e.colorThresholds||e.clipRect)return null;if("rect"===e.type&&v(e.x)&&v(e.y)&&v(e.w)&&v(e.h))return{kind:"rectangle",x:e.x,y:e.y,width:e.w,height:e.h};if("point"===e.type&&v(e.x)&&v(e.y)&&v(e.r))return{kind:"circle",x:e.x,y:e.y,diameter:2*e.r};if("circle"===e.type&&v(e.cx)&&v(e.cy)&&v(e.r))return{kind:"circle",x:e.cx,y:e.cy,diameter:2*e.r};if("line"===e.type){const t=x(e.path);if(t&&t.length>=2&&!e._decayOpacities)return{kind:"linearPath",points:t};if(v(e.x1)&&v(e.y1)&&v(e.x2)&&v(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}if("area"===e.type){const t=x(e.topPath),r=x(e.bottomPath);if(t&&r&&t.length>1&&r.length>1&&!e._decayOpacities)return{kind:"polygon",points:[...t,...r.slice().reverse()]}}if("geoarea"===e.type&&"string"==typeof e.pathData&&e.pathData)return{kind:"path",d:e.pathData};if(("bezier"===e.type||"ribbon"===e.type||"curved"===e.type)&&"string"==typeof e.pathD&&e.pathD)return{kind:"path",d:e.pathD};if("trapezoid"===e.type){const t=x(e.points);if(t&&t.length>=3)return{kind:"polygon",points:t}}if("connector"===e.type&&v(e.x1)&&v(e.y1)&&v(e.x2)&&v(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2};if("violin"===e.type&&"string"==typeof e.pathString&&v(e.translateX)&&v(e.translateY))return{kind:"path",d:e.pathString,transform:{x:e.translateX,y:e.translateY}};if("symbol"===e.type&&"string"==typeof e.path){const t=v(e.x)?e.x:e.cx,r=v(e.y)?e.y:e.cy;if(v(t)&&v(r))return{kind:"path",d:e.path,transform:{x:t,y:r,rotation:v(e.rotation)?e.rotation:void 0}}}return"arc"===e.type&&v(e.cx)&&v(e.cy)&&v(e.outerR)&&v(e.startAngle)&&v(e.endAngle)?{kind:"arc",x:e.cx,y:e.cy,width:2*e.outerR,height:2*e.outerR,start:e.startAngle,stop:e.endAngle,closed:!0}:null}function D(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>D(e,t));const r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,D(r[e],t)]))}function w(e){return JSON.stringify(D(e))??e+""}function P(e){const t="string"==typeof e?e:w(e);let r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%b+1}function S(e){const t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function j(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function M(e){if(!e)return;const t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function L(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function A(e,t,r){e.beginPath();for(const n of t.ops){const t="number"!=typeof r||0>r?n.data:n.data.map(e=>+e.toFixed(r));"move"===n.op?e.moveTo(t[0],t[1]):"lineTo"===n.op?e.lineTo(t[0],t[1]):"bcurveTo"===n.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function W(e={}){const t=function(e){return v(e)&&Math.trunc(Math.abs(e))%b||m}(e.seed),r=v(e.cacheSize)?Math.max(1,Math.trunc(e.cacheSize)):1e3,n=Object.fromEntries(Object.entries({roughness:e.roughness,bowing:e.bowing,maxRandomnessOffset:e.maxRandomnessOffset,curveFitting:e.curveFitting,curveTightness:e.curveTightness,curveStepCount:e.curveStepCount,fillStyle:e.fillStyle,fillWeight:e.fillWeight,hachureAngle:e.hachureAngle,hachureGap:e.hachureGap,dashOffset:e.dashOffset,dashGap:e.dashGap,zigzagOffset:e.zigzagOffset,disableMultiStroke:e.disableMultiStroke,disableMultiStrokeFill:e.disableMultiStrokeFill,preserveVertices:e.preserveVertices,simplification:e.simplification,fixedDecimalPlaceDigits:e.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),i=w({...n,seed:t}),o=c.default.generator(),a=new Map;function s(e,r){const n=O(e);return w({backend:"roughjs",identity:S(e),type:e.type,geometry:n,style:j(r),options:i,seed:t})}function l(e,i,l){const c=O(e);if(!c)return null;const f=function(e,t){if(t.fill&&"string"!=typeof t.fill)return null;if("string"==typeof t.fill&&t.fill.startsWith("url("))return null;const r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,n=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:n??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:n??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:n??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:n??"none"};case"symbol":return{fill:r,stroke:n??(r?"none":"#4e79a7")};default:return{fill:r,stroke:n??"#007bff"}}}(e,i);if(!f)return null;const u=l?{fill:f.fill?g(l,f.fill)||f.fill:void 0,stroke:g(l,f.stroke)||f.stroke}:f,p=`${s(e,i)}:${w(u)}`,d=a.get(p);if(d)return a.delete(p),a.set(p,d),d;const y=P(`${t}:${S(e)??w(c)}`),h={...n,seed:y,fill:u.fill,stroke:u.stroke,strokeWidth:i.strokeWidth??1,strokeLineDash:M(i.strokeDasharray)},k={drawable:L(o,c,h),geometry:c,style:i};for(a.set(p,k);a.size>r;){const e=a.keys().next().value;if(void 0===e)break;a.delete(e)}return k}const f={id:"roughjs",seed:t,cacheKey:s,drawCanvas({context:e,node:t,style:r}){const n=l(t,r,e);return!!n&&(function(e,t){const{drawable:r,geometry:n,style:i}=t,o=r.options,a=e.globalAlpha,s="path"===n.kind?n.transform:void 0;s&&(e.translate(s.x,s.y),s.rotation&&e.rotate(s.rotation));for(const t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===o.stroke?"transparent":o.stroke,e.lineWidth=o.strokeWidth,e.globalAlpha=a*(i.opacity??1),o.strokeLineDash&&e.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(e.lineDashOffset=o.strokeLineDashOffset),A(e,t,o.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=o.fill??"transparent",e.globalAlpha=a*(i.opacity??1)*(i.fillOpacity??1),A(e,t,o.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{const r=0>o.fillWeight?o.strokeWidth/2:o.fillWeight;e.strokeStyle=o.fill??"transparent",e.lineWidth=r,e.globalAlpha=a*(i.opacity??1)*(i.fillOpacity??1),o.fillLineDash&&e.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(e.lineDashOffset=o.fillLineDashOffset),A(e,t,o.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,n),!0)},renderStaticSVG({node:e,style:t,key:r}){const n=l(e,t);if(!n)return null;const i="path"===n.geometry.kind?n.geometry.transform:void 0,a=o.toPaths(n.drawable).map((e,n)=>(0,k.jsx)("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${n}`));return(0,k.jsx)("g",{"data-semiotic-render-backend":"roughjs",transform:i?`translate(${i.x} ${i.y})${i.rotation?` rotate(${180*i.rotation/Math.PI})`:""}`:void 0,children:a},r)},clearCache(){a.clear()},get cacheEntries(){return a.size}};return f}
@@ -1 +1 @@
1
- import e from"roughjs";var t=/^var\(\s*(--[^,)]+)(?:\s*,\s*([^)]+))?\s*\)$/,r=new WeakMap,i=0,n=!1,o=null,a=null;function s(e,s){if(!s)return s;const l=t.exec(s);if(!l)return s;const c=e.canvas;if(!c)return l[2]?.trim()||s;!function(){if(n)return;if("undefined"==typeof window||"undefined"==typeof document)return;n=!0;const e=()=>{i++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"]}),"function"==typeof window.matchMedia)try{o=window.matchMedia("(prefers-color-scheme: dark)"),a=e,"function"==typeof o.addEventListener?o.addEventListener("change",a):"function"==typeof o.addListener&&o.addListener(a)}catch{}}();let f=r.get(c);f&&f.version===i||(f={version:i,map:new Map},r.set(c,f));const u=f.map.get(s);if(void 0!==u)return u;const p=getComputedStyle(c).getPropertyValue(l[1]).trim()||l[2]?.trim()||s;return f.map.set(s,p),p}import{jsx as l}from"react/jsx-runtime";var c=2147483647;function f(e){return"number"==typeof e&&Number.isFinite(e)}function u(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){if(!Array.isArray(r)||!f(r[0])||!f(r[1]))return null;t.push([r[0],r[1]])}return t}function p(e){if(e.style?.icon||e.fillGradient||e.strokeGradient||e.colorThresholds||e.clipRect)return null;if("rect"===e.type&&f(e.x)&&f(e.y)&&f(e.w)&&f(e.h))return{kind:"rectangle",x:e.x,y:e.y,width:e.w,height:e.h};if("point"===e.type&&f(e.x)&&f(e.y)&&f(e.r))return{kind:"circle",x:e.x,y:e.y,diameter:2*e.r};if("circle"===e.type&&f(e.cx)&&f(e.cy)&&f(e.r))return{kind:"circle",x:e.cx,y:e.cy,diameter:2*e.r};if("line"===e.type){const t=u(e.path);if(t&&t.length>=2&&!e._decayOpacities)return{kind:"linearPath",points:t};if(f(e.x1)&&f(e.y1)&&f(e.x2)&&f(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}if("area"===e.type){const t=u(e.topPath),r=u(e.bottomPath);if(t&&r&&t.length>1&&r.length>1&&!e._decayOpacities)return{kind:"polygon",points:[...t,...r.slice().reverse()]}}if("geoarea"===e.type&&"string"==typeof e.pathData&&e.pathData)return{kind:"path",d:e.pathData};if(("bezier"===e.type||"ribbon"===e.type||"curved"===e.type)&&"string"==typeof e.pathD&&e.pathD)return{kind:"path",d:e.pathD};if("trapezoid"===e.type){const t=u(e.points);if(t&&t.length>=3)return{kind:"polygon",points:t}}if("connector"===e.type&&f(e.x1)&&f(e.y1)&&f(e.x2)&&f(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2};if("violin"===e.type&&"string"==typeof e.pathString&&f(e.translateX)&&f(e.translateY))return{kind:"path",d:e.pathString,transform:{x:e.translateX,y:e.translateY}};if("symbol"===e.type&&"string"==typeof e.path){const t=f(e.x)?e.x:e.cx,r=f(e.y)?e.y:e.cy;if(f(t)&&f(r))return{kind:"path",d:e.path,transform:{x:t,y:r,rotation:f(e.rotation)?e.rotation:void 0}}}return"arc"===e.type&&f(e.cx)&&f(e.cy)&&f(e.outerR)&&f(e.startAngle)&&f(e.endAngle)?{kind:"arc",x:e.cx,y:e.cy,width:2*e.outerR,height:2*e.outerR,start:e.startAngle,stop:e.endAngle,closed:!0}:null}function d(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>d(e,t));const r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,d(r[e],t)]))}function y(e){return JSON.stringify(d(e))??e+""}function h(e){const t="string"==typeof e?e:y(e);let r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%c+1}function g(e){const t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function k(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function m(e){if(!e)return;const t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function b(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function x(e,t,r){e.beginPath();for(const i of t.ops){const t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function v(t={}){const r=function(e){return f(e)&&Math.trunc(Math.abs(e))%c||1}(t.seed),i=f(t.cacheSize)?Math.max(1,Math.trunc(t.cacheSize)):1e3,n=Object.fromEntries(Object.entries({roughness:t.roughness,bowing:t.bowing,maxRandomnessOffset:t.maxRandomnessOffset,curveFitting:t.curveFitting,curveTightness:t.curveTightness,curveStepCount:t.curveStepCount,fillStyle:t.fillStyle,fillWeight:t.fillWeight,hachureAngle:t.hachureAngle,hachureGap:t.hachureGap,dashOffset:t.dashOffset,dashGap:t.dashGap,zigzagOffset:t.zigzagOffset,disableMultiStroke:t.disableMultiStroke,disableMultiStrokeFill:t.disableMultiStrokeFill,preserveVertices:t.preserveVertices,simplification:t.simplification,fixedDecimalPlaceDigits:t.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),o=y({...n,seed:r}),a=e.generator(),u=new Map;function d(e,t){const i=p(e);return y({backend:"roughjs",identity:g(e),type:e.type,geometry:i,style:k(t),options:o,seed:r})}function v(e,t,o){const l=p(e);if(!l)return null;const c=function(e,t){if(t.fill&&"string"!=typeof t.fill)return null;if("string"==typeof t.fill&&t.fill.startsWith("url("))return null;const r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}(e,t);if(!c)return null;const f=o?{fill:c.fill?s(o,c.fill)||c.fill:void 0,stroke:s(o,c.stroke)||c.stroke}:c,k=`${d(e,t)}:${y(f)}`,x=u.get(k);if(x)return u.delete(k),u.set(k,x),x;const v=h(`${r}:${g(e)??y(l)}`),D={...n,seed:v,fill:f.fill,stroke:f.stroke,strokeWidth:t.strokeWidth??1,strokeLineDash:m(t.strokeDasharray)},O={drawable:b(a,l,D),geometry:l,style:t};for(u.set(k,O);u.size>i;){const e=u.keys().next().value;if(void 0===e)break;u.delete(e)}return O}const D={id:"roughjs",seed:r,cacheKey:d,drawCanvas({context:e,node:t,style:r}){const i=v(t,r,e);return!!i&&(function(e,t){const{drawable:r,geometry:i,style:n}=t,o=r.options,a=e.globalAlpha,s="path"===i.kind?i.transform:void 0;s&&(e.translate(s.x,s.y),s.rotation&&e.rotate(s.rotation));for(const t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===o.stroke?"transparent":o.stroke,e.lineWidth=o.strokeWidth,e.globalAlpha=a*(n.opacity??1),o.strokeLineDash&&e.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(e.lineDashOffset=o.strokeLineDashOffset),x(e,t,o.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=o.fill??"transparent",e.globalAlpha=a*(n.opacity??1)*(n.fillOpacity??1),x(e,t,o.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{const r=0>o.fillWeight?o.strokeWidth/2:o.fillWeight;e.strokeStyle=o.fill??"transparent",e.lineWidth=r,e.globalAlpha=a*(n.opacity??1)*(n.fillOpacity??1),o.fillLineDash&&e.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(e.lineDashOffset=o.fillLineDashOffset),x(e,t,o.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,i),!0)},renderStaticSVG({node:e,style:t,key:r}){const i=v(e,t);if(!i)return null;const n="path"===i.geometry.kind?i.geometry.transform:void 0,o=a.toPaths(i.drawable).map((e,i)=>l("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${i}`));return l("g",{"data-semiotic-render-backend":"roughjs",transform:n?`translate(${n.x} ${n.y})${n.rotation?` rotate(${180*n.rotation/Math.PI})`:""}`:void 0,children:o},r)},clearCache(){u.clear()},get cacheEntries(){return u.size}};return D}export{v as createRoughRenderMode,h as stableRoughSeed};
1
+ import{resolveCSSColor as e}from"./chunk-chunk-QRIBHZYW.module.min.js";import t from"roughjs";import{jsx as r}from"react/jsx-runtime";var i=2147483647;function n(e){return"number"==typeof e&&Number.isFinite(e)}function a(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){if(!Array.isArray(r)||!n(r[0])||!n(r[1]))return null;t.push([r[0],r[1]])}return t}function o(e){if(e.style?.icon||e.fillGradient||e.strokeGradient||e.colorThresholds||e.clipRect)return null;if("rect"===e.type&&n(e.x)&&n(e.y)&&n(e.w)&&n(e.h))return{kind:"rectangle",x:e.x,y:e.y,width:e.w,height:e.h};if("point"===e.type&&n(e.x)&&n(e.y)&&n(e.r))return{kind:"circle",x:e.x,y:e.y,diameter:2*e.r};if("circle"===e.type&&n(e.cx)&&n(e.cy)&&n(e.r))return{kind:"circle",x:e.cx,y:e.cy,diameter:2*e.r};if("line"===e.type){const t=a(e.path);if(t&&t.length>=2&&!e._decayOpacities)return{kind:"linearPath",points:t};if(n(e.x1)&&n(e.y1)&&n(e.x2)&&n(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}if("area"===e.type){const t=a(e.topPath),r=a(e.bottomPath);if(t&&r&&t.length>1&&r.length>1&&!e._decayOpacities)return{kind:"polygon",points:[...t,...r.slice().reverse()]}}if("geoarea"===e.type&&"string"==typeof e.pathData&&e.pathData)return{kind:"path",d:e.pathData};if(("bezier"===e.type||"ribbon"===e.type||"curved"===e.type)&&"string"==typeof e.pathD&&e.pathD)return{kind:"path",d:e.pathD};if("trapezoid"===e.type){const t=a(e.points);if(t&&t.length>=3)return{kind:"polygon",points:t}}if("connector"===e.type&&n(e.x1)&&n(e.y1)&&n(e.x2)&&n(e.y2))return{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2};if("violin"===e.type&&"string"==typeof e.pathString&&n(e.translateX)&&n(e.translateY))return{kind:"path",d:e.pathString,transform:{x:e.translateX,y:e.translateY}};if("symbol"===e.type&&"string"==typeof e.path){const t=n(e.x)?e.x:e.cx,r=n(e.y)?e.y:e.cy;if(n(t)&&n(r))return{kind:"path",d:e.path,transform:{x:t,y:r,rotation:n(e.rotation)?e.rotation:void 0}}}return"arc"===e.type&&n(e.cx)&&n(e.cy)&&n(e.outerR)&&n(e.startAngle)&&n(e.endAngle)?{kind:"arc",x:e.cx,y:e.cy,width:2*e.outerR,height:2*e.outerR,start:e.startAngle,stop:e.endAngle,closed:!0}:null}function s(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>s(e,t));const r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,s(r[e],t)]))}function l(e){return JSON.stringify(s(e))??e+""}function c(e){const t="string"==typeof e?e:l(e);let r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%i+1}function f(e){const t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function u(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function p(e){if(!e)return;const t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function h(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function y(e,t,r){e.beginPath();for(const i of t.ops){const t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function d(a={}){const s=function(e){return n(e)&&Math.trunc(Math.abs(e))%i||1}(a.seed),d=n(a.cacheSize)?Math.max(1,Math.trunc(a.cacheSize)):1e3,g=Object.fromEntries(Object.entries({roughness:a.roughness,bowing:a.bowing,maxRandomnessOffset:a.maxRandomnessOffset,curveFitting:a.curveFitting,curveTightness:a.curveTightness,curveStepCount:a.curveStepCount,fillStyle:a.fillStyle,fillWeight:a.fillWeight,hachureAngle:a.hachureAngle,hachureGap:a.hachureGap,dashOffset:a.dashOffset,dashGap:a.dashGap,zigzagOffset:a.zigzagOffset,disableMultiStroke:a.disableMultiStroke,disableMultiStrokeFill:a.disableMultiStrokeFill,preserveVertices:a.preserveVertices,simplification:a.simplification,fixedDecimalPlaceDigits:a.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),k=l({...g,seed:s}),m=t.generator(),x=new Map;function b(e,t){const r=o(e);return l({backend:"roughjs",identity:f(e),type:e.type,geometry:r,style:u(t),options:k,seed:s})}function v(t,r,i){const n=o(t);if(!n)return null;const a=function(e,t){if(t.fill&&"string"!=typeof t.fill)return null;if("string"==typeof t.fill&&t.fill.startsWith("url("))return null;const r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}(t,r);if(!a)return null;const u=i?{fill:a.fill?e(i,a.fill)||a.fill:void 0,stroke:e(i,a.stroke)||a.stroke}:a,y=`${b(t,r)}:${l(u)}`,k=x.get(y);if(k)return x.delete(y),x.set(y,k),k;const v=c(`${s}:${f(t)??l(n)}`),D={...g,seed:v,fill:u.fill,stroke:u.stroke,strokeWidth:r.strokeWidth??1,strokeLineDash:p(r.strokeDasharray)},O={drawable:h(m,n,D),geometry:n,style:r};for(x.set(y,O);x.size>d;){const e=x.keys().next().value;if(void 0===e)break;x.delete(e)}return O}const D={id:"roughjs",seed:s,cacheKey:b,drawCanvas({context:e,node:t,style:r}){const i=v(t,r,e);return!!i&&(function(e,t){const{drawable:r,geometry:i,style:n}=t,a=r.options,o=e.globalAlpha,s="path"===i.kind?i.transform:void 0;s&&(e.translate(s.x,s.y),s.rotation&&e.rotate(s.rotation));for(const t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===a.stroke?"transparent":a.stroke,e.lineWidth=a.strokeWidth,e.globalAlpha=o*(n.opacity??1),a.strokeLineDash&&e.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(e.lineDashOffset=a.strokeLineDashOffset),y(e,t,a.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=a.fill??"transparent",e.globalAlpha=o*(n.opacity??1)*(n.fillOpacity??1),y(e,t,a.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{const r=0>a.fillWeight?a.strokeWidth/2:a.fillWeight;e.strokeStyle=a.fill??"transparent",e.lineWidth=r,e.globalAlpha=o*(n.opacity??1)*(n.fillOpacity??1),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),y(e,t,a.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,i),!0)},renderStaticSVG({node:e,style:t,key:i}){const n=v(e,t);if(!n)return null;const a="path"===n.geometry.kind?n.geometry.transform:void 0,o=m.toPaths(n.drawable).map((e,n)=>r("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${i}-path-${n}`));return r("g",{"data-semiotic-render-backend":"roughjs",transform:a?`translate(${a.x} ${a.y})${a.rotation?` rotate(${180*a.rotation/Math.PI})`:""}`:void 0,children:o},i)},clearCache(){x.clear()},get cacheEntries(){return x.size}};return D}export{d as createRoughRenderMode,c as stableRoughSeed};