@gui-chat-plugin/brep 0.1.0 → 0.2.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/CHANGELOG.md +10 -0
- package/dist/style.css +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +250 -247
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- **The View takes the host's theme.** Its panel, text, border, button and accent colours are the
|
|
6
|
+
host's custom properties when it has them (`--bg-panel`, `--bg-elevated`, `--text`,
|
|
7
|
+
`--text-muted`, `--border`, `--accent-bg`, `--on-accent`, `--warn`; they reach a shadow root), so
|
|
8
|
+
under a dark theme the card is dark instead of a white box. A host without them sees the light
|
|
9
|
+
slate colours it had. The ground behind the model is a soft gradient in those colours, and the
|
|
10
|
+
canvas is transparent. The model's own face and edge colours, the lighting and the exports are
|
|
11
|
+
unchanged.
|
|
12
|
+
|
|
3
13
|
## 0.1.0
|
|
4
14
|
|
|
5
15
|
- First release: `presentBrep` builds a solid model from a replicad script with the OpenCascade
|
package/dist/style.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-900:oklch(41.4% .112 45.904);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--font-weight-semibold:600;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.mt-1{margin-top:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-auto{margin-right:auto}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-8{height:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.min-w-0{min-width:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-amber-300{border-color:var(--color-amber-300)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-slate-800{border-color:var(--color-slate-800)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-amber-700{color:var(--color-amber-700)}.text-amber-900{color:var(--color-amber-900)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}@media (hover:hover){.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}}@container (width>=48rem){.\@3xl\:flex-row{flex-direction:row}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.brep-view[data-v-b7767e43]{flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden}.brep-header[data-v-b7767e43]{flex:none;display:flex}.brep-model[data-v-b7767e43]{flex:none;width:100%;min-width:0;position:relative}.brep-bar[data-v-b7767e43]{cursor:row-resize;touch-action:none;-webkit-user-select:none;user-select:none;background:#f8fafc;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;flex:none;justify-content:center;align-items:center;height:.75rem;display:flex}.brep-bar[data-v-b7767e43]:hover,.brep-bar[data-v-b7767e43]:focus-visible,.brep-bar-dragging[data-v-b7767e43]{background:#e2e8f0;outline:none}.brep-bar-grip[data-v-b7767e43]{background:#94a3b8;border-radius:9999px;width:2.5rem;height:.1875rem}.brep-bar:focus-visible .brep-bar-grip[data-v-b7767e43],.brep-bar-dragging .brep-bar-grip[data-v-b7767e43]{background:#334155}.brep-below[data-v-b7767e43]{flex:1;min-height:0;overflow:hidden auto}
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-700:oklch(55.5% .163 48.998);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--font-weight-semibold:600;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.mt-1{margin-top:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-auto{margin-right:auto}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-8{height:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.min-w-0{min-width:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--brep-active\)\]{border-color:var(--brep-active)}.border-\[var\(--brep-border\)\]{border-color:var(--brep-border)}.border-\[var\(--brep-border-strong\)\]{border-color:var(--brep-border-strong)}.border-\[var\(--brep-warn-border\)\]{border-color:var(--brep-warn-border)}.bg-\[var\(--brep-active\)\]{background-color:var(--brep-active)}.bg-\[var\(--brep-bg\)\]{background-color:var(--brep-bg)}.bg-\[var\(--brep-code\)\]{background-color:var(--brep-code)}.bg-\[var\(--brep-warn-bg\)\]{background-color:var(--brep-warn-bg)}.bg-slate-100{background-color:var(--color-slate-100)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\[var\(--brep-faint\)\]{color:var(--brep-faint)}.text-\[var\(--brep-muted\)\]{color:var(--brep-muted)}.text-\[var\(--brep-on-active\)\]{color:var(--brep-on-active)}.text-\[var\(--brep-strong\)\]{color:var(--brep-strong)}.text-\[var\(--brep-text\)\]{color:var(--brep-text)}.text-\[var\(--brep-text-2\)\]{color:var(--brep-text-2)}.text-\[var\(--brep-warn\)\]{color:var(--brep-warn)}.text-amber-700{color:var(--color-amber-700)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}@media (hover:hover){.hover\:bg-\[var\(--brep-hover\)\]:hover{background-color:var(--brep-hover)}}@container (width>=48rem){.\@3xl\:flex-row{flex-direction:row}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.brep-view[data-v-ff3bd1d3]{--brep-bg:var(--bg-panel,#fff);--brep-raised:var(--bg-elevated,#f8fafc);--brep-text:var(--text,#1e293b);--brep-text-2:var(--text-secondary,#334155);--brep-strong:var(--text,#0f172a);--brep-muted:var(--text-muted,#64748b);--brep-faint:var(--text-muted,#94a3b8);--brep-border:var(--border,#e2e8f0);--brep-border-strong:var(--border,#cbd5e1);--brep-hover:var(--bg-hover,#f1f5f9);--brep-code:var(--bg-deep,#f8fafc);--brep-active:var(--accent-bg,#1e293b);--brep-on-active:var(--on-accent,#fff);--brep-warn:var(--warn,#78350f);--brep-warn-bg:#f59e0b1f;--brep-warn-border:#f59e0b73;width:100%;height:100%;accent-color:var(--accent,#1e293b);flex-direction:column;display:flex;overflow:hidden}.brep-ground[data-v-ff3bd1d3]{background:radial-gradient(ellipse at 50% 35%, var(--brep-raised) 0%, var(--bg-deep,#e2e8f0) 80%)}.brep-header[data-v-ff3bd1d3]{flex:none;display:flex}.brep-model[data-v-ff3bd1d3]{flex:none;width:100%;min-width:0;position:relative}.brep-bar[data-v-ff3bd1d3]{border-top:1px solid var(--brep-border);border-bottom:1px solid var(--brep-border);background:var(--brep-raised);cursor:row-resize;touch-action:none;-webkit-user-select:none;user-select:none;flex:none;justify-content:center;align-items:center;height:.75rem;display:flex}.brep-bar[data-v-ff3bd1d3]:hover,.brep-bar[data-v-ff3bd1d3]:focus-visible,.brep-bar-dragging[data-v-ff3bd1d3]{background:var(--brep-hover);outline:none}.brep-bar-grip[data-v-ff3bd1d3]{background:var(--brep-faint);border-radius:9999px;width:2.5rem;height:.1875rem}.brep-bar:focus-visible .brep-bar-grip[data-v-ff3bd1d3],.brep-bar-dragging .brep-bar-grip[data-v-ff3bd1d3]{background:var(--brep-text-2)}.brep-below[data-v-ff3bd1d3]{flex:1;min-height:0;overflow:hidden auto}
|
|
3
3
|
/*$vite$:1*/
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("./mesh-DLZoiBza.cjs");let l=require("vue"),u=require("three");u=s(u,1);let d=require("gui-chat-protocol/vue");var f={type:`change`},p={type:`start`},m={type:`end`},h=new u.Ray,g=new u.Plane,_=Math.cos(70*u.MathUtils.DEG2RAD),v=new u.Vector3,y=2*Math.PI,b={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},x=1e-6,ee=class extends u.Controls{constructor(e,t=null){super(e,t),this.state=b.NONE,this.target=new u.Vector3,this.cursor=new u.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new u.Vector3,this._lastQuaternion=new u.Quaternion,this._lastTargetPosition=new u.Vector3,this._quat=new u.Quaternion().setFromUnitVectors(e.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new u.Spherical,this._sphericalDelta=new u.Spherical,this._scale=1,this._panOffset=new u.Vector3,this._rotateStart=new u.Vector2,this._rotateEnd=new u.Vector2,this._rotateDelta=new u.Vector2,this._panStart=new u.Vector2,this._panEnd=new u.Vector2,this._panDelta=new u.Vector2,this._dollyStart=new u.Vector2,this._dollyEnd=new u.Vector2,this._dollyDelta=new u.Vector2,this._dollyDirection=new u.Vector3,this._mouse=new u.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=C.bind(this),this._onPointerDown=S.bind(this),this._onPointerUp=w.bind(this),this._onContextMenu=j.bind(this),this._onMouseWheel=D.bind(this),this._onKeyDown=O.bind(this),this._onTouchStart=k.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=T.bind(this),this._onMouseMove=E.bind(this),this._interceptControlDown=M.bind(this),this._interceptControlUp=te.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.ownerDocument.addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.state=b.NONE,this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.ownerDocument.removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.ownerDocument.removeEventListener(`keyup`,this._interceptControlUp,{capture:!0}),this._controlActive=!1,this._pointers.length=0,this._pointerPositions={},this.domElement.style.touchAction=``,this.domElement.style.cursor=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(f),this.update(),this.state=b.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;v.copy(t).sub(this.target),v.applyQuaternion(this._quat),this._spherical.setFromVector3(v),this.autoRotate&&this.state===b.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=y:n>Math.PI&&(n-=y),r<-Math.PI?r+=y:r>Math.PI&&(r-=y),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(v.setFromSpherical(this._spherical),v.applyQuaternion(this._quatInverse),t.copy(this.target).add(v),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=v.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new u.Vector3(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new u.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=v.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(h.origin.copy(this.object.position),h.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(h.direction))<_?this.object.lookAt(this.target):(g.setFromNormalAndCoplanarPoint(this.object.up,this.target),h.intersectPlane(g,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>x||8*(1-this._lastQuaternion.dot(this.object.quaternion))>x||this._lastTargetPosition.distanceToSquared(this.target)>x?(this.dispatchEvent(f),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?y/60/60*this.autoRotateSpeed:y/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){v.setFromMatrixColumn(t,0),v.multiplyScalar(-e),this._panOffset.add(v)}_panUp(e,t){this.screenSpacePanning===!0?v.setFromMatrixColumn(t,1):(v.setFromMatrixColumn(t,0),v.crossVectors(this.object.up,v)),v.multiplyScalar(e),this._panOffset.add(v)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;v.copy(r).sub(this.target);let i=v.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientY),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(y*this._rotateDelta.x/t.clientHeight),this._rotateUp(y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.zoomToCursor&&(this._performCursorZoom=!0,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(y*this._rotateDelta.x/t.clientHeight),this._rotateUp(y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new u.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function S(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),this._isTrackingPointer(e)||(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function C(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function w(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(m),this.state=b.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function T(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case u.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=b.DOLLY;break;case u.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=b.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=b.ROTATE}break;case u.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=b.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=b.PAN}break;default:this.state=b.NONE}this.state!==b.NONE&&this.dispatchEvent(p)}function E(e){switch(this.state){case b.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case b.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case b.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e)}}function D(e){this.enabled!==!1&&this.enableZoom!==!1&&this.state===b.NONE&&(e.preventDefault(),this.dispatchEvent(p),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(m))}function O(e){this.enabled!==!1&&this._handleKeyDown(e)}function k(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case u.TOUCH.ROTATE:if(this.enableRotate===!1){this.state=b.NONE;break}this._handleTouchStartRotate(e),this.state=b.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(this.enablePan===!1){this.state=b.NONE;break}this._handleTouchStartPan(e),this.state=b.TOUCH_PAN;break;default:this.state=b.NONE}break;case 2:switch(this.touches.TWO){case u.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=b.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=b.TOUCH_DOLLY_ROTATE;break;default:this.state=b.NONE}break;default:this.state=b.NONE}this.state!==b.NONE&&this.dispatchEvent(p)}function A(e){switch(this._trackPointer(e),this.state){case b.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case b.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case b.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case b.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=b.NONE}}function j(e){this.enabled!==!1&&e.preventDefault()}function M(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.ownerDocument.addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function te(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.ownerDocument.removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var N=(0,d.createUseT)({en:{untitled:`Solid model`,viewIso:`3D`,viewTop:`Top`,viewFront:`Front`,viewRight:`Right`,edges:`Edges`,noMesh:`This result has no model to show.`,noWebgl:`The 3D view is not available in this browser.`,size:`Size`,volume:`Volume`,surface:`Surface`,solids:`Solids`,faces:`Faces`,edgeKinds:`Edges`,parts:`Parts`,operations:`Operations`,line:`line`,selectedOf:`selected {selected} of {available}`,selected:`selected {selected}`,warnings:`Warnings`,files:`Files`,fileScript:`Script`,fileStep:`STEP`,fileStl:`STL`,fileDrawings:`Drawings`,download:`Download`,script:`Script`,copy:`Copy`,copied:`Copied`,resizeModel:`Resize the 3D view`},ja:{untitled:`ソリッドモデル`,viewIso:`3D`,viewTop:`上面`,viewFront:`正面`,viewRight:`右側面`,edges:`稜線`,noMesh:`この結果には表示できるモデルがありません。`,noWebgl:`このブラウザでは3D表示を利用できません。`,size:`寸法`,volume:`体積`,surface:`表面積`,solids:`ソリッド数`,faces:`面`,edgeKinds:`稜線`,parts:`部品`,operations:`操作`,line:`行`,selectedOf:`{available} 中 {selected} を選択`,selected:`{selected} を選択`,warnings:`警告`,files:`ファイル`,fileScript:`スクリプト`,fileStep:`STEP`,fileStl:`STL`,fileDrawings:`図面`,download:`ダウンロード`,script:`スクリプト`,copy:`コピー`,copied:`コピーしました`,resizeModel:`3Dビューの高さを変更`}}),P=12832988,F=2042167;function ne(e){let t=new u.BufferGeometry;t.setAttribute(`position`,new u.BufferAttribute(e.positions,3)),t.setAttribute(`normal`,new u.BufferAttribute(e.normals,3)),t.setIndex(new u.BufferAttribute(e.indices,1));let n=new u.MeshStandardMaterial({color:P,metalness:.1,roughness:.65,side:u.DoubleSide,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),r=new u.BufferGeometry;r.setAttribute(`position`,new u.BufferAttribute(e.edges,3));let i=new u.LineBasicMaterial({color:F});return{faces:new u.Mesh(t,n),edges:new u.LineSegments(r,i),dispose(){t.dispose(),n.dispose(),r.dispose(),i.dispose()}}}var I={iso:[1,-1.2,.9],top:[0,-.001,1],front:[0,-1,0],right:[1,0,0]},L=1.02;function re(e,t,n,r,i){let a=[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2],o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])/2||1,s=r*Math.PI/360,c=Math.atan(Math.tan(s)*i),l=o*L/Math.sin(Math.min(s,c)),u=I[n],d=Math.hypot(...u);return{position:[a[0]+u[0]/d*l,a[1]+u[1]/d*l,a[2]+u[2]/d*l],target:a,distance:l,radius:o}}var R=.6;function z(e,t){if(!Number.isFinite(t)||t<=0)return 0;if(t<168)return Math.round(t/2);let n=e===null||!Number.isFinite(e)?t*R:e;return Math.round(Math.min(Math.max(n,96),t-72))}var B=`@gui-chat-plugin/brep:modelHeight`;function ie(){try{let e=globalThis.localStorage?.getItem(B);if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null}catch{return null}}function ae(e){try{globalThis.localStorage?.setItem(B,String(Math.round(e)))}catch{}}var oe=[`title`],se={class:`flex items-center gap-1`,"data-testid":`brep-toolbar`},ce=[`aria-pressed`,`data-testid`,`onClick`],le={class:`ml-2 flex h-8 cursor-pointer items-center gap-1.5 text-slate-700`},ue={key:0,class:`absolute inset-0 flex items-center justify-center p-4 text-center text-slate-500`,"data-testid":`brep-viewport-message`},de=[`aria-label`,`aria-valuenow`,`aria-valuemax`],fe={class:`brep-below`,"data-testid":`brep-below`},pe={key:0,class:`p-3`,"data-testid":`brep-report`},me={key:0,class:`mb-3 rounded border border-amber-300 bg-amber-50 p-2 text-amber-900`,"data-testid":`brep-warnings`},he={class:`font-semibold`},ge={class:`mt-1 list-disc pl-4`},_e={class:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`},ve={class:`text-slate-500`},ye={class:`tabular-nums`,"data-testid":`brep-size`},be={class:`text-slate-500`},xe={class:`tabular-nums`},Se={class:`text-slate-500`},Ce={class:`tabular-nums`},we={class:`text-slate-500`},Te={class:`tabular-nums`},Ee={class:`text-slate-500`},De={"data-testid":`brep-faces`},Oe={class:`text-slate-500`},ke={class:`mt-4 font-semibold text-slate-900`},Ae={class:`mt-1 space-y-0.5`},je={class:`mt-4 font-semibold text-slate-900`},Me={class:`mt-1 space-y-1`,"data-testid":`brep-operations`},Ne={key:0,class:`w-12 shrink-0 text-xs tabular-nums text-slate-400`},Pe={class:`font-mono text-slate-900`},Fe={key:1,class:`text-slate-600`},Ie={key:2,class:`ml-auto tabular-nums text-slate-500`},Le={class:`mt-4 font-semibold text-slate-900`},Re={class:`mt-1 flex flex-wrap gap-2`,"data-testid":`brep-files`},ze=[`title`,`data-testid`,`onClick`],Be={key:1,class:`border-t border-slate-200`,"data-testid":`brep-script`},Ve={class:`flex cursor-pointer items-center gap-2 px-3 py-2 text-slate-700`},He={class:`mr-auto`},Ue={class:`overflow-x-auto bg-slate-50 px-3 py-2 font-mono text-xs leading-5 text-slate-800`},We=35,Ge=15857145,V=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,l.defineComponent)({__name:`View`,props:{selectedResult:{}},setup(e){let t=e,n=N(),r=[`iso`,`top`,`front`,`right`],i={iso:`viewIso`,top:`viewTop`,front:`viewFront`,right:`viewRight`},a=(0,l.computed)(()=>t.selectedResult.title||n.value.untitled),o=(0,l.computed)(()=>t.selectedResult.data?.report),s=(0,l.computed)(()=>t.selectedResult.data?.script??``),d=(0,l.computed)(()=>{let e=t.selectedResult.data?.mesh;return c.r(e)?e:null}),f=(0,l.computed)(()=>{let e=t.selectedResult.data?.downloads,r=e?.name??`model`,i=[];return s.value&&i.push({kind:`script`,label:n.value.fileScript,fileName:`${r}.replicad.js`,type:`text/javascript`,content:{text:s.value}}),e&&i.push({kind:`step`,label:n.value.fileStep,fileName:`${r}.step`,type:`model/step`,content:{packed:e.step}},{kind:`stl`,label:n.value.fileStl,fileName:`${r}.stl`,type:`model/stl`,content:{packed:e.stl}},{kind:`views`,label:n.value.fileDrawings,fileName:`${r}.svg`,type:`image/svg+xml`,content:{packed:e.views}}),i});async function p(e){let t;try{t=`text`in e.content?e.content.text:await c.a(e.content.packed)}catch{return}let n=URL.createObjectURL(new Blob([t],{type:e.type})),r=document.createElement(`a`);r.href=n,r.download=e.fileName,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e4)}let m=e=>Number.isFinite(e)?e.toLocaleString(`en-US`):`–`,h=e=>`${e>0?`+`:e<0?`−`:``}${m(Math.abs(e))}`,g=e=>Object.entries(e).sort(([,e],[,t])=>t-e).map(([e,t])=>`${t} ${e}`).join(`, `);function _(e){if(e.selected===void 0)return``;let t=String(e.selected);return e.count===1&&e.available!==void 0?n.value.selectedOf.replace(`{selected}`,t).replace(`{available}`,String(e.available)):n.value.selected.replace(`{selected}`,t)}let v=(0,l.ref)(null),y,b=!1;async function x(e,t){try{await navigator.clipboard.writeText(e)}catch{return}b||(v.value=t,clearTimeout(y),y=setTimeout(()=>v.value=null,1500))}let S=(0,l.ref)(null),C=(0,l.ref)(null),w=(0,l.ref)(null),T=(0,l.ref)(ie()),E=(0,l.ref)(0),D=(0,l.computed)(()=>z(T.value,E.value)),O=(0,l.ref)(!1),k=null,A=null;function j(){S.value&&(E.value=S.value.clientHeight-(C.value?.offsetHeight??0)-(w.value?.offsetHeight??0))}function M(e){T.value=z(e,E.value),ae(T.value)}function te(e){e.button===0&&(A={y:e.clientY,height:D.value},O.value=!0,w.value?.setPointerCapture(e.pointerId),e.preventDefault())}function P(e){A&&M(A.height+e.clientY-A.y)}function F(){A=null,O.value=!1}function I(e){let t={ArrowUp:D.value-24,ArrowDown:D.value+24,Home:0,End:E.value}[e.key];t!==void 0&&(e.preventDefault(),M(t))}function L(){T.value=null;try{globalThis.localStorage?.removeItem(B)}catch{}}let R=(0,l.ref)(null),V=(0,l.ref)(!0),H=(0,l.ref)(`iso`),U=(0,l.ref)(!1),W=(0,l.computed)(()=>d.value?U.value?n.value.noWebgl:``:n.value.noMesh),G=null,K=null,q=null,J=null,Y=null,X=null,Z=0;function Q(){Z&&=(cancelAnimationFrame(Z),0),G&&K&&q&&G.render(K,q)}function Ke(){!Z&&G&&(Z=requestAnimationFrame(()=>{Z=0,Q()}))}function qe(){let e=R.value;if(!e||G)return;try{G=new u.WebGLRenderer({antialias:!0})}catch{U.value=!0;return}G.setPixelRatio(window.devicePixelRatio),G.setClearColor(Ge),e.appendChild(G.domElement),K=new u.Scene,q=new u.PerspectiveCamera(We,1,.1,1e3),q.up.set(0,0,1);let t=new u.DirectionalLight(16777215,1.5);t.position.set(-.5,.8,1),q.add(t),K.add(q),K.add(new u.HemisphereLight(16777215,7831692,2.2)),J=new ee(q,G.domElement),J.addEventListener(`change`,Ke),J.addEventListener(`start`,()=>H.value=null),X=new ResizeObserver(Je),X.observe(e),Je()}function Je(){let e=R.value;if(!e||!G||!q)return;let t=e.clientWidth,n=e.clientHeight;t!==0&&n!==0&&(G.setSize(t,n),q.aspect=t/n,q.updateProjectionMatrix(),H.value?$(H.value):Q())}function $(e){H.value=e;let t=d.value;if(!t||!q||!J)return;let n=re(t.min,t.max,e,We,q.aspect);q.position.set(...n.position),q.near=n.distance/100,q.far=n.distance+n.radius*10,q.updateProjectionMatrix(),J.target.set(...n.target),J.update(),Q()}function Ye(){if(!K)return;Y&&=(K.remove(Y.faces,Y.edges),Y.dispose(),null);let e=d.value;e?(Y=ne(c.t(e)),Y.edges.visible=V.value,K.add(Y.faces,Y.edges),$(`iso`)):Q()}return(0,l.onMounted)(()=>{S.value&&(k=new ResizeObserver(j),k.observe(S.value),C.value&&k.observe(C.value)),j(),qe(),Ye()}),(0,l.watch)(d,Ye),(0,l.watch)(V,e=>{Y&&(Y.edges.visible=e),Q()}),(0,l.onUnmounted)(()=>{b=!0,clearTimeout(y),Z&&cancelAnimationFrame(Z),X?.disconnect(),k?.disconnect(),J?.dispose(),Y?.dispose(),G&&(G.dispose(),G.forceContextLoss(),G.domElement.remove()),G=null}),(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{ref_key:`root`,ref:S,class:`brep-view bg-white text-sm text-slate-800`,"data-testid":`brep-view`},[(0,l.createElementVNode)(`div`,{ref_key:`header`,ref:C,class:`brep-header flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-3 py-2`},[(0,l.createElementVNode)(`h1`,{class:`mr-auto min-w-0 truncate text-base font-semibold text-slate-900`,title:a.value},(0,l.toDisplayString)(a.value),9,oe),(0,l.createElementVNode)(`div`,se,[((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(r,e=>(0,l.createElementVNode)(`button`,{key:e,type:`button`,class:(0,l.normalizeClass)([`h-8 rounded border px-2.5`,e===H.value?`border-slate-800 bg-slate-800 text-white`:`border-slate-300 bg-white text-slate-700 hover:bg-slate-100`]),"aria-pressed":e===H.value,"data-testid":`brep-view-${e}`,onClick:t=>$(e)},(0,l.toDisplayString)((0,l.unref)(n)[i[e]]),11,ce)),64)),(0,l.createElementVNode)(`label`,le,[(0,l.withDirectives)((0,l.createElementVNode)(`input`,{"onUpdate:modelValue":t[0]||=e=>V.value=e,type:`checkbox`,"data-testid":`brep-edges`},null,512),[[l.vModelCheckbox,V.value]]),(0,l.createTextVNode)(` `+(0,l.toDisplayString)((0,l.unref)(n).edges),1)])])],512),(0,l.createElementVNode)(`div`,{class:`brep-model bg-slate-100`,style:(0,l.normalizeStyle)({height:`${D.value}px`}),"data-testid":`brep-model`},[(0,l.createElementVNode)(`div`,{ref_key:`viewport`,ref:R,class:`absolute inset-0`,"data-testid":`brep-viewport`},null,512),W.value?((0,l.openBlock)(),(0,l.createElementBlock)(`p`,ue,(0,l.toDisplayString)(W.value),1)):(0,l.createCommentVNode)(``,!0)],4),(0,l.createElementVNode)(`div`,{ref_key:`bar`,ref:w,class:(0,l.normalizeClass)([`brep-bar`,{"brep-bar-dragging":O.value}]),role:`separator`,"aria-orientation":`horizontal`,tabindex:`0`,"aria-label":(0,l.unref)(n).resizeModel,"aria-valuenow":D.value,"aria-valuemin":0,"aria-valuemax":Math.max(E.value,0),"data-testid":`brep-bar`,onPointerdown:te,onPointermove:P,onPointerup:F,onPointercancel:F,onKeydown:I,onDblclick:L},[...t[2]||=[(0,l.createElementVNode)(`span`,{class:`brep-bar-grip`},null,-1)]],42,de),(0,l.createElementVNode)(`div`,fe,[o.value?((0,l.openBlock)(),(0,l.createElementBlock)(`section`,pe,[o.value.warnings.length?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,me,[(0,l.createElementVNode)(`h2`,he,(0,l.toDisplayString)((0,l.unref)(n).warnings),1),(0,l.createElementVNode)(`ul`,ge,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.warnings,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:e},(0,l.toDisplayString)(e),1))),128))])])):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`dl`,_e,[(0,l.createElementVNode)(`dt`,ve,(0,l.toDisplayString)((0,l.unref)(n).size),1),(0,l.createElementVNode)(`dd`,ye,(0,l.toDisplayString)(o.value.size.join(` × `))+` mm `,1),(0,l.createElementVNode)(`dt`,be,(0,l.toDisplayString)((0,l.unref)(n).volume),1),(0,l.createElementVNode)(`dd`,xe,(0,l.toDisplayString)(m(o.value.volume))+` mm³`,1),(0,l.createElementVNode)(`dt`,Se,(0,l.toDisplayString)((0,l.unref)(n).surface),1),(0,l.createElementVNode)(`dd`,Ce,(0,l.toDisplayString)(m(o.value.area))+` mm²`,1),(0,l.createElementVNode)(`dt`,we,(0,l.toDisplayString)((0,l.unref)(n).solids),1),(0,l.createElementVNode)(`dd`,Te,(0,l.toDisplayString)(o.value.solids),1),(0,l.createElementVNode)(`dt`,Ee,(0,l.toDisplayString)((0,l.unref)(n).faces),1),(0,l.createElementVNode)(`dd`,De,(0,l.toDisplayString)(g(o.value.faces)),1),(0,l.createElementVNode)(`dt`,Oe,(0,l.toDisplayString)((0,l.unref)(n).edgeKinds),1),(0,l.createElementVNode)(`dd`,null,(0,l.toDisplayString)(g(o.value.edges)),1)]),o.value.parts?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:1},[(0,l.createElementVNode)(`h2`,ke,(0,l.toDisplayString)((0,l.unref)(n).parts),1),(0,l.createElementVNode)(`ul`,Ae,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.parts,(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:t,class:`tabular-nums`},(0,l.toDisplayString)(e.name??t+1)+`: `+(0,l.toDisplayString)(e.size.join(` × `))+` mm, `+(0,l.toDisplayString)(m(e.volume))+` mm³ `,1))),128))])],64)):(0,l.createCommentVNode)(``,!0),o.value.operations.length?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:2},[(0,l.createElementVNode)(`h2`,je,(0,l.toDisplayString)((0,l.unref)(n).operations),1),(0,l.createElementVNode)(`ol`,Me,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.operations,(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:t,class:`flex flex-wrap items-baseline gap-x-2`},[e.line===void 0?(0,l.createCommentVNode)(``,!0):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Ne,(0,l.toDisplayString)((0,l.unref)(n).line)+` `+(0,l.toDisplayString)(e.line),1)),(0,l.createElementVNode)(`code`,Pe,(0,l.toDisplayString)(e.op)+`(`+(0,l.toDisplayString)(e.size??``)+`)`+(0,l.toDisplayString)(e.count>1?` ×${e.count}`:``),1),_(e)?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Fe,(0,l.toDisplayString)(_(e)),1)):(0,l.createCommentVNode)(``,!0),e.volumeChange===void 0?(0,l.createCommentVNode)(``,!0):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Ie,(0,l.toDisplayString)(h(e.volumeChange))+` mm³ `,1))]))),128))])],64)):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`h2`,Le,(0,l.toDisplayString)((0,l.unref)(n).files),1),(0,l.createElementVNode)(`ul`,Re,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(f.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:e.kind},[(0,l.createElementVNode)(`button`,{type:`button`,class:`rounded border border-slate-300 px-2.5 py-1 hover:bg-slate-100`,title:e.fileName,"data-testid":`brep-download-${e.kind}`,onClick:t=>p(e)},(0,l.toDisplayString)((0,l.unref)(n).download)+` `+(0,l.toDisplayString)(e.label),9,ze)]))),128))])])):(0,l.createCommentVNode)(``,!0),s.value?((0,l.openBlock)(),(0,l.createElementBlock)(`details`,Be,[(0,l.createElementVNode)(`summary`,Ve,[(0,l.createElementVNode)(`span`,He,(0,l.toDisplayString)((0,l.unref)(n).script),1),(0,l.createElementVNode)(`button`,{type:`button`,class:`rounded border border-slate-300 px-1.5 py-0.5 text-xs hover:bg-slate-100`,onClick:t[1]||=(0,l.withModifiers)(e=>x(s.value,`script`),[`prevent`,`stop`])},(0,l.toDisplayString)(v.value===`script`?(0,l.unref)(n).copied:(0,l.unref)(n).copy),1)]),(0,l.createElementVNode)(`pre`,Ue,[(0,l.createElementVNode)(`code`,null,(0,l.toDisplayString)(s.value),1)])])):(0,l.createCommentVNode)(``,!0)])],512))}}),[[`__scopeId`,`data-v-b7767e43`]]),H={class:`flex flex-col gap-0.5 rounded bg-slate-100 p-2 text-slate-800`,"data-testid":`brep-preview`},U=[`title`],W={key:0,class:`text-xs tabular-nums text-slate-600`},G={key:1,class:`text-xs text-amber-700`,"data-testid":`brep-preview-warnings`},K=(0,l.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let t=e,n=N(),r=(0,l.computed)(()=>t.result.title||n.value.untitled),i=(0,l.computed)(()=>t.result.data?.report);return(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,H,[(0,l.createElementVNode)(`div`,{class:`truncate text-sm font-semibold`,title:r.value},(0,l.toDisplayString)(r.value),9,U),i.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,W,(0,l.toDisplayString)(i.value.size.join(` × `))+` mm `,1)):(0,l.createCommentVNode)(``,!0),i.value?.warnings.length?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,G,(0,l.toDisplayString)((0,l.unref)(n).warnings)+`: `+(0,l.toDisplayString)(i.value.warnings.length),1)):(0,l.createCommentVNode)(``,!0)]))}}),q=`Use the ${c.s} tool for a part that will be made or that must fit: brackets, enclosures, flanges, jigs, anything with fillets, chamfers, holes to a size, or a STEP file to hand on. It builds a replicad script with a CAD kernel and returns a report to check the result against. For a model that is only looked at, use ShapeScript. Z is up and the user looks from -Y: put the side they should see first at -Y (a chair's seat front at -Y, its backrest at +Y).`,J={toolDefinition:c.o,execute:async()=>({message:`presentBrep runs on the host's server (executePresentBrep from @gui-chat-plugin/brep), not in the page.`}),generatingMessage:`Building the solid model...`,waitingMessage:`Tell the user that the solid model is being built and will be shown shortly.`,isEnabled:()=>!0,viewComponent:V,previewComponent:K,systemPrompt:q},Y={plugin:J};exports.Preview=K,exports.SYSTEM_PROMPT=q,exports.TOOL_DEFINITION=c.o,exports.TOOL_NAME=c.s,exports.View=V,exports.decodeMesh=c.t,exports.default=Y,exports.isBrepMesh=c.r,exports.plugin=J;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("./mesh-DLZoiBza.cjs");let l=require("vue"),u=require("three");u=s(u,1);let d=require("gui-chat-protocol/vue");var f={type:`change`},p={type:`start`},m={type:`end`},h=new u.Ray,g=new u.Plane,_=Math.cos(70*u.MathUtils.DEG2RAD),v=new u.Vector3,y=2*Math.PI,b={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},x=1e-6,ee=class extends u.Controls{constructor(e,t=null){super(e,t),this.state=b.NONE,this.target=new u.Vector3,this.cursor=new u.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new u.Vector3,this._lastQuaternion=new u.Quaternion,this._lastTargetPosition=new u.Vector3,this._quat=new u.Quaternion().setFromUnitVectors(e.up,new u.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new u.Spherical,this._sphericalDelta=new u.Spherical,this._scale=1,this._panOffset=new u.Vector3,this._rotateStart=new u.Vector2,this._rotateEnd=new u.Vector2,this._rotateDelta=new u.Vector2,this._panStart=new u.Vector2,this._panEnd=new u.Vector2,this._panDelta=new u.Vector2,this._dollyStart=new u.Vector2,this._dollyEnd=new u.Vector2,this._dollyDelta=new u.Vector2,this._dollyDirection=new u.Vector3,this._mouse=new u.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=C.bind(this),this._onPointerDown=S.bind(this),this._onPointerUp=w.bind(this),this._onContextMenu=j.bind(this),this._onMouseWheel=D.bind(this),this._onKeyDown=O.bind(this),this._onTouchStart=k.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=T.bind(this),this._onMouseMove=E.bind(this),this._interceptControlDown=M.bind(this),this._interceptControlUp=N.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.ownerDocument.addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.state=b.NONE,this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.ownerDocument.removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.ownerDocument.removeEventListener(`keyup`,this._interceptControlUp,{capture:!0}),this._controlActive=!1,this._pointers.length=0,this._pointerPositions={},this.domElement.style.touchAction=``,this.domElement.style.cursor=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(f),this.update(),this.state=b.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;v.copy(t).sub(this.target),v.applyQuaternion(this._quat),this._spherical.setFromVector3(v),this.autoRotate&&this.state===b.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=y:n>Math.PI&&(n-=y),r<-Math.PI?r+=y:r>Math.PI&&(r-=y),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(v.setFromSpherical(this._spherical),v.applyQuaternion(this._quatInverse),t.copy(this.target).add(v),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=v.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new u.Vector3(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new u.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=v.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(h.origin.copy(this.object.position),h.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(h.direction))<_?this.object.lookAt(this.target):(g.setFromNormalAndCoplanarPoint(this.object.up,this.target),h.intersectPlane(g,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>x||8*(1-this._lastQuaternion.dot(this.object.quaternion))>x||this._lastTargetPosition.distanceToSquared(this.target)>x?(this.dispatchEvent(f),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?y/60/60*this.autoRotateSpeed:y/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){v.setFromMatrixColumn(t,0),v.multiplyScalar(-e),this._panOffset.add(v)}_panUp(e,t){this.screenSpacePanning===!0?v.setFromMatrixColumn(t,1):(v.setFromMatrixColumn(t,0),v.crossVectors(this.object.up,v)),v.multiplyScalar(e),this._panOffset.add(v)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;v.copy(r).sub(this.target);let i=v.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientY),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(y*this._rotateDelta.x/t.clientHeight),this._rotateUp(y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.zoomToCursor&&(this._performCursorZoom=!0,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(y*this._rotateDelta.x/t.clientHeight),this._rotateUp(y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new u.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function S(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),this._isTrackingPointer(e)||(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function C(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function w(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(m),this.state=b.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function T(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case u.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=b.DOLLY;break;case u.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=b.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=b.ROTATE}break;case u.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=b.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=b.PAN}break;default:this.state=b.NONE}this.state!==b.NONE&&this.dispatchEvent(p)}function E(e){switch(this.state){case b.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case b.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case b.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e)}}function D(e){this.enabled!==!1&&this.enableZoom!==!1&&this.state===b.NONE&&(e.preventDefault(),this.dispatchEvent(p),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(m))}function O(e){this.enabled!==!1&&this._handleKeyDown(e)}function k(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case u.TOUCH.ROTATE:if(this.enableRotate===!1){this.state=b.NONE;break}this._handleTouchStartRotate(e),this.state=b.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(this.enablePan===!1){this.state=b.NONE;break}this._handleTouchStartPan(e),this.state=b.TOUCH_PAN;break;default:this.state=b.NONE}break;case 2:switch(this.touches.TWO){case u.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=b.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=b.TOUCH_DOLLY_ROTATE;break;default:this.state=b.NONE}break;default:this.state=b.NONE}this.state!==b.NONE&&this.dispatchEvent(p)}function A(e){switch(this._trackPointer(e),this.state){case b.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case b.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case b.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case b.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=b.NONE}}function j(e){this.enabled!==!1&&e.preventDefault()}function M(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.ownerDocument.addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function N(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.ownerDocument.removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var te=(0,d.createUseT)({en:{untitled:`Solid model`,viewIso:`3D`,viewTop:`Top`,viewFront:`Front`,viewRight:`Right`,edges:`Edges`,noMesh:`This result has no model to show.`,noWebgl:`The 3D view is not available in this browser.`,size:`Size`,volume:`Volume`,surface:`Surface`,solids:`Solids`,faces:`Faces`,edgeKinds:`Edges`,parts:`Parts`,operations:`Operations`,line:`line`,selectedOf:`selected {selected} of {available}`,selected:`selected {selected}`,warnings:`Warnings`,files:`Files`,fileScript:`Script`,fileStep:`STEP`,fileStl:`STL`,fileDrawings:`Drawings`,download:`Download`,script:`Script`,copy:`Copy`,copied:`Copied`,resizeModel:`Resize the 3D view`},ja:{untitled:`ソリッドモデル`,viewIso:`3D`,viewTop:`上面`,viewFront:`正面`,viewRight:`右側面`,edges:`稜線`,noMesh:`この結果には表示できるモデルがありません。`,noWebgl:`このブラウザでは3D表示を利用できません。`,size:`寸法`,volume:`体積`,surface:`表面積`,solids:`ソリッド数`,faces:`面`,edgeKinds:`稜線`,parts:`部品`,operations:`操作`,line:`行`,selectedOf:`{available} 中 {selected} を選択`,selected:`{selected} を選択`,warnings:`警告`,files:`ファイル`,fileScript:`スクリプト`,fileStep:`STEP`,fileStl:`STL`,fileDrawings:`図面`,download:`ダウンロード`,script:`スクリプト`,copy:`コピー`,copied:`コピーしました`,resizeModel:`3Dビューの高さを変更`}}),ne=12832988,P=2042167;function re(e){let t=new u.BufferGeometry;t.setAttribute(`position`,new u.BufferAttribute(e.positions,3)),t.setAttribute(`normal`,new u.BufferAttribute(e.normals,3)),t.setIndex(new u.BufferAttribute(e.indices,1));let n=new u.MeshStandardMaterial({color:ne,metalness:.1,roughness:.65,side:u.DoubleSide,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),r=new u.BufferGeometry;r.setAttribute(`position`,new u.BufferAttribute(e.edges,3));let i=new u.LineBasicMaterial({color:P});return{faces:new u.Mesh(t,n),edges:new u.LineSegments(r,i),dispose(){t.dispose(),n.dispose(),r.dispose(),i.dispose()}}}var ie={iso:[1,-1.2,.9],top:[0,-.001,1],front:[0,-1,0],right:[1,0,0]},F=1.02;function ae(e,t,n,r,i){let a=[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2],o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])/2||1,s=r*Math.PI/360,c=Math.atan(Math.tan(s)*i),l=o*F/Math.sin(Math.min(s,c)),u=ie[n],d=Math.hypot(...u);return{position:[a[0]+u[0]/d*l,a[1]+u[1]/d*l,a[2]+u[2]/d*l],target:a,distance:l,radius:o}}var I=.6;function L(e,t){if(!Number.isFinite(t)||t<=0)return 0;if(t<168)return Math.round(t/2);let n=e===null||!Number.isFinite(e)?t*I:e;return Math.round(Math.min(Math.max(n,96),t-72))}var R=`@gui-chat-plugin/brep:modelHeight`;function oe(){try{let e=globalThis.localStorage?.getItem(R);if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null}catch{return null}}function se(e){try{globalThis.localStorage?.setItem(R,String(Math.round(e)))}catch{}}var ce=[`title`],le={class:`flex items-center gap-1`,"data-testid":`brep-toolbar`},ue=[`aria-pressed`,`data-testid`,`onClick`],de={class:`ml-2 flex h-8 cursor-pointer items-center gap-1.5 text-[var(--brep-text-2)]`},fe={key:0,class:`absolute inset-0 flex items-center justify-center p-4 text-center text-[var(--brep-muted)]`,"data-testid":`brep-viewport-message`},pe=[`aria-label`,`aria-valuenow`,`aria-valuemax`],me={class:`brep-below`,"data-testid":`brep-below`},he={key:0,class:`p-3`,"data-testid":`brep-report`},ge={key:0,class:`mb-3 rounded border border-[var(--brep-warn-border)] bg-[var(--brep-warn-bg)] p-2 text-[var(--brep-warn)]`,"data-testid":`brep-warnings`},_e={class:`font-semibold`},ve={class:`mt-1 list-disc pl-4`},ye={class:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`},be={class:`text-[var(--brep-muted)]`},xe={class:`tabular-nums`,"data-testid":`brep-size`},Se={class:`text-[var(--brep-muted)]`},Ce={class:`tabular-nums`},we={class:`text-[var(--brep-muted)]`},Te={class:`tabular-nums`},Ee={class:`text-[var(--brep-muted)]`},De={class:`tabular-nums`},Oe={class:`text-[var(--brep-muted)]`},ke={"data-testid":`brep-faces`},Ae={class:`text-[var(--brep-muted)]`},je={class:`mt-4 font-semibold text-[var(--brep-strong)]`},Me={class:`mt-1 space-y-0.5`},Ne={class:`mt-4 font-semibold text-[var(--brep-strong)]`},Pe={class:`mt-1 space-y-1`,"data-testid":`brep-operations`},Fe={key:0,class:`w-12 shrink-0 text-xs tabular-nums text-[var(--brep-faint)]`},Ie={class:`font-mono text-[var(--brep-strong)]`},Le={key:1,class:`text-[var(--brep-muted)]`},Re={key:2,class:`ml-auto tabular-nums text-[var(--brep-muted)]`},ze={class:`mt-4 font-semibold text-[var(--brep-strong)]`},Be={class:`mt-1 flex flex-wrap gap-2`,"data-testid":`brep-files`},Ve=[`title`,`data-testid`,`onClick`],He={key:1,class:`border-t border-[var(--brep-border)]`,"data-testid":`brep-script`},Ue={class:`flex cursor-pointer items-center gap-2 px-3 py-2 text-[var(--brep-text-2)]`},We={class:`mr-auto`},Ge={class:`overflow-x-auto bg-[var(--brep-code)] px-3 py-2 font-mono text-xs leading-5 text-[var(--brep-text)]`},z=35,B=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,l.defineComponent)({__name:`View`,props:{selectedResult:{}},setup(e){let t=e,n=te(),r=[`iso`,`top`,`front`,`right`],i={iso:`viewIso`,top:`viewTop`,front:`viewFront`,right:`viewRight`},a=(0,l.computed)(()=>t.selectedResult.title||n.value.untitled),o=(0,l.computed)(()=>t.selectedResult.data?.report),s=(0,l.computed)(()=>t.selectedResult.data?.script??``),d=(0,l.computed)(()=>{let e=t.selectedResult.data?.mesh;return c.r(e)?e:null}),f=(0,l.computed)(()=>{let e=t.selectedResult.data?.downloads,r=e?.name??`model`,i=[];return s.value&&i.push({kind:`script`,label:n.value.fileScript,fileName:`${r}.replicad.js`,type:`text/javascript`,content:{text:s.value}}),e&&i.push({kind:`step`,label:n.value.fileStep,fileName:`${r}.step`,type:`model/step`,content:{packed:e.step}},{kind:`stl`,label:n.value.fileStl,fileName:`${r}.stl`,type:`model/stl`,content:{packed:e.stl}},{kind:`views`,label:n.value.fileDrawings,fileName:`${r}.svg`,type:`image/svg+xml`,content:{packed:e.views}}),i});async function p(e){let t;try{t=`text`in e.content?e.content.text:await c.a(e.content.packed)}catch{return}let n=URL.createObjectURL(new Blob([t],{type:e.type})),r=document.createElement(`a`);r.href=n,r.download=e.fileName,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e4)}let m=e=>Number.isFinite(e)?e.toLocaleString(`en-US`):`–`,h=e=>`${e>0?`+`:e<0?`−`:``}${m(Math.abs(e))}`,g=e=>Object.entries(e).sort(([,e],[,t])=>t-e).map(([e,t])=>`${t} ${e}`).join(`, `);function _(e){if(e.selected===void 0)return``;let t=String(e.selected);return e.count===1&&e.available!==void 0?n.value.selectedOf.replace(`{selected}`,t).replace(`{available}`,String(e.available)):n.value.selected.replace(`{selected}`,t)}let v=(0,l.ref)(null),y,b=!1;async function x(e,t){try{await navigator.clipboard.writeText(e)}catch{return}b||(v.value=t,clearTimeout(y),y=setTimeout(()=>v.value=null,1500))}let S=(0,l.ref)(null),C=(0,l.ref)(null),w=(0,l.ref)(null),T=(0,l.ref)(oe()),E=(0,l.ref)(0),D=(0,l.computed)(()=>L(T.value,E.value)),O=(0,l.ref)(!1),k=null,A=null;function j(){S.value&&(E.value=S.value.clientHeight-(C.value?.offsetHeight??0)-(w.value?.offsetHeight??0))}function M(e){T.value=L(e,E.value),se(T.value)}function N(e){e.button===0&&(A={y:e.clientY,height:D.value},O.value=!0,w.value?.setPointerCapture(e.pointerId),e.preventDefault())}function ne(e){A&&M(A.height+e.clientY-A.y)}function P(){A=null,O.value=!1}function ie(e){let t={ArrowUp:D.value-24,ArrowDown:D.value+24,Home:0,End:E.value}[e.key];t!==void 0&&(e.preventDefault(),M(t))}function F(){T.value=null;try{globalThis.localStorage?.removeItem(R)}catch{}}let I=(0,l.ref)(null),B=(0,l.ref)(!0),V=(0,l.ref)(`iso`),H=(0,l.ref)(!1),U=(0,l.computed)(()=>d.value?H.value?n.value.noWebgl:``:n.value.noMesh),W=null,G=null,K=null,q=null,J=null,Y=null,X=0;function Z(){X&&=(cancelAnimationFrame(X),0),W&&G&&K&&W.render(G,K)}function Ke(){!X&&W&&(X=requestAnimationFrame(()=>{X=0,Z()}))}function qe(){let e=I.value;if(!e||W)return;try{W=new u.WebGLRenderer({antialias:!0,alpha:!0})}catch{H.value=!0;return}W.setPixelRatio(window.devicePixelRatio),W.setClearColor(0,0),e.appendChild(W.domElement),G=new u.Scene,K=new u.PerspectiveCamera(z,1,.1,1e3),K.up.set(0,0,1);let t=new u.DirectionalLight(16777215,1.5);t.position.set(-.5,.8,1),K.add(t),G.add(K),G.add(new u.HemisphereLight(16777215,7831692,2.2)),q=new ee(K,W.domElement),q.addEventListener(`change`,Ke),q.addEventListener(`start`,()=>V.value=null),Y=new ResizeObserver(Je),Y.observe(e),Je()}function Je(){let e=I.value;if(!e||!W||!K)return;let t=e.clientWidth,n=e.clientHeight;t!==0&&n!==0&&(W.setSize(t,n),K.aspect=t/n,K.updateProjectionMatrix(),V.value?Q(V.value):Z())}function Q(e){V.value=e;let t=d.value;if(!t||!K||!q)return;let n=ae(t.min,t.max,e,z,K.aspect);K.position.set(...n.position),K.near=n.distance/100,K.far=n.distance+n.radius*10,K.updateProjectionMatrix(),q.target.set(...n.target),q.update(),Z()}function $(){if(!G)return;J&&=(G.remove(J.faces,J.edges),J.dispose(),null);let e=d.value;e?(J=re(c.t(e)),J.edges.visible=B.value,G.add(J.faces,J.edges),Q(`iso`)):Z()}return(0,l.onMounted)(()=>{S.value&&(k=new ResizeObserver(j),k.observe(S.value),C.value&&k.observe(C.value)),j(),qe(),$()}),(0,l.watch)(d,$),(0,l.watch)(B,e=>{J&&(J.edges.visible=e),Z()}),(0,l.onUnmounted)(()=>{b=!0,clearTimeout(y),X&&cancelAnimationFrame(X),Y?.disconnect(),k?.disconnect(),q?.dispose(),J?.dispose(),W&&(W.dispose(),W.forceContextLoss(),W.domElement.remove()),W=null}),(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{ref_key:`root`,ref:S,class:`brep-view bg-[var(--brep-bg)] text-sm text-[var(--brep-text)]`,"data-testid":`brep-view`},[(0,l.createElementVNode)(`div`,{ref_key:`header`,ref:C,class:`brep-header flex-wrap items-center gap-2 border-b border-[var(--brep-border)] bg-[var(--brep-bg)] px-3 py-2`},[(0,l.createElementVNode)(`h1`,{class:`mr-auto min-w-0 truncate text-base font-semibold text-[var(--brep-strong)]`,title:a.value},(0,l.toDisplayString)(a.value),9,ce),(0,l.createElementVNode)(`div`,le,[((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(r,e=>(0,l.createElementVNode)(`button`,{key:e,type:`button`,class:(0,l.normalizeClass)([`h-8 rounded border px-2.5`,e===V.value?`border-[var(--brep-active)] bg-[var(--brep-active)] text-[var(--brep-on-active)]`:`border-[var(--brep-border-strong)] bg-[var(--brep-bg)] text-[var(--brep-text-2)] hover:bg-[var(--brep-hover)]`]),"aria-pressed":e===V.value,"data-testid":`brep-view-${e}`,onClick:t=>Q(e)},(0,l.toDisplayString)((0,l.unref)(n)[i[e]]),11,ue)),64)),(0,l.createElementVNode)(`label`,de,[(0,l.withDirectives)((0,l.createElementVNode)(`input`,{"onUpdate:modelValue":t[0]||=e=>B.value=e,type:`checkbox`,"data-testid":`brep-edges`},null,512),[[l.vModelCheckbox,B.value]]),(0,l.createTextVNode)(` `+(0,l.toDisplayString)((0,l.unref)(n).edges),1)])])],512),(0,l.createElementVNode)(`div`,{class:`brep-model brep-ground`,style:(0,l.normalizeStyle)({height:`${D.value}px`}),"data-testid":`brep-model`},[(0,l.createElementVNode)(`div`,{ref_key:`viewport`,ref:I,class:`absolute inset-0`,"data-testid":`brep-viewport`},null,512),U.value?((0,l.openBlock)(),(0,l.createElementBlock)(`p`,fe,(0,l.toDisplayString)(U.value),1)):(0,l.createCommentVNode)(``,!0)],4),(0,l.createElementVNode)(`div`,{ref_key:`bar`,ref:w,class:(0,l.normalizeClass)([`brep-bar`,{"brep-bar-dragging":O.value}]),role:`separator`,"aria-orientation":`horizontal`,tabindex:`0`,"aria-label":(0,l.unref)(n).resizeModel,"aria-valuenow":D.value,"aria-valuemin":0,"aria-valuemax":Math.max(E.value,0),"data-testid":`brep-bar`,onPointerdown:N,onPointermove:ne,onPointerup:P,onPointercancel:P,onKeydown:ie,onDblclick:F},[...t[2]||=[(0,l.createElementVNode)(`span`,{class:`brep-bar-grip`},null,-1)]],42,pe),(0,l.createElementVNode)(`div`,me,[o.value?((0,l.openBlock)(),(0,l.createElementBlock)(`section`,he,[o.value.warnings.length?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,ge,[(0,l.createElementVNode)(`h2`,_e,(0,l.toDisplayString)((0,l.unref)(n).warnings),1),(0,l.createElementVNode)(`ul`,ve,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.warnings,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:e},(0,l.toDisplayString)(e),1))),128))])])):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`dl`,ye,[(0,l.createElementVNode)(`dt`,be,(0,l.toDisplayString)((0,l.unref)(n).size),1),(0,l.createElementVNode)(`dd`,xe,(0,l.toDisplayString)(o.value.size.join(` × `))+` mm `,1),(0,l.createElementVNode)(`dt`,Se,(0,l.toDisplayString)((0,l.unref)(n).volume),1),(0,l.createElementVNode)(`dd`,Ce,(0,l.toDisplayString)(m(o.value.volume))+` mm³`,1),(0,l.createElementVNode)(`dt`,we,(0,l.toDisplayString)((0,l.unref)(n).surface),1),(0,l.createElementVNode)(`dd`,Te,(0,l.toDisplayString)(m(o.value.area))+` mm²`,1),(0,l.createElementVNode)(`dt`,Ee,(0,l.toDisplayString)((0,l.unref)(n).solids),1),(0,l.createElementVNode)(`dd`,De,(0,l.toDisplayString)(o.value.solids),1),(0,l.createElementVNode)(`dt`,Oe,(0,l.toDisplayString)((0,l.unref)(n).faces),1),(0,l.createElementVNode)(`dd`,ke,(0,l.toDisplayString)(g(o.value.faces)),1),(0,l.createElementVNode)(`dt`,Ae,(0,l.toDisplayString)((0,l.unref)(n).edgeKinds),1),(0,l.createElementVNode)(`dd`,null,(0,l.toDisplayString)(g(o.value.edges)),1)]),o.value.parts?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:1},[(0,l.createElementVNode)(`h2`,je,(0,l.toDisplayString)((0,l.unref)(n).parts),1),(0,l.createElementVNode)(`ul`,Me,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.parts,(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:t,class:`tabular-nums`},(0,l.toDisplayString)(e.name??t+1)+`: `+(0,l.toDisplayString)(e.size.join(` × `))+` mm, `+(0,l.toDisplayString)(m(e.volume))+` mm³ `,1))),128))])],64)):(0,l.createCommentVNode)(``,!0),o.value.operations.length?((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:2},[(0,l.createElementVNode)(`h2`,Ne,(0,l.toDisplayString)((0,l.unref)(n).operations),1),(0,l.createElementVNode)(`ol`,Pe,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(o.value.operations,(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:t,class:`flex flex-wrap items-baseline gap-x-2`},[e.line===void 0?(0,l.createCommentVNode)(``,!0):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Fe,(0,l.toDisplayString)((0,l.unref)(n).line)+` `+(0,l.toDisplayString)(e.line),1)),(0,l.createElementVNode)(`code`,Ie,(0,l.toDisplayString)(e.op)+`(`+(0,l.toDisplayString)(e.size??``)+`)`+(0,l.toDisplayString)(e.count>1?` ×${e.count}`:``),1),_(e)?((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Le,(0,l.toDisplayString)(_(e)),1)):(0,l.createCommentVNode)(``,!0),e.volumeChange===void 0?(0,l.createCommentVNode)(``,!0):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,Re,(0,l.toDisplayString)(h(e.volumeChange))+` mm³ `,1))]))),128))])],64)):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`h2`,ze,(0,l.toDisplayString)((0,l.unref)(n).files),1),(0,l.createElementVNode)(`ul`,Be,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(f.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`li`,{key:e.kind},[(0,l.createElementVNode)(`button`,{type:`button`,class:`rounded border border-[var(--brep-border-strong)] px-2.5 py-1 hover:bg-[var(--brep-hover)]`,title:e.fileName,"data-testid":`brep-download-${e.kind}`,onClick:t=>p(e)},(0,l.toDisplayString)((0,l.unref)(n).download)+` `+(0,l.toDisplayString)(e.label),9,Ve)]))),128))])])):(0,l.createCommentVNode)(``,!0),s.value?((0,l.openBlock)(),(0,l.createElementBlock)(`details`,He,[(0,l.createElementVNode)(`summary`,Ue,[(0,l.createElementVNode)(`span`,We,(0,l.toDisplayString)((0,l.unref)(n).script),1),(0,l.createElementVNode)(`button`,{type:`button`,class:`rounded border border-[var(--brep-border-strong)] px-1.5 py-0.5 text-xs hover:bg-[var(--brep-hover)]`,onClick:t[1]||=(0,l.withModifiers)(e=>x(s.value,`script`),[`prevent`,`stop`])},(0,l.toDisplayString)(v.value===`script`?(0,l.unref)(n).copied:(0,l.unref)(n).copy),1)]),(0,l.createElementVNode)(`pre`,Ge,[(0,l.createElementVNode)(`code`,null,(0,l.toDisplayString)(s.value),1)])])):(0,l.createCommentVNode)(``,!0)])],512))}}),[[`__scopeId`,`data-v-ff3bd1d3`]]),V={class:`flex flex-col gap-0.5 rounded bg-slate-100 p-2 text-slate-800`,"data-testid":`brep-preview`},H=[`title`],U={key:0,class:`text-xs tabular-nums text-slate-600`},W={key:1,class:`text-xs text-amber-700`,"data-testid":`brep-preview-warnings`},G=(0,l.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let t=e,n=te(),r=(0,l.computed)(()=>t.result.title||n.value.untitled),i=(0,l.computed)(()=>t.result.data?.report);return(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,V,[(0,l.createElementVNode)(`div`,{class:`truncate text-sm font-semibold`,title:r.value},(0,l.toDisplayString)(r.value),9,H),i.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,U,(0,l.toDisplayString)(i.value.size.join(` × `))+` mm `,1)):(0,l.createCommentVNode)(``,!0),i.value?.warnings.length?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,W,(0,l.toDisplayString)((0,l.unref)(n).warnings)+`: `+(0,l.toDisplayString)(i.value.warnings.length),1)):(0,l.createCommentVNode)(``,!0)]))}}),K=`Use the ${c.s} tool for a part that will be made or that must fit: brackets, enclosures, flanges, jigs, anything with fillets, chamfers, holes to a size, or a STEP file to hand on. It builds a replicad script with a CAD kernel and returns a report to check the result against. For a model that is only looked at, use ShapeScript. Z is up and the user looks from -Y: put the side they should see first at -Y (a chair's seat front at -Y, its backrest at +Y).`,q={toolDefinition:c.o,execute:async()=>({message:`presentBrep runs on the host's server (executePresentBrep from @gui-chat-plugin/brep), not in the page.`}),generatingMessage:`Building the solid model...`,waitingMessage:`Tell the user that the solid model is being built and will be shown shortly.`,isEnabled:()=>!0,viewComponent:B,previewComponent:G,systemPrompt:K},J={plugin:q};exports.Preview=G,exports.SYSTEM_PROMPT=K,exports.TOOL_DEFINITION=c.o,exports.TOOL_NAME=c.s,exports.View=B,exports.decodeMesh=c.t,exports.default=J,exports.isBrepMesh=c.r,exports.plugin=q;
|